Exploring the Societal Attitudes: A Sentiment Analysis of the Public Views on the LGBT Community Using Natural Language Processing
Main Article Content
Abstract
This study investigates global attitudes toward the LGBTQ community through sentiment and thematic analysis of Twitter data. Utilizing the OSEMN framework, the research analyzes a dataset of 29,890 tweets collected over a six-day period. After data preprocessing using natural language processing techniques, exploratory analysis revealed key linguistic patterns and commonly discussed topics. Latent Dirichlet Allocation (LDA) topic modeling uncovered four dominant themes within the discourse: (1) promoting sexual health through political engagement, (2) balancing freedom of expression and inclusivity in digital spaces, (3) empowerment and transformation through representation, and (4) addressing prejudice and discrimination in political leadership. Sentiment analysis results show that 47.73% of the tweets expressed positive sentiment, often reflecting support, celebration, and advocacy for LGBTQ rights and identity. In contrast, 26.25% were negative, with many tweets containing hate speech, misinformation, or stigmatizing language tied to religious or political ideologies. The remaining 26.02% were classified as neutral, reflecting a mix of informational or non-committal content. Visualizations such as word clouds, bi-grams, tri-grams, and a network graph, supported the interpretation of topic clusters and revealed the nuanced dynamics of online LGBTQ discourse. The findings suggest that Twitter functions both as a platform for visibility and affirmation, and as a space where prejudice persists. This disparity emphasizes the ongoing need of awareness and advocacy in online spaces and the intricacy of digital environments in influencing public perceptions of marginalized groups.
Downloads
Article Details
References
[1] Y. Cheng, X. Zhou, and K. Yao, “LGBT-Inclusive Representation in Entertainment Products and Its Market Response: Evidence from Field and Lab,” J. Bus. Ethics, vol. 183, no. 4, pp. 1189–1209, Apr. 2023, doi: 10.1007/s10551-022-05075-4. DOI: https://doi.org/10.1007/s10551-022-05075-4
[2] Aldinata, A. M. Soesanto, V. C. Chandra, and D. Suhartono, “Sentiments comparison on Twitter about LGBT,” Procedia Comput. Sci., vol. 216, pp. 765–773, Jan. 2023, doi: 10.1016/j.procs.2022.12.194. DOI: https://doi.org/10.1016/j.procs.2022.12.194
[3] M. B. Doğan, Oban ,Volkan, and G. and Dikeç, “Qualitative and Artificial Intelligence-based Sentiment Analyses of Anti-LGBTI+ Hate Speech on Twitter in Turkey,” Issues Ment. Health Nurs., vol. 44, no. 2, pp. 112–120, Feb. 2023, doi: 10.1080/01612840.2022.2158407. DOI: https://doi.org/10.1080/01612840.2022.2158407
[4] J. Kusuma, H. Hartono, and B. Hayadi, “Sentiment Analysis of IDAHOBIT Celebrations using Naïve Bayes and Decision Tree Algorithms,” Int. Conf. Inf. Sci. Technol. Innov. ICoSTEC, vol. 2, pp. 52–58, Mar. 2023, doi: 10.35842/icostec.v2i1.37. DOI: https://doi.org/10.35842/icostec.v2i1.37
[5] I.-S. Jeon, K. Shin-Yu, and K. Seong-Joo, “Developing Standards for Educational Datasets by School Level: A Framework for Sustainable K-12 Education,” Sustainability, vol. 16, no. 12, pp. 4954–4954, 2024, doi: 10.3390/su16124954. DOI: https://doi.org/10.3390/su16124954
[6] P. Fan et al., “Unlocking the Potential of Competition-Based Learning: A Case Study of Kaggle in Big Data Analytics Education,” presented at the 2024 10th International Conference on Smart Computing and Communication, ICSCC 2024, 2024, pp. 589–595. doi: 10.1109/ICSCC62041.2024.10690416. DOI: https://doi.org/10.1109/ICSCC62041.2024.10690416
[7] A. I. Kabir, K. Ahmed, and R. Karim, “Word Cloud and Sentiment Analysis of Amazon Earphones Reviews with R Programming Language,” Inform. Econ., vol. 24, pp. 55–71, Dec. 2020, doi: 10.24818/issn14531305/24.4.2020.05. DOI: https://doi.org/10.24818/issn14531305/24.4.2020.05
[8] C. P. Chai, “Comparison of text preprocessing methods,” Nat. Lang. Eng., vol. 29, no. 3, pp. 509–553, 2023, doi: 10.1017/S1351324922000213. DOI: https://doi.org/10.1017/S1351324922000213
[9] M. Kunilovskaya and A. Plum, “Text Preprocessing and its Implications in a Digital Humanities Project,” presented at the International Conference Recent Advances in Natural Language Processing, RANLP, 2021, pp. 85–93. doi: 10.26615/issn.2603-2821.2021_013. DOI: https://doi.org/10.26615/issn.2603-2821.2021_013
[10] T. B. D. Lima et al., “Sequence Labeling Algorithms for Punctuation Restoration in Brazilian Portuguese Texts,” Lect. Notes Comput. Sci. Subser. Lect. Notes Artif. Intell. Lect. Notes Bioinforma., vol. 13654 LNAI, pp. 616–630, 2022, doi: 10.1007/978-3-031-21689-3_43. DOI: https://doi.org/10.1007/978-3-031-21689-3_43
[11] R. J. Rupa, J. F. Sohana, and M. Rahman, “Comparative analysis of bengali stop word detection using different approaches,” presented at the 2021 International Conference on Automation, Control and Mechatronics for Industry 4.0, ACMI 2021, 2021. doi: 10.1109/ACMI53878.2021.9528279. DOI: https://doi.org/10.1109/ACMI53878.2021.9528279
[12] A. A. Bichi, R. Samsudin, and R. Hassan, “Automatic construction of generic stop words list for hausa text,” Indones. J. Electr. Eng. Comput. Sci., vol. 25, no. 3, pp. 1501–1507, 2022, doi: 10.11591/ijeecs.v25.i3.pp1501-1507. DOI: https://doi.org/10.11591/ijeecs.v25.i3.pp1501-1507
[13] R. Hafeez et al., “Contextual Urdu Lemmatization Using Recurrent Neural Network Models,” Mathematics, vol. 11, no. 2, 2023, doi: 10.3390/math11020435. DOI: https://doi.org/10.3390/math11020435
[14] C. Sharma, S. Sharma, and Sakshi, “Latent DIRICHLET allocation (LDA) based information modelling on BLOCKCHAIN technology: a review of trends and research patterns used in integration,” Multimed. Tools Appl., vol. 81, no. 25, pp. 36805–36831, Oct. 2022, doi: 10.1007/s11042-022-13500-z. DOI: https://doi.org/10.1007/s11042-022-13500-z
[15] S. Nazeer, P. Yayavaram, and L. J. Anbarasi, “Advanced Algorithmic Techniques for Topic Prediction and Recommendation—An Analysis,” Lect. Notes Electr. Eng., vol. 967, pp. 125–132, 2023, doi: 10.1007/978-981-19-7169-3_12. DOI: https://doi.org/10.1007/978-981-19-7169-3_12
[16] T. Y. Koonce et al., “Using a Natural Language Processing Approach to Support Rapid Knowledge Acquisition,” JMIR Med. Inform., vol. 12, no. 1, p. e53516, Jan. 2024, doi: 10.2196/53516. DOI: https://doi.org/10.2196/53516
[17] E.-B. Braune et al., “Identification of a Notch transcriptomic signature for breast cancer,” Breast Cancer Res., vol. 26, no. 1, p. 4, Jan. 2024, doi: 10.1186/s13058-023-01757-7. DOI: https://doi.org/10.1186/s13058-023-01757-7
[18] S. Kadariya et al., “Community Organising Frameworks, Models, and Processes to Improve Health: A Systematic Scoping Review,” Int. J. Environ. Res. Public. Health, vol. 20, no. 7, Art. no. 7, Jan. 2023, doi: 10.3390/ijerph20075341. DOI: https://doi.org/10.3390/ijerph20075341
[19] W. Ekezie et al., “Health and social care experience and research perception of different ethnic minority populations in the East Midlands, United Kingdom (REPRESENT study),” Health Expect., vol. 27, no. 1, p. e13944, 2024, doi: 10.1111/hex.13944. DOI: https://doi.org/10.1111/hex.13944
[20] Á. Díaz, “Online Racialization and the Myth of Colorblind Content Policy,” Boston Univ. Law Rev., vol. 103, no. 7, pp. 1929–1983, Dec. 2023, Accessed: Mar. 27, 2025. [Online]. Available: https://www.proquest.com/docview/2916711995/abstract/5D24FEE5FCD649C7PQ/1
[21] M. Kossowska et al., “Internet-based micro-identities as a driver of societal disintegration,” Humanit. Soc. Sci. Commun., vol. 10, no. 1, pp. 1–10, Dec. 2023, doi: 10.1057/s41599-023-02441-z. DOI: https://doi.org/10.1057/s41599-023-02441-z
[22] D. A. Francis, “Queer and trans activism in South African schools: Non-Governmental Organisations (NGOs) disrupting LGBT+ inequalities,” Teach. Teach. Educ., vol. 148, p. 104705, Oct. 2024, doi: 10.1016/j.tate.2024.104705. DOI: https://doi.org/10.1016/j.tate.2024.104705
[23] M. Agopiantz et al., “Assisted reproductive technology in France: The reproductive rights of LGBT people,” J. Gynecol. Obstet. Hum. Reprod., vol. 52, no. 10, p. 102690, Dec. 2023, doi: 10.1016/j.jogoh.2023.102690. DOI: https://doi.org/10.1016/j.jogoh.2023.102690
[24] M. Nedeljko and B. M. Kaučič, “Creating a safe and inclusive living environment for LGBTQ+ older adults: A review of research, policy and literature,” IFAC-Pap., vol. 56, no. 2, pp. 9966–9971, Jan. 2023, doi: 10.1016/j.ifacol.2023.10.698. DOI: https://doi.org/10.1016/j.ifacol.2023.10.698
[25] J. Everitt and M. Tremblay, “Are Openly LGBTQ2+ the New Sacrificial Lambs? Campaign Contexts and the Gendered Implications for LGBTQ2+ Candidates,” Can. J. Polit. Sci. Can. Sci. Polit., vol. 56, no. 2, pp. 300–324, Jun. 2023, doi: 10.1017/S0008423923000161. DOI: https://doi.org/10.1017/S0008423923000161
[26] G. Magni and A. Reynolds, “Voter Preferences and the Political Underrepresentation of Minority Groups: Lesbian, Gay, and Transgender Candidates in Advanced Democracies,” J. Polit., vol. 83, Oct. 2020, doi: 10.1086/712142. DOI: https://doi.org/10.1086/712142
[27] C. A. Blackington, “Polarizing Protests: Democratic Backsliding and Mobilization,” Ph.D., The University of North Carolina at Chapel Hill, United States -- North Carolina, 2024. Accessed: Mar. 27, 2025. [Online]. Available: https://www.proquest.com/docview/3056960856/abstract/2B829C8413F44D76PQ/1
[28] S. Pandya and P. Mehta, A Review On Sentiment Analysis Methodologies, Practices And Applications. 2020.
[29] R. C. H. Chan, “Benefits and risks of LGBT social media use for sexual and gender minority individuals: An investigation of psychosocial mechanisms of LGBT social media use and well-being,” Comput. Hum. Behav., vol. 139, p. 107531, Feb. 2023, doi: 10.1016/j.chb.2022.107531. DOI: https://doi.org/10.1016/j.chb.2022.107531
[30] S. A. Brandt and C. L. Carmichael, “Does online support matter? The relationship between online identity-related support, mattering, and well-being in sexual minority men,” Comput. Hum. Behav., vol. 111, p. 106429, Oct. 2020, doi: 10.1016/j.chb.2020.106429. DOI: https://doi.org/10.1016/j.chb.2020.106429
[31] B. R. Chakravarthi, “Detection of homophobia and transphobia in YouTube comments,” Int. J. Data Sci. Anal., vol. 18, no. 1, pp. 49–68, Jun. 2024, doi: 10.1007/s41060-023-00400-0. DOI: https://doi.org/10.1007/s41060-023-00400-0
[32] A. Nematy, S. Flynn, and S. McCarthy-Jones, “YouTube Commenters’ Discourse of Paedophilia: A Qualitative Social Media Analysis,” Sex. Cult., vol. 28, no. 1, pp. 71–95, Feb. 2024, doi: 10.1007/s12119-023-10117-8. DOI: https://doi.org/10.1007/s12119-023-10117-8
[33] C. Macias, M. Soto, T. Alcántara, and H. Calvo, “Impact of Text Preprocessing and Feature Selection on Hate Speech Detection in Online Messages Towards the LGBTQ+ Community in Mexico,” presented at the IberLEF@SEPLN, 2023. Accessed: Mar. 27, 2025. [Online]. Available: https://www.semanticscholar.org/paper/Impact-of-Text-Preprocessing-and-Feature-Selection-Macias-Soto/964d9b807bff6f7ed4d0c4f8f2ced8f18862a95a
[34] P. Byron, K. Albury, and T. Pym, “Hooking up with friends: LGBTQ+ young people, dating apps, friendship and safety,” Media Cult. Soc., vol. 43, no. 3, pp. 497–514, Apr. 2021, doi: 10.1177/0163443720972312. DOI: https://doi.org/10.1177/0163443720972312
[35] J. Everitt and L. Horvath, “Public Attitudes and Private Prejudices: Assessing Voters’ Willingness to Vote for Out Lesbian and Gay Candidates,” Front. Polit. Sci., vol. 3, Jun. 2021, doi: 10.3389/fpos.2021.662095. DOI: https://doi.org/10.3389/fpos.2021.662095
[36] K. Thomson, “An Analysis of LGBTQ Representation in Television and Film,” Bridg. Undergrad. J. Contemp. Connect., vol. 5, no. 1, Jul. 2021, [Online]. Available: https://scholars.wlu.ca/bridges_contemporary_connections/vol5/iss1/7