This is the repository of COMP 5222 group project, our group number is 13.
Open your terminal, navigate to the "code" folder and run DataProcess.py.
! python DataProcess.py --data_path ../data
Open your terminal and run flair_train.py in the "code" folder.
Here you can change the model structure flexibly. (refer to the tutorial of flair).
! python flair_train.py --input ../data \
--output ../output \
--gpu 'cuda' \
--train_file 'fold_1234.txt' \
--dev_file 'fold_5_dev.txt' \
--test_file 'fold_5_test.txt' \
--transformer 'bert-base-uncased' \
--learning_rate 2e-5 \
--mini_batch_size 8 \
--max_epochs 20 \
--patience 2
Open your terminal and run predict.py in the "code" folder. (you need to modify data_path according to your situation)
---------predict_file: the path of file that your model predicts.
---------sample_pred_file: the path where you want to save the standard prediction.
! python predict.py --input ../data \
--output ../output \
--gpu 'cuda' \
--train_file 'fold_1234.txt' \
--dev_file 'fold_5_test.txt' \
--test_file 'fold_5_test.txt' \
--checkpoint 'best-model.pt' \
--predict_file 'bert_fold_5_test.txt' \
--sample_pred_file 'fold_5_test_recover.txt'
Then you can get a result like this:
F1 score: 0.6704417291328144