Emotion Recognition On Chatbot Using Natural Language Processing

Authors

  • Henry Sumarwan
  • Ade Romadhony

Abstract

 Emotion-aware dialogue agents require both reliable emotion detection and a generation model capable of adapting tone appropriately. This paper presents an emotion-aware chatbot framework that combines a classical Emotion Recognition System (ERS) with instruction-tuned Large Language Models (LLMs) through lightweight emotion-conditioned prompting. The ERS employs TF–IDF vectorization and multiclass Logistic Regression to classify six emotion categories. Two ERS iterations are evaluated; the improved ERS-V2 achieves stable performance and supplies an interpretable emotion signal for conditioning. The predicted emotion is injected into a structured prompt that guides response style without changing model weights. We compare a baseline text-to-text model (Flan-T5) and an instruction-tuned chat model (Qwen-Instruct) under identical conditioning. Results show that the instruction-tuned LLM produces more emotionally aligned and helpful responses, supporting emotion-conditioned prompting as an effective and low-cost strategy for emotion-aware chatbots.

Keywords: emotion recognition, TF–IDF, logistic regression, emotion-conditioned prompting, instruction-tuned LLM, emotion-aware chatbot

References

G. Hiremath, A. Hajare, P. Bhosale, R. Nanaware, and K. S. Wagh. Chatbot for education system. International Journal of Advanced Research, Ideas and Innovations in Technology, 4(3):37–43, 2018.

M. Ansari, S. Shaikh, M. S. Parbulkar, T. Khan, and A. Singh. Intelligent chatbot. International Journal of Engineering Research & Technology (IJERT), 9(4), 2021.

Asbjørn Følstad, Theo Araujo, Symeon Papadopoulos, Edith L. C. Law, Ole-Christoffer Granmo, Ewa Luger, and Petter B. Brandtzaeg. Chatbot Research and Design. Springer International Publishing, 2020.

Roddy Cowie, Ellen Douglas-Cowie, Nicolas Tsapat soulis, George Votsis, Stefanos Kollias, Wolfram Fel lenz, and John G. Taylor. Emotion recognition in human computer interaction. IEEE Signal Processing Magazine, 18(1):32–80, 2001.

Daniel Jurafsky and James H. Martin. Speech and Lan guage Processing: An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition. Stanford University, 2023. Draft/online edition.

Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, volume 30, pages 5998–6008, 2017.

Gerard Salton and Christopher Buckley. Term-weighting approaches in automatic text retrieval. Information Pro cessing & Management, 24(5):513–523, 1988.

Trevor Hastie, Robert Tibshirani, and Jerome Friedman. The Elements of Statistical Learning: Data Mining, In ference, and Prediction. Springer, New York, NY, USA, 2 edition, 2009.

G. A. Santos, G. G. De Andrade, G. R. S. Silva, F. C. M. Duarte, J. P. J. Da Costa, and R. T. de Sousa. A conversation-driven approach for chatbot management. IEEE Access, 10:8474–8486, 2022.

S. Joshi, S. Shinde, P. Shinde, N. Sagar, and S. Rathod. Chatbot using deep learning. International Journal of Scientific Research in Computer Science, Engineering and Information Technology, 3307:228–232, 2023.

P. Naveen, S. C. Haw, D. Nadthan, and S. K. Ramamoor thy. Improving chatbot performance using hybrid deep learning approach. Journal of System and Management Sciences, 13(3):505–516, 2023.

J. S. Thomas andS.Thomas. Chatbot using gated end-to-end memory networks. International Research Journal of Engineering and Technology (IRJET), 3, 2018.

K. B. Prakash, Y. V. R. Nagapawan, N. L. Kalyani, and V. P. Kumar. Chatterbot implementation using transfer learning and lstm encoder-decoder architecture. Interna tional Journal of Computer Science and Engineering, 8, 2020.

J.-J. Park. A development of chatbot for emotional stress recognition and management using nlp. Transactions of the Korean Institute of Electrical Engineers, 67(1): 954–961, 2018.

S. Assayed, K. Shaalan, S. Al-Sayed, and M. Alkhatib. Psychological emotion recognition of students using ma chine learning-based chatbot. International Journal of Artificial Intelligence Applications (IJAIA), 14(2), 2023.

T. Naous, C. Hokayem, and H. Hajj. Empathy-driven arabic conversational chatbot. In Proceedings of the 5th Arabic Natural Language Processing Workshop, pages 58–68, 2020.

K. Daiser, J. Bardelli, J. Casas, E. Magluili, O. A. Khaled, and D. Lalanne. Embodied conversational agent for emotion recognition training. In ACHI 2020: The 13th International Conference on Advances in Computer Human Interactions, pages 384–393, 2020.

Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21:1–67, 2020.

Jinze Bai et al. Qwen technical report. arXiv preprint arXiv:2309.16609, 2023.

Published

2026-07-01

Issue

Section

Prodi S1 Informatika