https://github.com/agn-7/emotion-detection-rnn
A bidirectional GRU model to detect discrete emotions in tweets.
https://github.com/agn-7/emotion-detection-rnn
colab colaboratory deep-learning deep-reinforcement-learning emotion-detection google-colab gru jupyter-notebook nlp python python3 rnn sentimental-analysis tensorflow twitter
Last synced: 7 months ago
JSON representation
A bidirectional GRU model to detect discrete emotions in tweets.
- Host: GitHub
- URL: https://github.com/agn-7/emotion-detection-rnn
- Owner: agn-7
- Created: 2020-01-20T08:39:01.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-22T17:48:35.000Z (about 5 years ago)
- Last Synced: 2025-01-16T13:58:41.493Z (9 months ago)
- Topics: colab, colaboratory, deep-learning, deep-reinforcement-learning, emotion-detection, google-colab, gru, jupyter-notebook, nlp, python, python3, rnn, sentimental-analysis, tensorflow, twitter
- Language: Jupyter Notebook
- Size: 13 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Emotion Detection Model
This is the code for training an emotion detection model using GRU presented in:

___
## Train your own modelRequirements (tested with):
- *Python 3.6*
- *Numpy 1.14.5*
- *Pandas 0.24.1*
- *Sklearn 0.19.0*
- *Tensorflow 2.0.0-beta1*### Installation:
pip install -r requirements.txt
### To run:
After downloading/cloning, put the dataset in the data folder.
To use the dataset in the paper you can download tweets based on their tweet ids available with their classes in `./data/` and remove the hashtags at the end of each tweets. The final dataset should have the following format: `id, text, emotion` with one record (tweet) per line.
The embedding file should be placed in `./vectorss/`
Use the `configuration.cfg` to set the name of dataset and embedding file, maximun numer in the vocabulary (max_features), maximum length of terms in the text (maxlen), bactch size and number of epochs to run the training.
Then run the `handler.py`:
python handler.py
### Google-Colab
You can use `handler.ipynb` in order to use in google-colab or jupyter notebook.
---
## TestingYou can download the trained models used for the paper at: https://drive.google.com/open?id=1TXEbHMTA_AWPFC8bbt7WiBtfT3jVy8cG .
To run, put the test file into the data forlder. test file should be one tweet per line with no additional columns. set the name of the file in `test_configuration.cfg` and run `handler-test.py`.
## Citation
Please use the following citation when using the code or the paper:@article{seyeditabari2019emotion,
title={Emotion Detection in Text: Focusing on Latent Representation},
author={Seyeditabari, Armin and Tabari, Narges and Gholizadeh, Shafie and Zadrozny, Wlodek},
journal={arXiv preprint arXiv:1907.09369},
year={2019}
}