Span-ASTE-Pytorch
This repository is a pytorch version that implements Ali's ACL 2021 research paper Learning Span-Level Interactions for Aspect Sentiment Triplet Extraction .
-
🤗 The original repository of the paper is based on the allennlp implementation -
🤗 Thanks to Ali's dataset SemEval-Triplet-data that was open sourced, so that we can use it for research
Usage
-
🍉 Download dataset from here SemEval-Triplet-data, ASTE-Data-V2-EMNLP2020 is used in my repository -
🥭 Download GloVe pre-trained word vectors, -
🍑 Convertglove_input_file
in GloVe format to word2vec format and write it to `word2vec_output_file
from gensim.scripts.glove2word2vec import glove2word2vec
glove2word2vec("path/to/dir/glove_input_file", "path/to/dir/word2vec_output_file")
-
🍓 train the span-aste model
python train.py --glove_word2vector vector_cache/w2v.txt \
--dataset data/ASTE-Data-V2-EMNLP2020/15res/ \
--output_path output/
-
🍇 test the span-aste model
python test.py --model_path \
--glove_word2vector corpus/w2v.txt \
--dataset data/ASTE-Data-V2-EMNLP2020/15res/\
-model `path/to/model/model.pkl`