Skip to content

Simple Emotion Detection using Machine Learning and NLP techniques. Models used include Logarithmic Regression, and Hugging Face Transformer Models.

License

Notifications You must be signed in to change notification settings

Deeekim/Simple-Emotion-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Emotion-Detection Classifier

A simple machine learning model that detects emotions from text. Built primarily as a learning project to compare and explore NLP techniques and sentiment classification.

Dataset

Obtained via loading the emotion dataset from the datasets package.

Features

  • Detects six emotions based on the pre-defined classes of the dataset: sadness, joy, love, anger, fear, and surprise
  • Built using Python, scikit-learn, and transformers
  • Jupyter Notebook for exploration and visualization

How it works

  • Model Training: Logistic Regression, and Transformer (Distilbert) is trained on labeled emotion data
  • Fine tuning: Fine-tuning of transformer model was done over the emotions dataset. One train epoch due to GPU restraints.
  • Prediction: The main evaluation metrics for this training is F1 score. Transformer model produced higher F1 scores across all emotion labels, and a higher accuracy (0.93 against 0.89 of Logistic Regression). Observe that both models confused love and joy emotions most frequently.
  • Visualization: Seaborn and matplot lib to display classification reports of models. Confusion matrix was used to map the correct and incorrect predictions per classification.

Requirements:

  • Python 3.x
  • scitkit-learn
  • pandas
  • numpy
  • transformers
  • jupyter
  • torch

About

Simple Emotion Detection using Machine Learning and NLP techniques. Models used include Logarithmic Regression, and Hugging Face Transformer Models.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published