Coder Social home page Coder Social logo

11711_f22_anlp_hw3_seq2emo's Introduction

Seq2Emo: A Sequence to Multi-Label Emotion Classification

This repo presents the script to replicate the results of Seq2Emo, CC, BR, BR-att as described in the paper.

Requirements

The dependent packages are listed in the requirements.txt. Note that a cuda device is required.

We have included the data and preprocessing script under data folder.

We use GloVe 840B 300d pretrain embedding, you can extract and put the txt file under data folder. or set the python argument --glove_path to point at it.
You also need to use the argument --download_elmo to download the ELMo embedding for first time of running the code.

Training/evaluation

For Seq2Emo, you can get the classification result of SemEval'18 dataset by the following script.

python trainer_lstm_seq2emo.py --dataset sem18 --batch_size 16 --glove_path data/glove.840B.300d.txt --download_emo --seed 0 

Note that the results reported in the paper are based 5 runs with --seed set to 1, 2, 3, 4, 5 respectively.

To change the dataset to GoEmotions, you can specify the --dataset option as goemotions. In the paper, we set the batch size to 32 for GoEmotions dataset to accelerate training.

Similarly, you can generate the results for CC by the following:

python trainer_lstm_cc.py --dataset sem18 --batch_size 16 

For BR, there are two variants: with self-attention and w/o self-attention. You can specify the model by setting the --attention option to self or None.

python trainer_lstm_binary.py --dataset sem18 --batch_size 16 --attention [self|None] 

11711_f22_anlp_hw3_seq2emo's People

Watchers

Klaijan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.