Applying Artificial Intelligence to Analyze Emotions in Social Media Comments using Large Language Models

Sarah Astiti, Iswandi Iswandi, Tomy Nanda Putra, Darmansah Darmansah

Abstract


Advancements in Large Language Models (LLMs) have opened new opportunities for emotion analysis in social media comments. This study aims to explore the application of LLMs in classifying users' emotions based on their comment texts across various social media platforms. The methodology involves collecting comment data from Twitter, Facebook, and YouTube, followed by text preprocessing using Natural Language Processing (NLP) techniques. LLMs such as GPT and BERT are evaluated for their ability to detect primary emotions including happiness, sadness, anger, and fear. The results show a precision of 0.89 (89%), recall of 0.80 (80%), and an F1-score of 0.84 (84%). These findings indicate that LLMs offer higher accuracy compared to conventional sentiment analysis methods, particularly in their ability to understand linguistic context and nuances.

Keywords


Large Language Model, analisis emosi, media sosial, NLP.

Full Text:

PDF

References


Y. Sari and D. H. Prasetya, “Literasi Media Digital pada Remaja, ditengah Pesatnya Perkembangan Media Sosial,” J. Din. Ilmu Komun., vol. 8, no. 1, pp. 12–25, 2022.

P. Widiyantoro and Y. D. Prasetyo, “Deteksi Cyberbullying pada Pemain Sepak Bola di Platform Media Sosial ‘ X ’ menggunakan Metode Long Short-Term Memory ( LSTM ),” 2025.

G. Kusuma, A. Venie, and S. Alwan, “Dinamika Sentimen Publik dalam Suksesi Pemerintahan Indonesia berdasarkan Analisis Data Media Sosial,” vol. 8, pp. 407–413, 2025.

A. Susilo, V. Christanti, and M. D. Lauro, “Penerjemah Bahasa Gaul menggunakan LoRA dan QLoRA Fine-Tuning LLaMA-2-Chat untuk ChatBot,” vol. 9, no. 2, pp. 248–260, 2024, doi: https://doi.org/10.26760/mindjournal.

M. T. Prompting, “Pemetaan Tren Machine Learning dalam Penelitian Ilmu Kimia menggunakan LLM dengan Multi - Turn Prompting Mapping Machine Learning Trends in Chemistry Research using LLM with,” vol. 14, no. Llm, pp. 587–596, 2025.

M. T. Manurung, I. G. Ngurah, L. Wijayakusuma, and I. P. W. Gautama, “Named Entity Recognition for Medical Records of Heart Failure using a Pre-trained BERT Model,” vol. 9, no. 2, pp. 341–348, 2025.

N. Rachmat and D. P. Kesuma, “Implementasi Large Language Models Gemini pada Pengembangan Aplikasi Chatbot berbasis Android,” J. Ilmu Komput., vol. 4, no. 1, p. 2024, 2024, doi: 10.31314/juik.v4i1.2831.

B. Darmajaya, “Penerapan Teknologi Langchain dan LLM pada Sistem Question Answering berbasis Chatbot Telegram : Literature Review,” pp. 95–104, 2025.

D. Pengembangan, C. Di, and B. Pertanian, “2) 1,2,” vol. 10, no. 1, pp. 25–32, 2024.

D. H. Fadillah, M. R. Octavian, A. Marwadin, and M. Rahmat, “Implementasi Lightgbm dan Llm Gemini pada Website,” vol. 06, no. 01, pp. 224–233, 2025.

O. Solihin, D. Firmansyah, A. Z. Abdullah, and A. P. Dhahiyat, “Pemanfaatan AI dalam Analisis Isi Digital : Studi Kasus Komentar Media Sosial,” vol. 3, no. April, 2025.

A. N. Rohman, E. Utami, and S. Raharjo, “Deteksi Kondisi Emosi pada Media Sosial menggunakan Pendekatan Leksikon dan Natural Language Processing,” Eksplora Inform., vol. 9, no. 1, pp. 70–76, 2019, doi: 10.30864/eksplora.v9i1.277.




DOI: https://doi.org/10.32520/stmsi.v14i3.5187

Article Metrics

Abstract view : 150 times
PDF - 36 times

Refbacks

  • There are currently no refbacks.


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.