Aspect Based Sentiment Analysis, PyTorch Implementations.
- pytorch >= 0.4.0
- numpy >= 1.13.3
- sklearn
- python 3.6 / 3.7
- transformers
To install requirements, run pip install -r requirements.txt
.
- For non-BERT-based models, GloVe pre-trained word vectors are required, please refer to data_utils.py for more detail.
python train.py --model_name bert_spc --dataset restaurant
- All implemented models are listed in models directory.
- See train.py for more training arguments.
- Refer to train_k_fold_cross_val.py for k-fold cross validation support.
- Refer to infer_example.py for both non-BERT-based models and BERT-based models.
MIT