All Projects → wxjiao → HiGRUs

wxjiao / HiGRUs

Licence: other
Implementation of the paper "Hierarchical GRU for Utterance-level Emotion Recognition" in NAACL-2019.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to HiGRUs

Delta
DELTA is a deep learning based natural language and speech processing platform.
Stars: ✭ 1,479 (+2365%)
Mutual labels:  text-classification, emotion-recognition
10kGNAD
Ten Thousand German News Articles Dataset for Topic Classification
Stars: ✭ 63 (+5%)
Mutual labels:  text-classification
ganbert-pytorch
Enhancing the BERT training with Semi-supervised Generative Adversarial Networks in Pytorch/HuggingFace
Stars: ✭ 60 (+0%)
Mutual labels:  text-classification
ntua-slp-semeval2018
Deep-learning models of NTUA-SLP team submitted in SemEval 2018 tasks 1, 2 and 3.
Stars: ✭ 79 (+31.67%)
Mutual labels:  emotion-recognition
loki
Proof-of-concept of emotion-targeted content delivery using machine learning and ARKit.
Stars: ✭ 76 (+26.67%)
Mutual labels:  emotion-recognition
Naive-Bayes-Text-Classifier-in-Java
Naive Bayes Classification used to classify movie reviews as positive or negative
Stars: ✭ 18 (-70%)
Mutual labels:  text-classification
netbout
Private talks made easy
Stars: ✭ 40 (-33.33%)
Mutual labels:  conversation
XED
XED multilingual emotion datasets
Stars: ✭ 34 (-43.33%)
Mutual labels:  emotion-recognition
EmotionChallenge
Source code for 1st winner of face micro-emotion competition, FG 2017.
Stars: ✭ 37 (-38.33%)
Mutual labels:  emotion-recognition
automatic-personality-prediction
[AAAI 2020] Modeling Personality with Attentive Networks and Contextual Embeddings
Stars: ✭ 43 (-28.33%)
Mutual labels:  text-classification
nsmc-zeppelin-notebook
Movie review dataset Word2Vec & sentiment classification Zeppelin notebook
Stars: ✭ 26 (-56.67%)
Mutual labels:  text-classification
CLUEmotionAnalysis2020
CLUE Emotion Analysis Dataset 细粒度情感分析数据集
Stars: ✭ 3 (-95%)
Mutual labels:  emotion-recognition
Age-gender-and-emotion-recognition
3 networks to recognition age,gender and emotion
Stars: ✭ 29 (-51.67%)
Mutual labels:  emotion-recognition
NLP Toolkit
Library of state-of-the-art models (PyTorch) for NLP tasks
Stars: ✭ 92 (+53.33%)
Mutual labels:  text-classification
monkeylearn-php
Official PHP client for the MonkeyLearn API. Build and consume machine learning models for language processing from your PHP apps.
Stars: ✭ 47 (-21.67%)
Mutual labels:  text-classification
AIML-Human-Attributes-Detection-with-Facial-Feature-Extraction
This is a Human Attributes Detection program with facial features extraction. It detects facial coordinates using FaceNet model and uses MXNet facial attribute extraction model for extracting 40 types of facial attributes. This solution also detects Emotion, Age and Gender along with facial attributes.
Stars: ✭ 48 (-20%)
Mutual labels:  emotion-recognition
Reuters-21578-Classification
Text classification with Reuters-21578 datasets using Gensim Word2Vec and Keras LSTM
Stars: ✭ 44 (-26.67%)
Mutual labels:  text-classification
m3f.pytorch
PyTorch code for "M³T: Multi-Modal Multi-Task Learning for Continuous Valence-Arousal Estimation"
Stars: ✭ 20 (-66.67%)
Mutual labels:  emotion-recognition
Deep-Surveillance-Monitor-Facial-Emotion-Age-Gender-Recognition-System
Computer Vision module for detecting emotion, age and gender of a person in any given image, video or real time webcam. A custom VGG16 model was developed and trained on open source facial datasets downloaded from Kaggle and IMDB. OpenCV,dlib & keras were used to aid facial detection and video processing. The final system can detect the emotion,…
Stars: ✭ 60 (+0%)
Mutual labels:  emotion-recognition
nlp classification
Implementing nlp papers relevant to classification with PyTorch, gluonnlp
Stars: ✭ 224 (+273.33%)
Mutual labels:  text-classification

HiGRU: Hierarchical Gated Recurrent Units for Utterance-level Emotion Recognition

This is the Pytorch implementation of HiGRU: Hierarchical Gated Recurrent Units for Utterance-level Emotion Recognition in NAACL-2019. [paper]

Brief Introduction

In this paper, we address three challenges in utterance-level emotion recognition in dialogue systems: (1) the same word can deliver different emotions in different contexts; (2) some emotions are rarely seen in general dialogues; (3) long-range contextual information is hard to be effectively captured. We therefore propose a hierarchical Gated Recurrent Unit (HiGRU) framework with a lower-level GRU to model the word-level inputs and an upper-level GRU to capture the contexts of utterance-level embeddings. Moreover, we promote the framework to two variants, HiGRU with individual features fusion (HiGRU-f) and HiGRU with self-attention and features fusion (HiGRU-sf), so that the word/utterance-level individual inputs and the long-range contextual information can be sufficiently utilized. Experiments on three dialogue emotion datasets, IEMOCAP, Friends, and EmotionPush demonstrate that our proposed HiGRU models attain at least 8.7%, 7.5%, 6.0% improvement over the state-of-the-art methods on each dataset, respectively. Particularly, by utilizing only the textual feature in IEMOCAP, our HiGRU models gain at least 3.8% improvement over the state-of-the-art conversational memory network (CMN) with the trimodal features of text, video, and audio.

Figure 1: The framework of HiGRU.

Code Base

Dataset

Please find the datasets via the following links:

  • Friends: Friends comes from the transcripts of Friends TV Sitcom, where each dialogue in the dataset consists of a scene of multiple speakers.
  • EmotionPush: EmotionPush comes from private conversations between friends on the Facebook messenger collected by an App called EmotionPush.
  • IEMOCAP: IEMOCAP contains approximately 12 hours of audiovisual data, including video, speech, motion capture of face, text transcriptions.

HiGRUs storage also provides a full collection of the three datasets in .json format preprocessed by us.

Prerequisites

  • Python v3.6
  • Pytorch v0.4.0-v0.4.1
  • Pickle

Data Preprocessing

For each dataset, we need to preprocess it using the Preprocess.py file as:

python Preprocess.py -emoset Friends -min_count 2 -max_seq_len 60

The arguments -emoset, -min_count, and -max_length represent the dataset name, the minimum frequency of words when building the vocabulary, and the max_length for padding or truncating sentences.

Pre-trained Word Embeddings

To reproduce the results reported in the paper, please adopt the pre-trained word embeddings for initialization. You can download the 300-dimentional embeddings from below:

Decompress the files and re-name them as word2vec300.bin and glove300.txt, respectively.

Train

You can run the exec_emo.sh file in Bash as:

bash exec_emo.sh

Or you can set up the model parameters yourself:

python EmoMain.py \
-lr 2e-4 \
-gpu 0 \
-type higru-sf \
-d_h1 300 \
-d_h2 300 \
-report_loss 720 \
-data_path Friends_data.pt \
-vocab_path Friends_vocab.pt \
-emodict_path Friends_emodict.pt \
-tr_emodict_path Friends_tr_emodict.pt \
-dataset Friends \
-embedding Friends_embedding.pt

More Details:

  • The implementation supports both CPU and GPU (but only one GPU), you need to specify the device number of GPU in your arguments otherwise the model will be trained in CPU.
  • There are three modes in this implementation, i.e., higru, higru-f, and higru-sf, as described in the paper. You can select one of them by the argument -type.
  • The default sizes of the hidden states in the GRUs are 300, but smaller values also work well (larger ones may result in over-fitting).
  • You have to load in the data produced by the Preprocess.py file, e.g., including Friends_data.pt, Friends_vocab.pt, Friends_emodict.pt, and Friends_tr_emodict.pt, as well as the dataset name Friends.
  • The argument -embedding is optional that you can load in the embeddings saved by the first run or the implementation will initialize it every time (which is time-consuming).
  • There are some other arguments in the EmoMain.py file, e.g., the decay rate for learning rate, the patience for early stopping. You can find out and change them if necessary.

Public Impact

Citation

Please kindly cite our paper:

@inproceedings{jiao2019higru,
  title     = {HiGRU: Hierarchical Gated Recurrent Units for Utterance-Level Emotion Recognition},
  author    = {Jiao, Wenxiang and Yang, Haiqin and King, Irwin and Lyu, Michael R},
  booktitle = {Proceedings of the 2019 Conference of the North American Chapter 
               of the Association for Computational Linguistics: 
               Human Language Technologies, Volume 1 (Long and Short Papers)},
  pages     = {397--406},
  year      = {2019}
}

Interesting Variants of HiGRUs

Below we selectively list some variants of our HiGRUs developed by other researchers:

  • Bert-HiGRU: Keeping Up Appearances: Computational Modeling of Face Acts in Persuasion Oriented Discussions. [paper]
  • HiTransformer: Hierarchical Transformer Network for Utterance-level Emotion Recognition. [paper]
  • HAN-ReGRU: Hierarchical attention network with residual gated recurrent unit for emotion recognition in conversation. [paper]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].