emotions-detector

An end to end project which features a web page where a user can write a sentence and the model predicts the emotion depicted by the sentence

https://github.com/aryansheka/emotions-detector

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.7%) to scientific vocabulary
Last synced: 11 months ago · JSON representation ·

Repository

An end to end project which features a web page where a user can write a sentence and the model predicts the emotion depicted by the sentence

Basic Info
  • Host: GitHub
  • Owner: AryanSheka
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 5.37 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 3 years ago · Last pushed almost 3 years ago
Metadata Files
Readme Citation

README.md

Emotion Detector

This project takes in a sentence from a user and gives the emotion represented by the sentence, one of 6 emotions namely sadness, joy, anger, love, fear and surprise.

Uses an embedding layer and LSTM recurrent neural network to predict the emotions with an f1_score of 82.7% with average set to micro in test dataset.

Uses one hot encoding to vectorize the data.

Data ingestion is done from a MYSQL database in local system.

User interface is of the form of a web application developed using Flask Web application framework.

Docker is used for Containerization.

Requirements

Use the package manager pip to install requirements.txt pip install -r 'requirements.txt'

Loading data

Data loading is done from a MySQL database in the local system in the data ingestion file and the train, test and raw data are stored in the artifacts folder in the form of a csv file.

The original dataset is obtained from dair.ai

Data Transformation

Data cleaning and transformation is done in the data transformation file.

Encoding is done using one hot encoding and the encoder is saved as a pickle file in artifacts

Model training

Model training and hyperparameter tuning are done in the model_trainer file.

Hyperparameter tuning is done using GridSearchCV and model with best accuracy with test data is trained with the entire dataset and saved as a pickle file in artifacts

Running the web app

The web app can be run by running the app.py file python app.py

The app file contains all the flask code used to run the web app which loads web page which is made using html stored in the templates file.

Demo

https://github.com/AryanSheka/Emotions-Detector/assets/77437286/4c032999-2d22-4504-8013-107b0387ac22

License

MIT

Owner

  • Name: Aryan Sheka
  • Login: AryanSheka
  • Kind: user

Citation (CITATION.cff)

# Dataset citation
@inproceedings{saravia-etal-2018-carer,
    title = "{CARER}: Contextualized Affect Representations for Emotion Recognition",
    author = "Saravia, Elvis  and
      Liu, Hsien-Chi Toby  and
      Huang, Yen-Hao  and
      Wu, Junlin  and
      Chen, Yi-Shin",
    booktitle = "Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing",
    month = oct # "-" # nov,
    year = "2018",
    address = "Brussels, Belgium",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/D18-1404",
    doi = "10.18653/v1/D18-1404",
    pages = "3687--3697",
    abstract = "Emotions are expressed in nuanced ways, which varies by collective or individual experiences, knowledge, and beliefs. Therefore, to understand emotion, as conveyed through text, a robust mechanism capable of capturing and modeling different linguistic nuances and phenomena is needed. We propose a semi-supervised, graph-based algorithm to produce rich structural descriptors which serve as the building blocks for constructing contextualized affect representations from text. The pattern-based representations are further enriched with word embeddings and evaluated through several emotion recognition tasks. Our experimental results demonstrate that the proposed method outperforms state-of-the-art techniques on emotion recognition tasks.",
}

GitHub Events

Total
Last Year

Dependencies

Dockerfile docker
  • python 3.11.3-slim-buster build
requirements.txt pypi
  • dataclasses *
  • dill *
  • flask *
  • keras *
  • mysql-connector-python *
  • nltk *
  • numpy *
  • pandas *
  • regex *
  • scikeras *
  • scikit-learn *
  • tensorflow *
setup.py pypi
.github/workflows/main_emotionsdector.yml actions
  • actions/checkout v2 composite
  • actions/download-artifact v2 composite
  • actions/setup-python v1 composite
  • actions/upload-artifact v2 composite
  • azure/webapps-deploy v2 composite
.github/workflows/main_emotionsdetector.yml actions
  • actions/checkout v2 composite
  • actions/download-artifact v2 composite
  • actions/setup-python v1 composite
  • actions/upload-artifact v2 composite
  • azure/webapps-deploy v2 composite