BACKGROUND: Contraceptive method choice is often strongly influenced by the experiences and opinions of one's social network. Although social media, including Twitter, increasingly influences reproductive-age individuals, discussion of contraception in this setting has yet to be characterized. Natural language processing, a type of machine learning in which computers analyze natural language data, enables this analysis. OBJECTIVE: This study aimed to illuminate temporal trends in attitudes toward long-and short-acting reversible contraceptive methods in tweets between 2006 and 2019 and establish social media platforms as alternate data sources for large-scale sentiment analysis on contraception. STUDY DESIGN: We studied English-language tweets mentioning reversible prescription contraceptive methods between March 2006 (founding of Twitter) and December 2019. Tweets mentioning contraception were extracted using search terms, including generic or brand names, colloquial names, and abbreviations. We characterized and performed sentiment analysis on tweets. We used Mann-Kendall nonparametric tests to assess temporal trends in the overall number and the number of positive, negative, and neutral tweets referring to each method. The code to reproduce this analysis is available at https://github.com/ hms-dbmi/contraceptionOnTwitter.
RESULTS:We extracted 838,739 tweets mentioning at least 1 contraceptive method. The annual number of contraception-related tweets increased considerably over the study period. The intrauterine device was the most commonly referenced method (45.9%). Long-acting methods were mentioned more often than short-acting ones (58% vs 42%), and the annual proportion of long-acting reversible contraceptionrelated tweets increased over time. In sentiment analysis of tweets mentioning a single contraceptive method (n¼665,064), the greatest proportion of all tweets was negative (65,339 of 160,713 tweets with at least 95% confident sentiment, or 40.66%). Tweets mentioning longacting methods were nearly twice as likely to be positive compared with tweets mentioning short-acting methods (19.65% vs 10.21%; P<.002). CONCLUSION: Recognizing the influence of social networks on contraceptive decision making, social media platforms may be useful in the collection and dissemination of information about contraception.