/bote

Primary LanguagePython

BOTE

BOTE - Bert for Opinion Triplet Extraction

  • Code and preprocessed dataset for paper titled A Deep Learning approach for Aspect Sentiment Triplet Extraction in Portuguese (preparing for submission)
  • Jose Melendez and Glauber de Bona.

Requirements

  • Python 3.7.10
  • PyTorch 1.8.1+cu101
  • Numpy 1.19.5
  • Transformers 4.6.1
  • Spacy 2.2.4
  • Pandas 1.1.5

Get started

  • Install Spacy Languages
python -m spacy download en_core_web_md
python -m spacy download pt_core_news_sm
python -m spacy download es_core_news_md
  • Set enviroment
python generate_directory_data.py
python dependency_graph.py --undirected 1
python generate_data.py

Usage

  • Download pretrained GloVe embeddings (Englisg and Portuguese) with these links: EN Glove and PT Glove . Extract files into glove/.

Run standalone model

  • Train with command, optional arguments could be found in train.py
python train.py --model bote --case cased --dataset reli_c_0 --bert_model neuralmind/bert-base-portuguese-cased --lang pt

Run experiments

  • Run proposted model and baselines
chmod -R 777 run.sh
bash ./run.sh -d 'rehol' -E 60

Display Results proposted model vs baselines

python cross_validation/display_results.py

Task

An overview of the task aspect sentiment triplet extraction (ASTE) is given below

model

Given a sentence $S={w_{1},w_{2},w_{3},...,w_{n}}$ consisting of $n$ words, extracting all possible triplets $T={(a,o,p){m}}{m=1}^{|T|}$ from $S$, where $a$, $o$ and $p$ respectively denote an n-gram aspect term, an n-gram opinion term and a sentiment polarity; $a_{m}$ and $o_{m}$ can be represented as their start and end positions ($s_{m}$, $e_{m}$) in $S$ and $p_m \in {Positive, Negative, Neutral}$.

Citation

If you use the code in your paper, please cite our paper

@InProceedings{10.1007/978-3-030-91699-2_24,
author="Barros, Jos{\'e} Mel{\'e}ndez
and De Bona, Glauber",
editor="Britto, Andr{\'e}
and Valdivia Delgado, Karina",
title="A Deep Learning Approach for Aspect Sentiment Triplet Extraction in Portuguese",
booktitle="Intelligent Systems",
year="2021",
publisher="Springer International Publishing",
address="Cham",
pages="343--358",
isbn="978-3-030-91699-2"
}