Skip to main content
Advertisement
Browse Subject Areas
?

Click through the PLOS taxonomy to find articles in your field.

For more information about PLOS Subject Areas, click here.

  • Loading metrics

Temporal proximity to counseling is associated with longitudinal bedaquiline and antiretroviral therapy adherence in multidrug-resistant tuberculosis and HIV treatment

  • Xuan Lu ,

    Roles Conceptualization, Formal analysis, Methodology, Software, Visualization, Writing – original draft, Writing – review & editing

    mo2130@cumc.columbia.edu (MO); xl3214@columbia.edu (XL)

    Affiliation Division of Pulmonary, Allergy, and Critical Care Medicine, Columbia University Irving Medical Center, New York, New York, United States of America

    ⨯
  • Jennifer Zelnick,

    Roles Conceptualization, Data curation, Validation, Writing – review & editing

    Affiliations Graduate School of Social Work, Touro University, New York, New York, United States of America, School of Applied Human Sciences, University of KwaZulu-Natal, Durban, South Africa

    ⨯
  • Meng Zhao,

    Roles Conceptualization, Methodology, Software, Writing – review & editing

    Affiliation Department of Industrial and Systems Engineering, Lehigh University, Bethlehem, Pennsylvania, United States of America

    ⨯
  • Matthew Cummings,

    Roles Supervision, Writing – review & editing

    Affiliation Division of Pulmonary, Allergy, and Critical Care Medicine, Columbia University Irving Medical Center, New York, New York, United States of America

    ⨯
  • Allison K. Wolf,

    Roles Data curation, Project administration, Resources, Writing – review & editing

    Affiliation Division of Pulmonary, Allergy, and Critical Care Medicine, Columbia University Irving Medical Center, New York, New York, United States of America

    ⨯
  • Kevin Guzman,

    Roles Methodology, Resources, Writing – review & editing

    Affiliation Division of Pulmonary, Allergy, and Critical Care Medicine, Columbia University Irving Medical Center, New York, New York, United States of America

    ⨯
  • Hlengiwe Nyilana,

    Roles Data curation, Resources, Validation, Writing – review & editing

    Affiliation CAPRISA MRC- HIV-TB Pathogenesis and Treatment Research Unit, Durban, South Africa

    ⨯
  • Rubeshan Perumal,

    Roles Conceptualization, Supervision, Writing – review & editing

    Affiliations CAPRISA MRC- HIV-TB Pathogenesis and Treatment Research Unit, Durban, South Africa, Department of Pulmonology and Critical Care, School of Clinical Medicine, College of Health Sciences, University of KwaZulu-Natal, Durban, South Africa

    ⨯
  • Kathleen Rivet Amico,

    Roles Supervision, Validation, Writing – review & editing

    Affiliation University of Michigan School of Public Health, Ann Arbor, Michigan, United States of America

    ⨯
  • Karl Reis,

    Roles Data curation, Writing – review & editing

    Affiliation Department of Medicine, University of Washington, Seattle, Washington, United States of America

    ⨯
  • Mbali Zulu,

    Roles Data curation, Project administration, Writing – review & editing

    Affiliation CAPRISA MRC- HIV-TB Pathogenesis and Treatment Research Unit, Durban, South Africa

    ⨯
  • Amrita Daftary,

    Roles Validation, Writing – review & editing

    Affiliations CAPRISA MRC- HIV-TB Pathogenesis and Treatment Research Unit, Durban, South Africa, School of Global Health and Dahdaleh Institute of Global Health Research, York University, Toronto, Canada

    ⨯
  • Boitumelo Seepamore,

    Roles Validation, Writing – review & editing

    Affiliations School of Applied Human Sciences, University of KwaZulu-Natal, Durban, South Africa, CAPRISA MRC- HIV-TB Pathogenesis and Treatment Research Unit, Durban, South Africa

    ⨯
  • Kogieleum Naidoo,

    Roles Validation, Writing – review & editing

    Affiliation CAPRISA MRC- HIV-TB Pathogenesis and Treatment Research Unit, Durban, South Africa

    ⨯
  • Max O’Donnell

    Roles Conceptualization, Funding acquisition, Investigation, Supervision, Writing – review & editing

    mo2130@cumc.columbia.edu (MO); xl3214@columbia.edu (XL)

    Affiliations Division of Pulmonary, Allergy, and Critical Care Medicine, Columbia University Irving Medical Center, New York, New York, United States of America, CAPRISA MRC- HIV-TB Pathogenesis and Treatment Research Unit, Durban, South Africa, Department of Epidemiology, Columbia University Irving Medical Center, New York, New York, United States of America

    ⨯

Abstract

Background

Medication adherence is a persistent challenge in the treatment of multidrug-resistant tuberculosis (MDR-TB) and HIV. Routine counseling notes are an underutilized source of information on patient adherence context.

Methods

We applied natural language processing (NLP) to routine counseling notes from a randomized controlled trial of MDR-TB/HIV treatment in South Africa. Topics were derived using topic modeling; notes were semantically matched to topics and clustered using K-means. We fitted linear mixed-effects (LME) regression models with participant-level random intercepts and five-fold cross-validation to model adherence to bedaquiline (BDQ) and antiretroviral therapy (ART), measured using cellular-enabled electronic dose monitor (EDM). Cosine similarity scores, cluster assignments, and temporal proximity to counseling sessions were included as covariates. Model fit was assessed using mean absolute error (MAE) and root mean square error (RMSE).

Results

We analyzed 327 counseling notes from 76 participants. Six thematic clusters were derived: substance use, logistical barriers, limited social support, side effect management, financial stability, and financial insecurity/low support. LME showed modest fit. For BDQ adherence, MAE was 0.158 (95% CI 0.113–0.204) and RMSE 0.208 (95% CI 0.133–0.283). For ART, MAE was 0.180 (95% CI 0.170–0.191) and RMSE 0.224 (95% CI 0.202–0.246). Cluster membership was not associated with adherence. In contrast, temporal proximity to counseling was more consistently associated with adherence. Adherence was highest immediately following counseling sessions. Both BDQ and ART adherence declined during the intermediate period (β=−0.048, p = 0.001; β=−0.031, p = 0.022, respectively), and ART adherence declined further in the period preceding the next session (β=−0.032, p = 0.020).

Conclusion

NLP methods structured routine counseling notes into interpretable, adherence-related themes. Temporal proximity to counseling sessions was consistently associated with longitudinal BDQ and ART adherence. These findings offer preliminary insights into adherence dynamics and generate hypotheses about the role of counseling session timing in adherence support.

Introduction

Tuberculosis (TB) is a major global public health threat, with an estimated 10.8 million people diagnosed worldwide in 2023, and increasing global TB incidence since 2020 [1]. South Africa is among the ten countries classified by the World Health Organization as high-burden for TB, multidrug- or rifampicin-resistant TB (MDR/RR-TB), and TB/HIV co-infection [1]. South Africa was one of the first countries to implement a novel six-month bedaquiline-based MDR-TB regimen [2]. For MDR/RR-TB, six-month bedaquiline, pretomanid, and linezolid (BPaL)-based regimens have demonstrated high success rate of 90% in clinical trials [3]. However, in operational settings, these results have not been consistently replicated, which has been attributed to suboptimal medication adherence [4].

Medication adherence may be impacted by both structural and psychosocial barriers, including limited healthcare access, food insecurity, drug side effects, pill burden, substance use, and stigma [2,5–9]. For individuals living with HIV, concomitant antiretroviral therapy (ART) further challenges medication adherence [1,4,10,11]. Population specific intervention strategies to support ART adherence among people being treated for HIV, including peer support, SMS/phone call reminders, and adherence counseling have been developed alongside effective medication [12]. Intervention strategies to support TB medication adherence, including nutritional support and counseling, have also shown promising results [5,13,14].

Cellular-enabled electronic dose monitoring (EDM) devices, which can capture granular pill-taking behaviors, have been shown to accurately reflect treatment response and outcome in MDR-TB [15]. These devices typically share core functions, including automatic dose recording and patient reminder systems, and have demonstrated effectiveness in measuring adherence across multiple clinical studies [16–19]. However, results of studies to assess real-world use of EDM to support adherence are mixed, suggesting that technological solutions alone may be insufficient to address adherence challenges [20].

Qualitative data from routine care, such as medical encounters and counseling session notes, may offer critical insights into psychosocial factors shaping patient treatment experiences that can guide the use of appropriate targeted interventions to address specific adherence barriers [14,21]. Yet these data are often underutilized due to their unstructured format, a challenge often observed in low- and middle-income country settings, where the qualitative research capacity may be limited [21,22]. Advances in artificial intelligence, particularly natural language processing (NLP), now enable scalable, efficient analysis of these narratives [23,24]. NLP approaches, ranging from rule-based and machine learning methods to modern transformer architectures, can identify key themes, relationships, and contextual meanings within clinical text [25–27]. Such tools hold particular promise in resource-limited settings like South Africa, where data scarcity, infrastructure constraints, and high analytic costs hinder traditional qualitative research [28–30].

We applied natural language processing to routine adherence counseling notes from people with MDR-TB/HIV co-infection in South Africa to identify adherence-related themes and examine their longitudinal association with EDM-measured adherence to bedaquiline and antiretroviral therapy. We also included temporal proximity to counseling sessions as a covariate, to assess whether session timing explained adherence dynamics beyond thematic note content. Together, these analyses aimed to explore a scalable approach for structuring routinely collected clinical text to better understand adherence challenges in resource-limited settings.

Methods

Study design

Eligible participants were adults with confirmed MDR-TB and HIV, starting a bedaquiline (BDQ) -based regimen while on antiretroviral therapy (ART), and were prospectively enrolled to the PRospective study of Adherence in M/XDR-TB Implementation Science study (the PRAXIS study; ClinicalTrials.gov IDs: NCT03162107, NCT04032730) at a TB referral hospital and affiliated clinics in KwaZulu-Natal, South Africa. Participants were followed monthly for six months, and subsequently until treatment completion.

This study followed a proposed analysis framework (Fig 1).

thumbnail
Fig 1. Analysis framework.

Structured approach to extracting semantic features from unstructured counseling notes and using them to model medication adherence. n is sample size; d is number of variables.

https://doi.org/10.1371/journal.pone.0355696.g001

Data collection

At each follow-up visit, participants were scheduled to receive a monthly counseling intervention (MCI). The MCI followed a motivational interviewing framework and was guided by the situated Information, Motivation and Behavioral Skills (sIMB) model, with each session structured around a patient-developed personal adherence plan [31,32]. Each MCI session averaged 40 minutes and was conducted by two bilingual counselors in isiZulu. After the session, the counselors summarized their accounts of patient experiences and adherence barriers in English, following a semi-structured documentation template. These summary notes reflect interpreted rather than direct patient accounts, with potential for translation loss, documentation bias, and unmeasured counselor-level variation.

Adherence to both BDQ and ART was monitored using EDM devices (Wisepill RT2000). Each participant received separate devices for BDQ and ART at treatment initiation. Device activity was tracked in real time with missed openings serving as a surrogate for medication nonadherence.

Data processing and exploratory analysis

The MCI notes were processed using a standardized preprocessing pipeline to optimize data for NLP analyses. Preprocessing involved tokenization, stop-word removal, and lemmatization. Preprocessed textual data were transformed into numerical representations using Sentence-BERT (SBERT), a transformer-based approach known for capturing semantic context [33]. SBERT embeddings provided dense, high-dimensional semantic representations of counseling notes and served as the foundational dataset for the subsequent topic modeling and semantic clustering analyses.

We temporally aligned adherence data to the timing of each participant’s MCI session and divided the interval between consecutive sessions into three categorical temporal periods (“time-chunks”): “Post-Session,” the first seven days following an MCI session; “Intermediate,” the period between the Post-Session and Pre-Session windows; and “Pre-Session,” the seven days preceding the subsequent MCI session. As initial exploratory analysis, we assessed the patterns of BDQ/ART adherence and the time-chunks using appropriate non-parametric tests.

Topic modeling, semantic search and clustering

We used BERTopic coupled with clinical expert review to identify latent topics within the notes [34]. BERTopic is an unsupervised topic-modeling framework combining dimensionality reduction (Uniform Manifold Approximation and Projection, UMAP), clustering techniques (Hierarchical Density-Based Spatial Clustering of Applications with Noise, HDBSCAN), and keyword extraction (class-based term frequency-inverse document frequency, c-TF-IDF). After BERTopic returned latent keyword groups, we used these groups to construct a semantic reference corpus (“corpus”). Each sentence of the corpus is a pseudo-sample of counseling notes and represents a distinct topic (e.g., substance use, side effect, social support) from the keyword groups. We performed semantic search by computing the cosine similarity score between each of the notes and each of the sentences in the corpus. We then applied K-Means clustering to group cosine similarity scores into semantic clusters (“clusters”). We iteratively validated the latent topics and clusters with human-in-the-loop approach and used Cv (human interpretability score) to evaluate clustering results [35,36].

Longitudinal association analyses

Only notes with available adherence follow-up data were included in the longitudinal association analyses. We obtained the top five cosine similarity scores of each note and their cluster assignments, mapped to time-chunks so the model may capture temporal dependencies. Mixed-effects modeling of adherence included fixed effects for semantic similarity scores (top 5), time-chunk (categorical), and cluster membership (categorical), with random intercepts for each participant to account for individual heterogeneity in baseline adherence. Model performance was evaluated using five-fold cross-validation and was assessed using mean absolute error (MAE), root mean squared error (RMSE), and R2. Splits were performed at participant-level to prevent data leakage and ensure independence between datasets. The final model was fitted on the complete dataset to obtain stable coefficient estimates for interpretation.

Ethical considerations

The PRAXIS study, including data collection and all subsequent analyses, was approved by the Columbia University Irving Medical Center institutional review board (IRB-AAAQ5753) and University of KwaZulu-Natal Biomedical Research Ethics Committees (BE242/16). Written informed consent was obtained from all participants. Throughout the study, ethical standards were maintained to ensure patient confidentiality, secure data management, and compliance with all applicable regulations governing clinical research.

Results

Data processing and exploratory analysis

A total of 327 notes (31,028 words) from 76 participants, averaging 4 MCI sessions per participant, collected between April 2017 to September 2020, were included in the present analysis (Table 1). At data processing, SBERT embedding resulted in 384 dimensions of numerical representations. After temporal alignment, the dataset for longitudinal association analyses consisted of 233 counseling notes (22,729 words) from 71 participants for BDQ adherence, and 248 counseling notes (24,122 words) from 73 participants for ART adherence.

Initial exploratory analysis on adherence by time-chunk with Kruskal-Wallis rank sum test and Dunn’s test found that Post-Session and Pre-Session have higher average adherence than Intermediate, for both BDQ and ART, and both were statistically significant (p < 0.01, p < 0.0001, respectively; Bonferroni-adjusted).

Topic modeling, semantic search and clustering

BERTopic identified twenty latent keyword groups across the notes, with the top six groups demonstrating the most clarity and representativeness (S1 Table). We used the keyword groups to generate a twenty-sentence semantic reference corpus (“corpus”) (S1 Notes) for performing semantic search, in which we calculated the cosine similarity score between each note and each of the sentences in the corpus. We applied k-means clustering to the cosine similarity scores and examined solutions for k = 2–15. While statistical metrics favored lower k (k = 2–3), we selected k = 6, in consultation with content-domain experts (M.O., J.Z.), to prioritize clinical interpretability (k = 6; Cv = 0.689; Silhouette = 0.120) (Fig 2; S1A,B Fig). As an exploratory analysis, six clusters allowed sufficient granularity to extract clinically interpretable insights with modest semantic coherence.

thumbnail
Fig 2. t-SNE plot of semantic clusters derived from K-means clustering (k = 6).

K-means clustering of cosine similarity score of each note to each sentence in semantic reference corpus, which was generated from BERTopic-extracted latent topics.

https://doi.org/10.1371/journal.pone.0355696.g002

For each cluster, clinical and social science experts (M.O. and J.Z.) reviewed the cluster center and the top three most frequently matched sentence from the corpus (S2 Table), and summarized semantic themes of each cluster for interpretability (Table 2). Notably, three corpus statements that frequently matched these clusters relate to dimensions of support from our motivational interviewing approach [31], informed by the sIMB model [32]: (1) “Patient received positive reinforcement for improved adherence this month.”, reflecting motivation through positive reinforcement; (2) “Counselor emphasized setting reminders and establishing a routine for medication.”, representing adherence strategies and skill building; and (3) “The session ended with affirming patient’s efforts and planning next steps.”, illustrating adherence planning and summarizing. These statements exemplify how key elements of the intervention aligned with our theoretical framework and were reflected in participant-counselor interactions.

thumbnail
Table 2. Cluster semantic themes from k-means clustering of semantic similarity scores, with human-in-the-loop validation.

https://doi.org/10.1371/journal.pone.0355696.t002

Longitudinal association analyses

Linear mixed-effects regression had the best performance across methods and was selected as our final modeling method (S3 Table). Using the top five cosine similarity scores, time-chunks, and cluster assignment as features, we fitted a linear mixed-effects regression model with participant random intercept to examine their longitudinal association with EDM-measured BDQ and ART adherence. Model performance across five-fold cross validation showed modest overall performance for both treatment types (S4 Table). For BDQ, the MAE was 0.158 (95% CI=[0.113, 0.204]), representing an average absolute error of 15.8 percentage points. For ART, the MAE was 0.180 (95% CI=[0.170, 0.191]), representing an average absolute error of 18.0 percentage points. The corresponding RMSEs were 0.208 (95% CI=[0.133, 0.283]) for BDQ and 0.224 (95% CI=[0.202,0.246]) for ART. These results suggest that the model partially tracked individual adherence patterns for both BDQ and ART, with slightly higher variability in residual variability in ART estimates compared to BDQ.

Cluster membership was not independently associated with adherence for either BDQ or ART. For BDQ, compared to cluster 1(substance use challenges), Clusters 2 (strategies to overcome logistical barriers), 5 (financial stability/adherence improvement), and 6 (financial insecurity/low social support) showed positive associations with adherence, while Clusters 3 (patient lives in rural areas/limited social support) and 4 (managing side effects) showed negative associations; however, none reached statistical significance (all p > 0.05), and the coefficient estimates are close to null. For ART, all clusters showed positive associations relative to Cluster 1 (substance use challenges) with larger coefficient estimates, though only Cluster 2 (strategies to overcome logistical barriers) achieved marginal statistical significance (p < 0.1).

Among the five semantic similarity scores, only the fourth similarity score was associated with ART adherence (β = 1.215, 95% CI=[0.318, 2.113], p = 0.008). However, this feature lacks direct clinical interpretability as it represents similarity to a composite theme rather than a specific counseling topic.

Time-chunk emerged to consistently associated with both medications. Relative to the immediate post-session period (first 7 days after counseling), adherence was significantly lower during the intermediate period for both BDQ (β = −0.048, 95% CI=[−0.075, −0.020], p = 0.001) and ART (β = −0.031, 95% CI=[−0.058, −0.005], p = 0.022). Additionally, ART adherence was significantly lower during the pre-session period (7 days before next counseling visit) compared to the post-session period (β = −0.032, 95% CI=[−0.059, −0.005], p = 0.020) (Fig 3; S5 Table).

thumbnail
Fig 3. Fixed effects from linear mixed-effects models estimating associations with adherence to (A) BDQ and (B) ART.

Bars represent coefficient estimates with 95% confidence intervals. Covariates include semantic similarity scores (Top 1-5 Similarity), k-means cluster assignment (Cluster 1-6; ref: Cluster 1), and time-relative periods within each MCI inter-visit interval (Post-Session, Intermediate, Pre-Session; ref: Post-Session). Color indicates statistical significance: red (p < 0.05), light coral (0.05 ≤ p < 0.10), gray (p ≥ 0.10). Models included participant-level random intercepts to account for individual heterogeneity (variance shown for each model). Positive coefficients indicate higher estimated adherence; negative coefficients indicate lower estimated adherence relative to the reference category.

https://doi.org/10.1371/journal.pone.0355696.g003

To examine temporal variation in cluster effects, we fitted a secondary model with cluster x time-chunk interaction term. The interaction term between cluster 2 (strategies to overcome logistical barriers) and Pre-Session was associated with lower adherence to BDQ (β = −0.107; 95% CI=[−0.198, −0.017]; p = 0.021) (S6 Table).

Discussion

Our analysis suggests that natural language processing of routine counseling notes, followed by longitudinal mixed-effects modeling, can identify adherence-related patterns in patients treated for MDR-TB and HIV. Although interpretable social and behavioral domains were derived in BERTopic and k-means clustering, cluster membership was not independently associated with EDM-measured longitudinal adherence. Instead, temporal proximity to counseling sessions emerged as robustly associated with adherence for BDQ and ART, with adherence declining during intermediate and pre-session intervals. These findings suggest that adherence patterns may not be driven by static thematic content of adherence counseling, but rather by time-dependent effects surrounding patient-counselor engagement. Collectively, our results suggest the utility of applying computational methods to routine clinical documentation and point to the importance of temporality as a target for hypothesis generation in future adherence research in high-burden treatment settings.

Our findings extend prior work applying NLP to medication adherence in chronic diseases, where structured and unstructured clinical documentation has been used to identify adherence risk and behavioral phenotypes [37,38], by demonstrating that similar methods can organize counseling documentation into descriptive, adherence-relevant themes. Prior NLP-based adherence studies have commonly relied on patient self-reporting, electronic health record metadata or claims data in high-resource settings [23,38,39]. In contrast, few NLP studies have used cellular-enabled EDM as an objective surrogate for adherence or examined unstructured counseling documentation, and none to our knowledge have done so in the context of MDR-TB/HIV co-treatment in high-burden settings. Adherence counseling interventions in MDR-TB and HIV fall under three main categories: educational, psychosocial, and motivational interviewing approaches [40]. These interventions have demonstrated variable impact with mixed evidence regarding which components of counseling are most effective [12,40,41]. Our results suggest, as a hypothesis for future investigation, that the timing of counseling interactions may be more consequential than specific thematic domains captured in session notes. This observation aligns with behavioral adherence models emphasizing reinforcement, accountability, direct support, and sustained engagement over discrete informational content [18].

Our study has several strengths. We combined NLP methods with longitudinal mixed-effects modeling to analyze routine counseling notes and examine their longitudinal associations with adherence to BDQ and ART among patients with MDR-TB and HIV. Prospective data collection within a randomized controlled trial reduced retrospective documentation bias and improved data quality compared to retrospective observational designs. The study was conducted within a public health infrastructure in a high-burden TB and HIV setting, enhancing the generalizability of findings to similar programmatic settings. Using cellular-EDM devices, we captured adherence behavior in real time and temporally aligned adherence with counseling encounters to examine longitudinal associations rather than cross-sectional relationships. We developed a structured analytic pipeline combining topic modeling, semantic similarity scoring, and clustering for thematic content extraction, followed by mixed-effects regression to assess longitudinal associations. Clinical expert review was incorporated throughout to ensure thematic coherence and clinical interpretability of derived clusters.

Our study has limitations. First, counseling sessions were conducted in isiZulu and documented in English, potentially introducing linguistic compression, interpretive bias, and documentation bias arising from counselor-level variation. The absence of counselor identifiers precluded assessment of counselor-level variation in documentation practices and its potential influence on thematic content, although semi-structured documentation format partially mitigated this concern. Second, our sample size, while substantial for an RCT in the study population, is modest compared to large-scale open-source corpora. This may limit statistical power, clustering performance, the stability of model estimates, and may suffer from overfitting. Third, the study context focused on TB/HIV care in South Africa and may reduce the generalizability of the findings to other populations or settings. External validation in an independent, ideally multi-site cohort therefore represents an important direction for future work. Fourth, the six-cluster solution was selected as an exploratory descriptive framework based on interpretability rather than cluster validity metrics alone. Clusters exhibited modest coherence based on silhouette scores, potentially reflecting limited sample size, intrinsic overlap in the underlying semantic structure, or both, and should not be interpreted as a strongly separated or uniquely data-driven latent structure. Instead, the clusters should be interpreted as thematic organization of collected counseling notes rather than robust latent phenotypes. Furthermore, silhouette scores may not accurately capture cluster coherence in NLP contexts, where semantic similarity and high-dimensional embeddings may compress inter-cluster distances, reducing the metric’s discriminative power. Fifth, since adherence measure is bounded between 0 and 1, model estimates may be subject to ceiling effects and regression toward the mean, particularly in cases of extreme adherence behavior. Lastly, our study represents an exploratory longitudinal association analysis rather than a clinically deployable prediction tool, and findings should be interpreted as preliminary evidence of feasibility and a basis for hypothesis generation rather than as grounds for practice change or intervention guidance.

Conclusion

Analyzing routine adherence counseling notes using NLP and longitudinal mixed-effects modeling provided insight into adherence dynamics among patients with MDR-TB and HIV. Although thematic content derived through exploratory clustering was not independently associated with adherence, temporal proximity to counseling sessions was consistently associated with adherence to BDQ and ART. These findings provide preliminary evidence of the feasibility of applying NLP methods to routine counseling documentation and generate hypotheses about the role of counseling session timing in adherence dynamics. Future studies should evaluate these methods in larger and more diverse populations and examine the mechanisms by which counseling session proximity influences adherence behavior, and evaluate generalizability across varied clinical settings.

Supporting information

S1 Notes. Semantic theme corpus generated from BERTopic results.

https://doi.org/10.1371/journal.pone.0355696.s001

(DOCX)

S1 Fig. Semantic clusters derived from k-means clustering (k = 6).

(A) K-optimization and (B) Silhouette plot of k-means clustering of cosine similarity score of each note to each sentence in semantic corpus, which was generated from BERTopic-extracted latent topics.

https://doi.org/10.1371/journal.pone.0355696.s002

(TIF)

S1 Table. Top 6 topics from BERTopic, with human-in-the-loop validation.

https://doi.org/10.1371/journal.pone.0355696.s003

(DOCX)

S2 Table. Cluster center and most frequently matched semantic themes from semantic similarity search.

https://doi.org/10.1371/journal.pone.0355696.s004

(DOCX)

S3 Table. Modeling method performance comparison.

https://doi.org/10.1371/journal.pone.0355696.s005

(DOCX)

S4 Table. Linear mixed-effects regression model cross-validation results.

https://doi.org/10.1371/journal.pone.0355696.s006

(DOCX)

S5 Table. Linear mixed-effects model coefficients.

https://doi.org/10.1371/journal.pone.0355696.s007

(DOCX)

S6 Table. Cluster and time-chunk interaction term coefficients in secondary model.

https://doi.org/10.1371/journal.pone.0355696.s008

(DOCX)

Acknowledgments

We thank the patient participants, site staff, and KwaZulu-Natal Department of Health for supporting this research; and staff at the Centre for the AIDS Programme of Research in South Africa and Columbia University Irving Medical Centre, NY, USA for assisting with research activities.

Artificial intelligence including natural language processing and cluster analysis were used in the analysis as described in the methods. In addition, the first author is not a native-English language speaker and used large language models to improve the grammar and readability of portions of the text.

References

  1. 1. WHO. Global tuberculosis report 2024. Geneva: WHO; 2024. Available from: https://www.who.int/teams/global-tuberculosis-programme/tb-reports/global-tuberculosis-report-2024
  2. 2. WHO. South Africa intensifying efforts to end TB: WHO Regional Office for Africa. 2024 [cited 2025 Mar]. Available from: https://www.afro.who.int/countries/south-africa/news/south-africa-intensifying-efforts-end-tb
  3. 3. Conradie F, Diacon AH, Ngubane N, Howell P, Everitt D, Crook AM, et al. Treatment of highly drug-resistant pulmonary tuberculosis. N Engl J Med. 2020;382(10):893–902. pmid:32130813
  4. 4. Burhan E, Soepandi PZ, Isbaniah F, Damayanti K, Edwar SQ, Maruli MF, et al. Determinants of treatment outcomes in patients with multidrug-resistant TB. Int J Tuberc Lung Dis. 2022;26(2):126–32. pmid:35086624
  5. 5. Zelnick JR, Daftary A, Hwang C, Labar AS, Boodhram R, Maharaj B, et al. Electronic dose monitoring identifies a high-risk subpopulation in the treatment of drug-resistant tuberculosis and human immunodeficiency virus. Clin Infect Dis. 2021;73(7):e1901–10. pmid:33053186
  6. 6. Adisa R, Ayandokun TT, Ige OM. Knowledge about tuberculosis, treatment adherence and outcome among ambulatory patients with drug-sensitive tuberculosis in two directly-observed treatment centres in Southwest Nigeria. BMC Public Health. 2021;21(1):677. pmid:33827506
  7. 7. Tusho AR, Mokoboto-Zwane ST. Treatment completion of drug-resistant tuberculosis in Ethiopia: A perspective from healthcare users. PLOS Glob Public Health. 2025;5(2):e0004110. pmid:39919126
  8. 8. Ting NCH, El-Turk N, Chou MSH, Dobler CC. Patient-perceived treatment burden of tuberculosis treatment. PLoS One. 2020;15(10):e0241124. pmid:33091084
  9. 9. Deshmukh RD, Dhande DJ, Sachdeva KS, Sreenivas A, Kumar AMV, Satyanarayana S, et al. Patient and provider reported reasons for lost to follow up in MDRTB treatment: A qualitative study from a drug resistant TB Centre in India. PLoS One. 2015;10(8):e0135802. pmid:26301748
  10. 10. Singh A, Prasad R, Balasubramanian V, Gupta N. Drug-resistant tuberculosis and HIV infection: current perspectives. HIV AIDS (Auckl). 2020;12:9–31. pmid:32021483
  11. 11. Vadakunnel MJ, Nehru VJ, Brammacharry U, Ramachandra V, Palavesam S, Muthukumar A, et al. Factors associated with unfavourable treatment outcomes among patients with multidrug-resistant tuberculosis receiving outpatients care. Sci Rep. 2025;15(1):28335. pmid:40760140
  12. 12. Costa-Cordella S, Rossi A, Grasso-Cladera A, Duarte J, Cortes CP. Characteristics of psychosocial interventions to improve ART adherence in people living with HIV: A systematic review. PLOS Glob Public Health. 2022;2(10):e0000956. pmid:36962602
  13. 13. Wagnew F, Gray D, Tsheten T, Kelly M, Clements ACA, Alene KA. Effectiveness of nutritional support to improve treatment adherence in patients with tuberculosis: a systematic review. Nutr Rev. 2024;82(9):1216–25. pmid:37759339
  14. 14. Louwagie G, Kanaan M, Morojele NK, Van Zyl A, Moriarty AS, Li J, et al. Effect of a brief motivational interview and text message intervention targeting tobacco smoking, alcohol use and medication adherence to improve tuberculosis treatment outcomes in adult patients with tuberculosis: a multicentre, randomised controlled trial of the ProLife programme in South Africa. BMJ Open. 2022;12(2):e056496. pmid:35165113
  15. 15. O’Donnell MR, Padayatchi N, Wolf A, Zelnick J, Daftary A, Orrell C, et al. Bedaquiline adherence measured by electronic dose monitoring predicts clinical outcomes in the treatment of patients with multidrug-resistant tuberculosis and HIV/AIDS. J Acquir Immune Defic Syndr. 2022;90(3):325–32. pmid:35195572
  16. 16. Manyazewal T, Woldeamanuel Y, Holland DP, Fekadu A, Marconi VC. Effectiveness of a digital medication event reminder and monitor device for patients with tuberculosis (SELFTB): a multicenter randomized controlled trial. BMC Med. 2022;20(1):310. pmid:36167528
  17. 17. Velen K, Nguyen T-A, Pham CD, Le HT, Nguyen HB, Dao BT, et al. The effect of medication event reminder monitoring on treatment adherence of TB patients. Int J Tuberc Lung Dis. 2023;27(4):322–8. pmid:37035979
  18. 18. Alipanah N, Jarlsberg L, Miller C, Linh NN, Falzon D, Jaramillo E, et al. Adherence interventions and outcomes of tuberculosis treatment: A systematic review and meta-analysis of trials and observational studies. PLoS Med. 2018;15(7):e1002595. pmid:29969463
  19. 19. Liu X, Lewis JJ, Zhang H, Lu W, Zhang S, Zheng G, et al. Effectiveness of electronic reminders to improve medication adherence in tuberculosis patients: a cluster-randomised trial. PLoS Med. 2015;12(9):e1001876. pmid:26372470
  20. 20. Liu X, Thompson J, Dong H, Sweeney S, Li X, Yuan Y, et al. Digital adherence technologies to improve tuberculosis treatment outcomes in China: a cluster-randomised superiority trial. Lancet Glob Health. 2023;11(5):e693–703. pmid:37061308
  21. 21. Assale M, Dui LG, Cina A, Seveso A, Cabitza F. The revival of the notes field: leveraging the unstructured content in electronic health records. Front Med (Lausanne). 2019;6:66. pmid:31058150
  22. 22. Franzen SRP, Chandler C, Lang T. Health research capacity development in low and middle income countries: reality or rhetoric? A systematic meta-narrative review of the qualitative literature. BMJ Open. 2017;7(1):e012332. pmid:28131997
  23. 23. Chen J, Liu L, Huang J, Jiang Y, Yin C, Zhang L, et al. LSTM-based prediction model for tuberculosis among HIV-infected patients using structured electronic medical records: A retrospective machine learning study. J Multidiscip Healthc. 2024;17:3557–73. pmid:39070689
  24. 24. Can D, Marin RA, Georgiou PG, Imel ZE, Atkins DC, Narayanan SS. It sounds like: A natural language processing approach to detecting counselor reflections in motivational interviewing. J Couns Psychol. 2016;63(3):343–50. pmid:26784286
  25. 25. Reading Turchioe M, Volodarskiy A, Pathak J, Wright DN, Tcheng JE, Slotwiner D. Systematic review of current natural language processing methods and applications in cardiology. Heart. 2022;108(12):909–16. pmid:34711662
  26. 26. Nerella S, Bandyopadhyay S, Zhang J, Contreras M, Siegel S, Bumin A, et al. Transformers and large language models in healthcare: A review. Artif Intell Med. 2024;154:102900. pmid:38878555
  27. 27. Zhang P, Kamel Boulos MN. Generative AI in medicine and healthcare: promises, opportunities and challenges. Fut Internet. 2023;15(9).
  28. 28. Owoyemi A, Owoyemi J, Osiyemi A, Boyd A. Artificial intelligence for healthcare in Africa. Front Digit Health. 2020;2:6. pmid:34713019
  29. 29. Ngiam KY, Khor IW. Big data and machine learning algorithms for health-care delivery. Lancet Oncol. 2019;20(5):e262–73. pmid:31044724
  30. 30. Roberts KH, Bernstam E, Blanco EA. A natural language processing tool for extracting medication adherence information from electronic health records. Patient-Centered Outcomes Research Institute (PCORI); 2024.
  31. 31. Papus M, Dima AL, Viprey M, Schott A-M, Schneider MP, Novais T. Motivational interviewing to support medication adherence in adults with chronic conditions: Systematic review of randomized controlled trials. Patient Educ Couns. 2022;105(11):3186–203. pmid:35779984
  32. 32. Rivet Amico K. A situated-Information Motivation Behavioral Skills Model of Care Initiation and Maintenance (sIMB-CIM): An IMB model based approach to understanding and intervening in engagement in care for chronic medical conditions. J Health Psychol. 2011;16(7):1071–81. pmid:21459919
  33. 33. Reimers NG, Iryna. Sentence-BERT: Sentence embeddings using Siamese BERT-networks. 2019 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics; 2019.
  34. 34. Grootendorst M. BERTopic: Neural topic modeling with a class-based TF-IDF procedure. arXiv preprint arXiv:220305794. 2022.
  35. 35. Mosqueira-Rey E, Hernández-Pereira E, Alonso-Ríos D, Bobes-Bascarán J, Fernández-Leal Á. Human-in-the-loop machine learning: a state of the art. Artif Intell Rev. 2022;56(4):3005–54.
  36. 36. Röder MB, Hinneburg A. Exploring the space of topic coherence measures. In: WSDM 2015: Eighth ACM International Conference on Web Search and Data Mining. Association for Computing Machinery; 2015.
  37. 37. Oliwa T, Furner B, Schmitt J, Schneider J, Ridgway JP. Development of a predictive model for retention in HIV care using natural language processing of clinical notes. J Am Med Inform Assoc. 2021;28(1):104–12. pmid:33150369
  38. 38. Chan JC, Mbanya JC, Chantelot J-M, Shestakova M, Ramachandran A, Ilkova H, et al. Patient-reported outcomes and treatment adherence in type 2 diabetes using natural language processing: Wave 8 of the Observational International Diabetes Management Practices Study. J Diabetes Investig. 2024;15(9):1306–16. pmid:38840439
  39. 39. Yang C-T, Ngan K, Kim DH, Yang J, Liu J, Lin KJ. Establishing a validation framework of treatment discontinuation in claims data using natural language processing and electronic health records. Clin Pharmacol Ther. 2025;118(1):138–45. pmid:40197528
  40. 40. Martono M, Akhyar M, Pamungkasari EP, Lestari A. Results of professional interventions to improve medication adherence based on health beliefs and important determinants of tuberculosis medication: a systematic review. Eur Rev Med Pharmacol Sci. 2023;27(24):11794–805. pmid:38164843
  41. 41. Müller AM, Osório CS, Silva DR, Sbruzzi G, de Tarso P, Dalcin R. Interventions to improve adherence to tuberculosis treatment: systematic review and meta-analysis. Int J Tuberc Lung Dis. 2018;22(7):731–40. pmid:29914598