This project applies natural language processing (NLP) and topic modeling to electronic health record (EHR) clinical notes to uncover how HIV stigma and related social and behavioral circumstances are expressed among people living with HIV (PLWHs). Using Latent Dirichlet Allocation (LDA), expert-curated keyword lists, and demographic subgroup analysis, the study characterizes the topics of stigma, offering new insights into the patterns within clinical documentation.
- Load Data:
code/datasample.csvprovided - Text Preprocessing: Stopword removal, punctuation filtering, and lemmatization
- Topic Modeling:
Latent Dirichlet Allocation (LDA)from Gensim - Evaluation Metrics:
Coherence Score,Average Jaccard Similarity,Topic Diversity - Automated Analysis: Iterate over multiple
numbers of topicsanditerationsto identify optimal model parameters - Result Export: Outputs metrics for all experiments into a CSV file for downstream analysis
- Clone the repository:
git clone https://github.com/uf-hobi-informatics-lab/HIV-Stigma-Topic-Modeling.git
cd HIV-Stigma-Topic-Modeling- Prepare your dataset as a CSV file with a column note_text from clinical notes.
- Run the LDA pipeline:
python code/lda_hiv_stigma.py- The script will output: output.csv containing iteration, number of topics, coherence score, Jaccard similarity, and topic diversity
- Printed topics for each iteration and topic number
Please cite our paper: https://arxiv.org/abs/2506.09279
@article{chen2025topic,
title={A Topic Modeling Analysis of Stigma Dimensions, Social, and Related Behavioral Circumstances in Clinical Notes Among Patients with HIV},
author={Chen, Ziyi and Liu, Yiyang and Prosperi, Mattia and Vaddiparti, Krishna and Cook, Robert L and Bian, Jiang and Guo, Yi and Wu, Yonghui},
journal={arXiv preprint arXiv:2506.09279},
year={2025}
}
Please contact us or post an issue if you have any questions.
- Ziyi Chen (chenziyi@ufl.edu)
- Yonghui Wu (yonghui.wu@ufl.edu)
