Skip to content

vishgm/Automate-detection-of-emotions-using-ML

Repository files navigation

Automate detection of different emotions from paragraphs and predict overall emotion

About :

This project is part of an Internship (TCS iON RIO 210 )

Problem Statement:

RIO-210: Automate detection of different emotions from paragraphs and predict overall emotion - (Batch 01)

Solution

A complete analysis is available here : emotion-prediction-notebook

Contents:

  1. Libraries
  2. Models

Libraries:

Libraries used :
Core libraries: numpy,sklearn,pandas,matplotlib
Machine Learning / NLP Libraries : Sci-kit Learn(sk-learn), NLTK
Deep Learning Libraries : Tensorflow, Keras

Embeddings :

Fasttext pre-trained (english) word vectors were also used as embeddings: https://fasttext.cc/docs/en/english-vectors.html

Flow:-

  1. Data cleaning
  2. Data pre-processing
  3. Feature Selection
  4. Stopwords removal
  5. Feature Encoding
  6. Creating Bag-of-words(BoW) model
  7. Final Model creation

Selection of model

Since the dataset consists of categorical data, classification algorithms were used to strengthen the predictive power of the model.

Here two models were built viz:

  1. Multinomial Naive Bayes
  2. Random Forest Classifier
  3. SGD classifier
  4. Logistic Regression

Result:

To determine the best model to use for this classification problem, a comparison was done between all of the models.

The final result - LSTM model wins in the deep learning category for this task!

  1. Machine Learning: SGD classifier performed slightly better as compared to all the other models in terms of accuracy.

  2. Deep Learning: LSTM Architecture provided the best results for predicting overall emotion from text, even better than SGD

Data

Please refer the Data folder : Data

@Authors