Skip to content

Emotion Detection App

Welcome to my latest project where I delve into the realm of emotion detection using AI/ML.

This project aims to develop an application that detects and classifies emotions in text inputs with the help of advanced Natural Language Processing (NLP) models (1) .

This project showcases the power of Hugging Face Transformers (2) and Gradio interfaces (3) in creating an application that can classify emotions in text inputs.

  1. NLP models are mathematical algorithms designed to understand, interpret, and generate human language. They power applications like chatbots, language translation, and sentiment analysis.
  2. Hugging Face Transformers are advanced NLP models that enable computers to perform tasks like text generation, translation, and question answering. They provide a flexible, open-source library for implementing and fine-tuning these models.
  3. Gradio interfaces are user-friendly tools for creating interactive demos of machine learning models. They allow developers to build and share web-based interfaces that let users input data and see model predictions in real-time.

You can interact with the app at the end of this page!

Motivation

As someone who enjoys exploring and evaluating different AI/ML models, I found the Emotion dataset on Hugging Face particularly intriguing. This dataset includes English Twitter messages labeled with six basic emotions: anger, fear, joy, love, sadness, and surprise.

I decided to fine-tune a pre-trained DistilBERT model on this dataset and develop a user-friendly interface using Gradio and deployed it on Hugging Face.

You can improve the prediction quality of the base model by fine-tuning it with better resources (I had access to only Google Colab).

My goal was to create a modular and adaptable project that can be easily modified to explore other models and fine-tuning techniques.

This project reflects my journey and learning in the AI/ML domain, demonstrating my ability to apply these technologies to real-world scenarios.

Project Overview

  • Tools & Technologies
    • Hugging Face Transformers, Gradio, PyTorch, Pandas, Matplotlib
  • Steps Involved
    1. Dataset Selection and Exploration: Understanding the structure and distribution of the Emotion dataset.
    2. Model Selection: Using DistilBERT for its efficiency in text classification tasks.
    3. Model Fine-tuning: Enhancing the model's performance by training on the Emotion dataset.
    4. Model Evaluation: Assessing the model using accuracy, precision, recall, and F1-score.
    5. Uploading Model: Sharing the fine-tuned model on Hugging Face.
    6. Gradio Interface Development: Creating a user-friendly interface for the model.
    7. Deployment: Making the app accessible on Hugging Face Spaces.

By consolidating all steps within a single Jupyter Notebook, I aim to make this project easily accessible and modifiable for anyone interested in emotion detection or similar NLP tasks.

Project Artefacts