Can Facebook posts predict who might soon end up in the emergency department?

They can, say University of Pennsylvania researchers who analyzed several thousand Facebook posts from patients who later sought care at an urban hospital.

The researchers developed a machine-learning model that examined linguistic features like vocabulary, the use of positive or negative emotion, arousal — how calming or exciting a post was — and the use of “depressed language” to detect changes in language on individuals’ Facebook posts over time.

In the study, the researchers obtained Facebook posts and electronic health records from 2,915 individuals seeking care at an urban hospital. In this group, part of an ongoing social medicine study, 419 had recently visited a hospital or emergency department with concerns ranging from chest pain to pregnancy-related issues. The researchers used the model to analyze Facebook posts of these patients from as early as 2.5 months before their hospital visits.

As the researchers describe in a paper recently published in Nature Scientific Reports, the Facebook posts of most of these individuals showed significant changes in language. Before the visits, they were more likely to post about leisure and use internet slang and informal language. But as they got closer to needing hospital or emergency services, their Facebook posts grew more worrisome and anxious. They also began to increasingly discuss family and health.

While the researchers studied mainly changes in language before the visits, they also noticed that some Facebook posts were good indicators of how patients’ behaviors directly related to these visits. For example, less than a month before one patient was admitted to the emergency department for chest pain related to heart failure, the patient had posted on Facebook about eating a cheeseburger and fries — the kind of salty meal that can worsen heart failure.

“There is a lot of insight [on social media] around what’s happening in people’s lives before they present themselves to the hospital, and some of these can be used in the care setting,” Sharath Guntuku, lead author of the study and a research scientist at the Center for Digital Health at the University of Pennsylvania, told STAT.

According to Guntuku, a predictive model like this that uses a combination of social media information and data from smartphone sensors, which includes records of an individual’s physical activity and sleep, can provide a more accurate understanding of his or her health.

Shabbir Syed Abdul, associate professor of artificial intelligence and digital health at Taipei Medical University, called this an “innovative model” that would prove useful if employed by the U.S. Centers for Disease Control and Prevention and others to monitor the spread of coronavirus.

“CDC should not just be focusing on reports from hospitals but should also keep an eye on people who are showing symptoms [of coronavirus] and talking about it on social media. They can even track someone’s travel history,” said Abdul, who was not involved in the study.

According to Abdul, this study is an “initial step” toward using social media in health care. Future work should focus on providing more in-depth analyses on how changes on Facebook and other social media platforms relate to emergency department visits for specific health conditions.