Replication of the methodology proposed in the paper Utilizing BERT for Aspect-Based Sentiment Analysis via Constructing Auxiliary Sentence.
In this work (Targeted) Aspect-Based Sentiment Analysis task is converted to a sentence-pair classification task and a pre-trained BERT model is fine-tuned on it.
More details about the project in the presentation.
To get a local copy up and running follow these simple steps:
- Clone the repo
git clone https://github.com/LorenzoAgnolucci/BERT_for_ABSA.git
- Run
pip install -r requirements.txt
in the root folder of the repo to install the requirements
-
Run
generate_datasets.py
to build the datasets corresponding to each model or simply use the ones provided indata/sentihood/
anddata/semeval2014/
-
Use the forms in
BERT_for_ABSA.ipynb
to choose the desired dataset type and task both for BERT-single and BERT-pair. Then fine-tune the model and evaluate it runnning the corresponding cells -
Run the subsequent cells in
BERT_for_ABSA.ipynb
to fine-tune and evalaute the model
Machine Learning © Course held by Professor Paolo Frasconi - Computer Engineering Master Degree @University of Florence