Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2025 Aug 9;15(1):29219.
doi: 10.1038/s41598-025-14680-y.

Natural language processing reveals network structure of pain communication in social media using discrete mathematical analysis

Affiliations

Natural language processing reveals network structure of pain communication in social media using discrete mathematical analysis

Nobuo Okui et al. Sci Rep. .

Abstract

Pain-related discussions on social media provide valuable insights into how people naturally express and communicate their pain experiences. However, the network structure of these discussions remains poorly understood. This study analyzed 57,000 Reddit comments from the GoEmotions dataset (2005-2019) using natural language processing and network analysis techniques grounded in discrete mathematical principles. The constructed network, comprising 5,630 nodes and 86,972 edges, revealed complex patterns of pain-related language use. The network exhibited a sparse overall density (0.0055) but a high clustering coefficient (0.7700), indicating the presence of distinct thematic communities. At the center of the network was the term pain, which showed the highest degree centrality (0.821429), reflecting its semantic anchoring function in pain discourse. Other terms, such as headache, served as context-sensitive bridge nodes that connected different semantic subdomains. In contrast, terms like burning, despite moderate centrality values, were found to co-occur predominantly with metaphorical or decorative expressions rather than emotion- or symptom-related descriptors. Community detection revealed 12 distinct clusters, with the largest containing 1,021 nodes, capturing diverse aspects of pain communication. Stability analysis demonstrated that core pain-related terms maintained consistent centrality, while peripheral or metaphorical terms showed greater variability. These findings offer novel insights into the semantic structure of pain discourse and suggest that network analysis of social media discussions can inform improved clinical communication and symptom assessment.

Keywords: Digital health communication; Discrete mathematics in health communication; Natural language; Pain assessment in social media; Pain perception; Symptom network analysis.

PubMed Disclaimer

Conflict of interest statement

Competing interests: The authors declare no competing interests. Generative AI and AI-assisted technologies in the writing process: We used Python libraries with machine learning capabilities for statistical analysis and network visualization. However, no generative AI or AI-assisted technologies were used in the writing or editing of the manuscript text.

Figures

Fig. 1
Fig. 1
Network visualization of pain-related terms. Co-occurrence network of 5,630 unique terms and 86,972 edges. Nodes represent individual terms; edges represent co-occurrence within a five-word sliding window. Node size scaled by centrality values. All nodes displayed in uniform color.
Fig. 2
Fig. 2
Centrality measures for key pain-related terms in the network. Red nodes: primary pain-related keywords (pain, headache, burning, discomfort, ache). Blue nodes: secondary terms connected via co-occurrence. Node size proportional to degree centrality. Edge length inversely related to co-occurrence strength; shorter edges represent stronger associations.
Fig. 3
Fig. 3
Logarithmic histogram of centrality measures for key pain-related terms. (a) Degree centrality. (b) Betweenness centrality. (c) Eigenvector centrality. Terms: pain, headache, burning, discomfort, ache. X-axis: node labels. Y-axis: centrality values (log scale). Each bar represents a node.
Fig. 4
Fig. 4
Detected Communities in the Pain-Related Network Using the Louvain Method. Community structure of the pain-related lexical network, based on Louvain modularity detection. Each color denotes a distinct community. Community 0 (light blue): cluster around headache, including both literal symptom terms (e.g., sinus, minor) and metaphorical expressions (e.g., border, legacy). Community 1(Red): centered on discomfort, including relational and evaluative terms (e.g., who, would, deserved). Community 2 (yellow): largest cluster (225 nodes), centered on the term pain, representing general pain discourse. Community 3 (purple): cluster anchored by burning, combining somatic (e.g., legs, bloated) and symbolic terms (e.g., regret, church). Node size corresponds to degree centrality. Edge length inversely proportional to co-occurrence frequency.
Fig. 5
Fig. 5
Instability of centrality measures for key pain-related terms. Centrality values and standard deviations for five pain-related terms (pain, headache, burning, discomfort, ache). (a) Degree centrality. (b) Betweenness centrality. (c) Eigenvector centrality. X-axis: node labels. Y-axis: centrality values. Error bars: standard deviations.

Similar articles

References

    1. Bradley, M. M. & Lang, P. J. Affective norms for English words (ANEW): instruction manual and affective ratings. Technical report C-2. Univ. Florida, Gainesville (2010).
    1. Ekman, P., Davidson, R. J. & Friesen, W. V. The Duchenne smile: Emotional expression and brain physiology. II. J. Pers. Soc. Psychol.58, 342–353 (1990). - PubMed
    1. Jackson, J. C. et al. From text to thought: How analyzing language can advance psychological science. Perspect. Psychol. Sci.17, 805–826 (2022). - PMC - PubMed
    1. Saffar, A. H., Mann, T. K. & Ofoghi, B. Textual emotion detection in health: Advances and applications. J. Biomed. Inform.137, 104258 (2023). - PubMed
    1. Craig, K. D. Toward the social communication model of pain. In Social and Interpersonal Dynamics in Pain (eds Vervoort, T. et al.) 23–41 (Springer, 2018).

LinkOut - more resources