Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
LYFY7 ae36c729f2 | 2 years ago | |
---|---|---|
.. | ||
Data | 2 years ago | |
Utils | 2 years ago | |
__pycache__ | 2 years ago | |
Config.py | 2 years ago | |
README.md | 2 years ago | |
Run.py | 2 years ago | |
TransModule.py | 2 years ago |
This repository was used in our paper:
Transition-based Directed Graph Construction for Emotion-Cause Pair Extraction
Chuang Fan, Chaofa Yuan, Jiachen Du, Lin Gui, Min Yang, Ruifeng Xu. ACL 2020
Please cite our paper if you use this code.
Data - A dir where contains resources used in this code.
bert-base-chinese
: Put the download Pytorch bert model here.DataSplits
: A dir where contains 20 different training/validation/test splits in a ratio of 81. Each sub-dir contains four file: saved_results.txt, train.pkl, valid.pkl and test.pkl.
saved_results.txt
: The results of test set for emotion extraction, cause extraction and emotion-cause pair extraction. We adopt early stopping strategy, and the highest F-measure model on the validation set is used to evaluate the test set.train.pkl
: A list where contains two items. train[0] is a list of document and train[1] is a list of the correspondding emotion-cause pairs. For example, train[0][0]="Last week, I lost my phone where shopping, I feel sad now", then train[1][0]=[(2, 1)].valid.pkl
: Similar to train.pkl.test.pkl
: Similar to train.pkl.doc2pair.pkl
: A dict where the key is the content of a document, and the value is the correspondding emotion-cause pairs.Utils - A dir where contains several python scripts used in this code.
Evaluation.py
: Used to evaluate the performance of the proposed model.Metrics.py
: Metrics for emotion extraction, cause extraction and emotion-cause pair extractions.PrepareData.py
: The scipt for preparing data.Transform.py
: Transforming documents to a sequence of defined actions and parser states from left-to-right based on the emotion-cause pairs.Config.py
- The script holds all the model configuration.
TransModule.py
- The script where contains the proposed transition-based model.
Run.py
- The main script to train and evaluate the proposed transition-based model on different splits.
python3 Run.py
The BibTex of the citation is as follow:
@inproceedings{fan-etal-2020-transition,
title = "Transition-based Directed Graph Construction for Emotion-Cause Pair Extraction",
author = "Fan, Chuang and
Yuan, Chaofa and
Du, Jiachen and
Gui, Lin and
Yang, Min and
Xu, Ruifeng",
booktitle = "Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics",
month = jul,
year = "2020",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2020.acl-main.342",
doi = "10.18653/v1/2020.acl-main.342",
pages = "3707--3717",
abstract = "Emotion-cause pair extraction aims to extract all potential pairs of emotions and corresponding causes from unannotated emotion text. Most existing methods are pipelined framework, which identifies emotions and extracts causes separately, leading to a drawback of error propagation. Towards this issue, we propose a transition-based model to transform the task into a procedure of parsing-like directed graph construction. The proposed model incrementally generates the directed graph with labeled edges based on a sequence of actions, from which we can recognize emotions with the corresponding causes simultaneously, thereby optimizing separate subtasks jointly and maximizing mutual benefits of tasks interdependently. Experimental results show that our approach achieves the best performance, outperforming the state-of-the-art methods by 6.71{\%} (p{\textless}0.01) in F1 measure.",
}
Open Source Sentiment Analysis Algorithm inlcuding Aspect-Based Sentiment Analysis (-ABSA) and Emotion Cause Extraction (-ECE).
Pickle Raw token data Text CSV Python other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》