Emotion Detection in Text-Based Communication Using Fine-Tuned BERT Model
Urva Dave, Om Desai, Nisarg Chaudhari, Dweepna Garg, Kashyap Patel, Parth Goel · 2024
To detect emotions in text-based communication, the study investigates the use of BERT (Bidirectional Encoder Representations from Transformers). In digital contexts like social media or messaging platforms, where non-verbal cues are lacking, accurately identifying emotions is a challenge that requires careful attention. This study used an uncased BERT model that was pretrained on large corpora such as the English Wikipedia. It was then refined on a dataset of more than 10,000 entries that were categorized into 13 different emotions, such as surprise, happiness, and sadness. Training and validation accuracy of the model improved steadily over the course of eight epochs, stabilizing at 99.4% by the end of the process. The model performed well in forecasting emotions like love and happiness, but it had trouble with more nuanced feelings like surprise and worry, according to a confusion matrix that was created. This study highlights how BERT can be used to improve emotion detection, particularly in chat platforms and other applications where real-time emotion recognition could enhance the emotional accuracy and clarity of digital conversations.