GithubHelp home page GithubHelp logo

declare-lab / reccon Goto Github PK

View Code? Open in Web Editor NEW
160.0 11.0 29.0 16.25 MB

This repository contains the dataset and the PyTorch implementations of the models from the paper Recognizing Emotion Cause in Conversations.

Python 100.00%
emotion-recognition emotion-recognition-in-conversation dialogue-systems dialogue-generation emotion-cause-pair-extraction emotion-cause bert-model roberta emotion-tasks dataset

reccon's Introduction

RECCON: Recognizing Emotion Cause in CONversations

PWC

PWC

🔥🔥🔥 New baselines: visit emotion-cause-extraction

This repository contains the dataset and the pytorch implementations of the models from the paper Recognizing Emotion Cause in Conversations.

Overview of the Task

Alt text

Given an utterance U, labeled with emotion E, the task is to extract the causal spans S from the conversational history H (including utterance U) that sufficiently represent the causes of emotion E.

Dataset

The original annotated dataset can be found in the json files in the data/original_annotation folder. The dataset with negative examples for the Causal Span Extraction and the Causal Entailment of Emotion tasks can be found in data/subtask1/ and data/subtask2/ folders respectively.

Data Format

The annotations and dialogues of the DailyDialog and IEMOCAP are available at data/original_annotation/*.json. Each instance in the JSON file is allotted one identifier (e.g. "tr_10180") which is a list having a dictionary of the following items for each utterance:

Key Value
turn Utterance index starting from 1.
speaker Speaker of the target utterance.
utterance The text of the utterance.
emotion Emotion label of the utterance.
expanded emotion cause evidence Utterance indices indicating the cause of a non neutral target utterance.
expanded emotion cause spans Causal spans corresponding to the evidence utterances.
explanation Only if the annotator wrote any explanation about the emotion cause.
type The type of the emotion cause.

Example format in JSON:

{
  "tr_10180": 
  [
    [
        {
            "turn": 1,
            "speaker": "A",
            "utterance": "It's time for desserts ! Are you still hungry ?",
            "emotion": "neutral"
        },
        {
            "turn": 2,
            "speaker": "B",
            "utterance": "I've always got room for something sweet !",
            "emotion": "happiness",
            "expanded emotion cause evidence": [
                1,
                2
            ],
            "expanded emotion cause span": [
                "desserts",
                "I've always got room for something sweet !"
            ],
            "type": [
                "no-context",
                "inter-personal"
            ]
        }

    ]
  ]
}

Causal Span Extraction

We formulate the Causal Span Extraction task as a question answering task. To train RoBERTa or SpanBERT models for this task on the DailyDialog dataset use the following command:

python train_qa.py --model [rob|span] --fold [1|2|3] --context

Then, evlaution can be carried out on DailyDialog or IEMOCAP as follows:

python eval_qa.py --model [rob|span] --fold [1|2|3] --context --dataset [dailydialog|iemocap]

Causal Entailment of Emotion

The Causal Entailment of Emotion task is formulated as a classification task. To train RoBERTa-Base or RoBERTa-Large models for this task on the DailyDialog dataset use the following command:

python train_classification.py --model [rob|robl] --fold [1|2|3] --context

Then, evlaution can be carried out on DailyDialog or IEMOCAP as follows:

python eval_classification.py --model [rob|robl] --fold [1|2|3] --context --dataset [dailydialog|iemocap]

Without context models can be trained and evaluated by removing --context from the above commands.

Citation

Recognizing Emotion Cause in Conversations. Soujanya Poria, Navonil Majumder, Devamanyu Hazarika, Deepanway Ghosal, Rishabh Bhardwaj, Samson Yu Bai Jian, Pengfei Hong, Romila Ghosh, Abhinaba Roy, Niyati Chhaya, Alexander Gelbukh, Rada Mihalcea. Cognitive Computation (2021).

reccon's People

Contributors

deepanwayx avatar nmder avatar soujanyaporia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reccon's Issues

About dailydialog dataset

Hello. I am interested in converting dailydialog from TXT format to JSON format, can you share your code? Thank you so much.

model dataclsses

Hello, can you share the model dataclsses?The runtime could not find this module--from dataclsses import asdict, dataclass, field, fields

model reasoning

Hello, is the reasoning code for this model the same as the code for validating the test set, and does the reasoning code need to enter additional information besides the dialogue.

About --fold

Hello, could you tell me about "--fold"? Does it mean the different forms of emotional cause, such as mood setting、general cause、etc.

Confusion regarding evaluation metric.

Hi. I am not able to find any code segment which calculates F1. F1_pos and F1_neg are clear to me. Your code calculates F1_pos and F1_neg but not F1.
image

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.