Span-ASTE
This repository implements our ACL 2021 research paper Learning Span-Level Interactions for Aspect Sentiment Triplet Extraction.
Usage
- Install data and requirements:
bash setup.sh
- Run training and evaluation on GPU 0:
bash aste/main.sh 0
- Training config (10 epochs): training_config/aste.jsonnet
- Modified data reader: span_model/data/dataset_readers/span_model.py
- Modeling code: span_model/models/span_model.py
New Data
To apply the span-based model to a new dataset, you need to create a folder in aste/data/triplet_data
and include train.txt
, dev.txt
and test.txt
.
The data format for each line contains the sentence and a list of triplets:
sentence#### #### ####[(triplet_0, ..., triplet_n]
Each triplet is a tuple that consists of (span_a, span_b, label)
. For example:
The screen is very large and crystal clear with amazing colors and resolution .#### #### ####[([1], [4], 'POS'), ([1], [7], 'POS'), ([10], [9], 'POS'), ([12], [9], 'POS')]
Research Citation
If the code is useful for your research project, we appreciate if you cite the following paper:
@inproceedings{xu-etal-2021-learning,
title = "Learning Span-Level Interactions for Aspect Sentiment Triplet Extraction",
author = "Xu, Lu and
Chia, Yew Ken and
Bing, Lidong",
booktitle = "Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers)",
month = aug,
year = "2021",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2021.acl-long.367",
doi = "10.18653/v1/2021.acl-long.367",
pages = "4755--4766",
abstract = "Aspect Sentiment Triplet Extraction (ASTE) is the most recent subtask of ABSA which outputs triplets of an aspect target, its associated sentiment, and the corresponding opinion term. Recent models perform the triplet extraction in an end-to-end manner but heavily rely on the interactions between each target word and opinion word. Thereby, they cannot perform well on targets and opinions which contain multiple words. Our proposed span-level approach explicitly considers the interaction between the whole spans of targets and opinions when predicting their sentiment relation. Thus, it can make predictions with the semantics of whole spans, ensuring better sentiment consistency. To ease the high computational cost caused by span enumeration, we propose a dual-channel span pruning strategy by incorporating supervision from the Aspect Term Extraction (ATE) and Opinion Term Extraction (OTE) tasks. This strategy not only improves computational efficiency but also distinguishes the opinion and target spans more properly. Our framework simultaneously achieves strong performance for the ASTE as well as ATE and OTE tasks. In particular, our analysis shows that our span-level approach achieves more significant improvements over the baselines on triplets with multi-word targets or opinions.",
}