This repository focuses on the task of Aspect-Based Sentiment Analysis (ABSA) for Vietnamese Hotel Reviews. It provides implementations of multi-task learning techniques to enhance the performance of ABSA on this specific domain.
Aspect-Based Sentiment Analysis is a natural language processing task that aims to identify and analyze sentiments expressed towards specific aspects within a text. In the context of this repository, ABSA is performed on Vietnamese hotel reviews, where the goal is to identify aspects (e.g., "FOOD#QUALITY," "HOTEL&ROOM#PRICES) and their corresponding sentiment polarities (e.g., positive, negative, neutral).
We focus on the task of text-level Aspect-Based Sentiment Analysis (ABSA).
This repository provides a framework that simplifies the process of annotating data for the Aspect-Based Sentiment Analysis (ABSA) text-level problem. It includes an annotation tool and instructions on how to set it up and use it with your custom dataset.
please ensure that Streamlit is installed in your environment. You can install it by running the following command:
pip install streamlit
To run the annotation tool, execute the following command: streamlit run Annotation_lab.py
Ensure that your custom data is structured as follows:
#1
text1
{FOOD#STYLE&OPTIONS, neutral}, {FOOD#QUALITY, neutral}
#2
text2 #reviews
#label (blank if not annotated)
...
To configure the annotation tool to match your dataset, you can modify or create a new YAML config file.
Note: Example config file for our dataset: `config/absa_config_anno.yaml
Install the necessary dependencies by running: pip install -r requirements.txt
Please organize your configuration file for training and evaluation in the following structure:
Main-folder/
│
├── config/
│ ├── absa_model.yaml - This file contains configuration for training model
| │
| └── absa_anno_config.yaml
└── ...
In this project, we focus on training Network based on pretrainded PhoBert embedding model. Executing the following command for trainning:
python trainer.py
If you want to fine-tune the embedding model, set freeze_embedder: False
in config/absa_model.yaml
file.
Note: When making any changes or customizations for training on a custom dataset, remember to update the config/absa_model.yaml file according to your data.
To evaluate the model on the test set, use the following command:
python eval.py