Code for "Ranking Based Multi-Label Classification for Sentiment Analysis" LKE 2019(7th International Symposium on Language & Knowledge Engineering).
-
Download datasets
- Ren_CECps dataset, download it by contacting
[email protected]
. - SemEval2007.
- Sina Social News dataset, download it by contacting
[email protected]
.
Unzip these datasets in
data
folder and use theparser.py
to convert them into.json
format.mkdir data && cd data # unzip the datasets in `data` python3 parser.py
- Ren_CECps dataset, download it by contacting
-
Download pretrained model
mkdir models && cd models mkdir bert-base-chinese && cd bert-base-chinese wget https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-chinese.tar.gz tar -zxvf bert-base-chinese.tar.gz wget https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-chinese-vocab.txt cd .. mkdir bert-base-uncased && cd bert-base-uncased wget https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased.tar.gz tar -zxvf bert-base-uncased.tar.gz wget https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-vocab.txt
-
Train the model
python3 bert_classifier.py