Giter VIP home page Giter VIP logo

dialogxl's Introduction

DialogXL

This repo contains the PyTorch implementaion for AAAI-2021 accepted paper DialogXL: All-in-One XLNet for Multi-Party Conversation Emotion Recognition.

Requirements

  • Python 3.6
  • PyTorch 1.4.0
  • Transformers 3.0.2
  • scikit-learn 0.23.1
  • CUDA 10.0

Preparation

Datasets

We have provided the preprocessed datasets of IEMOCAP, MELD, DailyDialog and EmoryNLP in /data/. For each dataset, there are 3 json files containing dialogs for train/dev/test set. Each dialog contains utterances and their corresponding speaker information and emotion labels.

Pre-trained XLNet

You should download the pytorch version pre-trained xlnet-base model and vocabulary from the link provided by huggingface. Then change the value of parameter --bert_model_dir and --bert_tokenizer_dir to the directory of the bert model.

Evaluate

You can download our well-trained DialogXL for each dataset from https://drive.google.com/drive/folders/1ONGBbo9r9S49i5bz4jgrC79txQHNVZv2?usp=sharing or https://pan.baidu.com/s/1SYbpCI4LTzUnYbRKzPvijg 提取码 jpfe

Then put them to /DialogXL/saved_models/

You can run the following codes to get results very close to those reported in our paper (we report the average of 5 random runs in paper):

For IEMOCAP (test F1: 65.88): python eval.py --dataset_name IEMOCAP --max_sent_len 200 --mem_len 900 --windowp 10 --num_heads 2 2 4 4 --modelname IEMOCAP_xlnet_dialog

For MELD (test F1: 62.67): python eval.py --dataset_name MELD --max_sent_len 300 --mem_len 400 --windowp 5 --num_heads 5 5 1 1 --modelname MELD_xlnet_dialog

For DailyDialog (test F1: 55.67): python eval.py --dataset_name DailyDialog --max_sent_len 300 --mem_len 450 --windowp 10 --num_heads 1 2 5 4 --dropout 0.3 --modelname DailyDialog_xlnet_dialog

For EmoryNLP (test F1: 36.27): python eval.py --dataset_name EmoryNLP --max_sent_len 150 --mem_len 400 --windowp 5 --num_heads 1 2 4 5 --modelname EmoryNLP_xlnet_dialog

Training

You can also train the models with the following codes:

For IEMOCAP: python run.py --dataset_name IEMOCAP --max_sent_len 200 --mem_len 900 --windowp 10 --num_heads 2 2 4 4 --dropout 0 --lr 1e-5 --epochs 50

For MELD: python run.py --dataset_name MELD --max_sent_len 300 --mem_len 400 --windowp 5 --num_heads 5 5 1 1 --dropout 0 --lr 1e-6 --epochs 15

For DailyDialog: python run.py --dataset_name DailyDialog --max_sent_len 300 --mem_len 450 --windowp 10 --num_heads 1 2 5 4 --dropout 0.3 --lr 1e-6 --epochs 20

For EmoryNLP: python run.py --dataset_name EmoryNLP --max_sent_len 150 --mem_len 400 --windowp 5 --num_heads 1 2 4 5 --dropout 0 --lr 7e-6 --epochs 10

dialogxl's People

Contributors

shenwzh3 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.