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.
- NLP models are mathematical algorithms designed to understand, interpret, and generate human language. They power applications like chatbots, language translation, and sentiment analysis.
- 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.
- 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
Dataset Selection and Exploration
: Understanding the structure and distribution of the Emotion dataset.Model Selection
: Using DistilBERT for its efficiency in text classification tasks.Model Fine-tuning
: Enhancing the model's performance by training on the Emotion dataset.Model Evaluation
: Assessing the model using accuracy, precision, recall, and F1-score.Uploading Model
: Sharing the fine-tuned model on Hugging Face.Gradio Interface Development
: Creating a user-friendly interface for the model.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¶
- My fine-tuned model can be found here.
- You can check out the full code I created here.
- And here is the link to the Emotion Detection App in full-screen. Or you can interact with the app here on this page below.