Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,82 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
---
|
| 4 |
+
# M-ABSA
|
| 5 |
+
|
| 6 |
+
This repo contains the data and code for our paper ****M-ABSA: A Multilingual Dataset for Aspect-Based Sentiment Analysis****.
|
| 7 |
+
|
| 8 |
+
[](https://arxiv.org/abs/2502.11824)
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
# Data Description:
|
| 12 |
+
|
| 13 |
+
All datasets are stored in the data/ folder:
|
| 14 |
+
|
| 15 |
+
- All dataset contains 7 domains.
|
| 16 |
+
|
| 17 |
+
```
|
| 18 |
+
domains = ["coursera", "hotel", "laptop", "restaurant", "phone", "sight", "food"]
|
| 19 |
+
```
|
| 20 |
+
- Each dataset contains 21 languages.
|
| 21 |
+
```
|
| 22 |
+
langs = ["ar", "da", "de", "en", "es", "fr", "hi", "hr", "id", "ja", "ko", "nl", "pt", "ru", "sk", "sv", "sw", "th", "tr", "vi", "zh"]
|
| 23 |
+
```
|
| 24 |
+
- Each dataset is divided into training, validation, and test sets. Each sentence is separated by __"####"__, with the first part being the sentence and the second part being the corresponding triplet. Here is an example, where the triplet includes __[aspect, category, sentiment]__.
|
| 25 |
+
|
| 26 |
+
```
|
| 27 |
+
This coffee brews up a nice medium roast with exotic floral and berry notes .####[['coffee', 'food quality', 'positive', 'nice']]
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
## Requirements
|
| 31 |
+
|
| 32 |
+
We recommend you to install the specified version of the following packages:
|
| 33 |
+
|
| 34 |
+
- transformers==4.0.0
|
| 35 |
+
- sentencepiece==0.1.91
|
| 36 |
+
- pytorch_lightning==0.8.1
|
| 37 |
+
|
| 38 |
+
## Quick Start for the Baseline
|
| 39 |
+
|
| 40 |
+
- Set up the environment as described in the above section.
|
| 41 |
+
- Download the pre-trained mT5-base model from [https://huggingface.co/google/mt5-base](https://huggingface.co/google/mt5-base) and place it under the folder mT5-base/ .
|
| 42 |
+
- Run command bash run.sh, which train the model on source language under UABSA/TASD task.
|
| 43 |
+
- Run command bash evaluate.sh, which test the model on target language under UABSA/TASD task.
|
| 44 |
+
|
| 45 |
+
****Detailed Usage****
|
| 46 |
+
|
| 47 |
+
We conduct experiments on two ABSA subtasks with M-ABSA dataset in the paper, you can change the parameters in run.sh to try them:
|
| 48 |
+
|
| 49 |
+
```
|
| 50 |
+
python main.py --task tasd \
|
| 51 |
+
--dataset hotel \
|
| 52 |
+
--model_name_or_path mt5-base \
|
| 53 |
+
--paradigm extraction \
|
| 54 |
+
--n_gpu 0 \
|
| 55 |
+
--do_train \
|
| 56 |
+
--do_direct_eval \
|
| 57 |
+
--train_batch_size 16 \
|
| 58 |
+
--gradient_accumulation_steps 2 \
|
| 59 |
+
--eval_batch_size 16 \
|
| 60 |
+
--learning_rate 3e-4 \
|
| 61 |
+
--num_train_epochs 5
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
- $task refers to one of the ABSA task in [uabsa, tasd]
|
| 65 |
+
- $dataset refers to one of the seven datasets in [food, restaurant, coursera, laptop, sight, phone, hotel]
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
## Citation
|
| 69 |
+
|
| 70 |
+
If the code or dataset is used in your research, please star our repo and cite our paper as follows:
|
| 71 |
+
```
|
| 72 |
+
@misc{wu2025mabsa,
|
| 73 |
+
title={M-ABSA: A Multilingual Dataset for Aspect-Based Sentiment Analysis},
|
| 74 |
+
author={Chengyan Wu and Bolei Ma and Yihong Liu and Zheyu Zhang and Ningyuan Deng and Yanshu Li and Baolan Chen and Yi Zhang and Barbara Plank and Yun Xue},
|
| 75 |
+
year={2025},
|
| 76 |
+
eprint={2502.11824},
|
| 77 |
+
archivePrefix={arXiv},
|
| 78 |
+
primaryClass={cs.CL},
|
| 79 |
+
url={https://arxiv.org/abs/2502.11824},
|
| 80 |
+
}
|
| 81 |
+
```
|
| 82 |
+
|