Developing an Automatic System for Classifying Chatter About Health Services on Twitter: Case Study for Medicaid
- PMID: 33938807
- PMCID: PMC8129876
- DOI: 10.2196/26616
Developing an Automatic System for Classifying Chatter About Health Services on Twitter: Case Study for Medicaid
Abstract
Background: The wide adoption of social media in daily life renders it a rich and effective resource for conducting near real-time assessments of consumers' perceptions of health services. However, its use in these assessments can be challenging because of the vast amount of data and the diversity of content in social media chatter.
Objective: This study aims to develop and evaluate an automatic system involving natural language processing and machine learning to automatically characterize user-posted Twitter data about health services using Medicaid, the single largest source of health coverage in the United States, as an example.
Methods: We collected data from Twitter in two ways: via the public streaming application programming interface using Medicaid-related keywords (Corpus 1) and by using the website's search option for tweets mentioning agency-specific handles (Corpus 2). We manually labeled a sample of tweets in 5 predetermined categories or other and artificially increased the number of training posts from specific low-frequency categories. Using the manually labeled data, we trained and evaluated several supervised learning algorithms, including support vector machine, random forest (RF), naïve Bayes, shallow neural network (NN), k-nearest neighbor, bidirectional long short-term memory, and bidirectional encoder representations from transformers (BERT). We then applied the best-performing classifier to the collected tweets for postclassification analyses to assess the utility of our methods.
Results: We manually annotated 11,379 tweets (Corpus 1: 9179; Corpus 2: 2200) and used 7930 (69.7%) for training, 1449 (12.7%) for validation, and 2000 (17.6%) for testing. A classifier based on BERT obtained the highest accuracies (81.7%, Corpus 1; 80.7%, Corpus 2) and F1 scores on consumer feedback (0.58, Corpus 1; 0.90, Corpus 2), outperforming the second best classifiers in terms of accuracy (74.6%, RF on Corpus 1; 69.4%, RF on Corpus 2) and F1 score on consumer feedback (0.44, NN on Corpus 1; 0.82, RF on Corpus 2). Postclassification analyses revealed differing intercorpora distributions of tweet categories, with political (400778/628411, 63.78%) and consumer feedback (15073/27337, 55.14%) tweets being the most frequent for Corpus 1 and Corpus 2, respectively.
Conclusions: The broad and variable content of Medicaid-related tweets necessitates automatic categorization to identify topic-relevant posts. Our proposed system presents a feasible solution for automatic categorization and can be deployed and generalized for health service programs other than Medicaid. Annotated data and methods are available for future studies.
Keywords: Medicaid; Twitter; consumer feedback; infodemiology; infoveillance; machine learning; natural language processing; social media.
©Yuan-Chi Yang, Mohammed Ali Al-Garadi, Whitney Bremer, Jane M Zhu, David Grande, Abeed Sarker. Originally published in the Journal of Medical Internet Research (https://www.jmir.org), 03.05.2021.
Conflict of interest statement
Conflicts of Interest: None declared.
Figures



Similar articles
-
Toward Using Twitter for Tracking COVID-19: A Natural Language Processing Pipeline and Exploratory Data Set.J Med Internet Res. 2021 Jan 22;23(1):e25314. doi: 10.2196/25314. J Med Internet Res. 2021. PMID: 33449904 Free PMC article.
-
Machine Learning and Natural Language Processing for Geolocation-Centric Monitoring and Characterization of Opioid-Related Social Media Chatter.JAMA Netw Open. 2019 Nov 1;2(11):e1914672. doi: 10.1001/jamanetworkopen.2019.14672. JAMA Netw Open. 2019. PMID: 31693125 Free PMC article.
-
Promoting Reproducible Research for Characterizing Nonmedical Use of Medications Through Data Annotation: Description of a Twitter Corpus and Guidelines.J Med Internet Res. 2020 Feb 26;22(2):e15861. doi: 10.2196/15861. J Med Internet Res. 2020. PMID: 32130117 Free PMC article.
-
Methods to Establish Race or Ethnicity of Twitter Users: Scoping Review.J Med Internet Res. 2022 Apr 29;24(4):e35788. doi: 10.2196/35788. J Med Internet Res. 2022. PMID: 35486433 Free PMC article.
-
Applying natural language processing and machine learning techniques to patient experience feedback: a systematic review.BMJ Health Care Inform. 2021 Mar;28(1):e100262. doi: 10.1136/bmjhci-2020-100262. BMJ Health Care Inform. 2021. PMID: 33653690 Free PMC article.
Cited by
-
Automatic gender detection in Twitter profiles for health-related cohort studies.JAMIA Open. 2021 Jun 23;4(2):ooab042. doi: 10.1093/jamiaopen/ooab042. eCollection 2021 Apr. JAMIA Open. 2021. PMID: 34169232 Free PMC article.
References
-
- Chen PS, Wu S, Yoon J. The impact of online recommendations and consumer feedback on sales. Proceedings of the International Conference on Information Systems, ICIS 2004; International Conference on Information Systems, ICIS 2004; December 12-15, 2004; Washington, DC, USA. 2004. https://aisel.aisnet.org/icis2004/58/
-
- Mudambi SM, Schuff D. Research note: what makes a helpful online review? A study of customer reviews on Amazon.com. MIS Q. 2010;34(1):185. doi: 10.2307/20721420. - DOI
-
- Hu M, Liu B. Mining and summarizing customer reviews. Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining; KDD04: ACM SIGKDD International Conference on Knowledge Discovery and Data Mining; August, 2004; Seattle WA USA. 2004. pp. 168–77. - DOI
-
- Lim Y, Van Der Heide B. Evaluating the wisdom of strangers: the perceived credibility of online consumer reviews on yelp. J Comput-Mediat Comm. 2014 Aug 25;20(1):67–82. doi: 10.1111/jcc4.12093. - DOI
Publication types
MeSH terms
LinkOut - more resources
Full Text Sources
Other Literature Sources