MSc Dissertation

Emotion Detection From Text Data Using Hybrid Model

2023/2024 University of Leeds NLP • Deep Learning • Transformers

This dissertation explores fine-grained emotion detection from text by building a hybrid deep learning architecture that combines contextual embeddings with sequential and local feature learning. The work follows a structured data-mining approach and evaluates performance through multiple experiments and tuning.

Dissertation cover / project visual

Project Aim

Develop a robust classifier capable of detecting and classifying emotions expressed in text by leveraging a hybrid model: RoBERTa + RNN (LSTM) + CNN + Transformer + FNN.

Key Features

  • Contextual embeddings using RoBERTa for nuanced language understanding.
  • RNN (LSTM) to capture sequential dependencies in text.
  • CNN to learn local patterns/phrases that signal emotions.
  • Transformer layers to refine global dependencies via self-attention.
  • FNN classifier for final emotion prediction.

Dataset

The project uses the GoEmotions dataset (Reddit comments) with 27 emotion categories + neutral, designed for fine-grained emotion recognition and multi-label annotation.

Methodology & Workflow

The pipeline includes: data acquisition → preprocessing (tokenization, cleaning, normalization) → encoding with RoBERTa tokenizer → model training/evaluation → deployment integration.

Tech Stack

  • Python 3.7 for implementation
  • PyTorch for deep learning
  • Flask for serving prediction endpoints
  • PHP (Chatbot UI) + AJAX requests to Flask for real-time inference

Results Snapshot

Experiments explored hyperparameter tuning (epochs, batch size) and transfer learning. The tuned hybrid model achieved improved accuracy compared to the initial setup, and transfer learning further boosted performance.

Hybrid Model (Tuned)

Accuracy: ~58.71%

After tuning epochs/batch size and evaluation setup.

Transfer Learning

Accuracy: ~62.37% / 65.22%

Shows potential gains with pretrained transfer.

What I Built

  • End-to-end training pipeline for hybrid emotion classifier.
  • Experiment framework with tuning and evaluation.
  • Deployment setup: Flask inference API + PHP chatbot GUI for real-time predictions.

Links

GitHub Repository: github.com/sc23mm/MSc-Project

Report PDF: View Dissertation Report (Place your PDF in the correct path or update this link.)

Author

Mukundhan Mohan

MSc Advanced Computer Science (University of Leeds). Focused on NLP, deep learning, and deploying ML systems into usable applications.