IsakZhang / Generative-ABSA

86 stars 16 forks source link

Generative ABSA

This repo contains the data and code for our paper Towards Generative Aspect-Based Sentiment Analysis in ACL 2021.

Requirements

Pls note that some packages (such as transformers) are under highly active development, so we highly recommend you to install the specified version of the following packages:

Quick Start

Detailed Usage

We conduct experiments on four ABSA tasks with four datasets in the paper, you can change the parameters in run.sh to try them:

python main.py --task $task \
            --dataset $dataset \
            --model_name_or_path t5-base \
            --paradigm $paradigm \
            --n_gpu 0 \
            --do_train \
            --do_direct_eval \
            --train_batch_size 16 \
            --gradient_accumulation_steps 2 \
            --eval_batch_size 16 \
            --learning_rate 3e-4 \
            --num_train_epochs 20 

More details can be found in the paper and the help info in the main.py.

Citation

If the code is used in your research, please star our repo and cite our paper as follows:

@inproceedings{zhang-etal-2021-towards,
    title = "Towards Generative Aspect-Based Sentiment Analysis",
    author = "Zhang, Wenxuan  and
      Li, Xin  and
      Deng, Yang  and
      Bing, Lidong  and
      Lam, Wai",
    booktitle = "Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers)",
    year = "2021",
    url = "https://aclanthology.org/2021.acl-short.64",
    pages = "504--510",
}