python == 3.8.0
allennlp == 2.4.0
pip install allennlp -i https://pypi.tuna.tsinghua.edu.cn/simple
python train.py
python evaluate.py
python predict.py
allennlp train scripts/my_text_classifier.jsonnet --serialization-dir checkpoint --include-package my_text_classifier
allennlp evaluate checkpoint/model.tar.gz data/movie_review/test.tsv --include-package my_text_classifier
allennlp predict checkpoint/model.tar.gz data/movie_review/test.jsonl --include-package my_text_classifier --predictor sentence_classifier
这里需要下载bert预训练模型放到``bert_pretrain`文件夹下
allennlp train scripts/my_text_classifier_bert.jsonnet --serialization-dir checkpoint_bert --include-package my_text_classifier
allennlp evaluate checkpoint_bert/model.tar.gz data/movie_review/test_small.tsv --include-package my_text_classifier
allennlp predict checkpoint_bert/model.tar.gz data/movie_review/test.jsonl --include-package my_text_classifier --predictor sentence_classifier