本項目代碼:https://github.com/JackKuo666/AllenNLP_notes/tree/master/4.twitter-pos-tagging-master
任務:
1.twitter-pos-tagging
2.twitter-NER
模型:
CRF+Viterbi
模型實現:https://github.com/JackKuo666/AllenNLP_notes/blob/master/4.twitter-pos-tagging-master/neural_crf.py
模型訓練:
allennlp train ./config/neural_crf_pos.json -s ./model/neural_crf --include-package neural_crf
allennlp evaluate <MODEL_DIR>/model.tar.gz [JSON test data file path] --include-package neural_crf
本項目學習重點:
學會自己實現模型,然後在train或者evaluation的時候調用自己實現的模型:
--include-package neural_crf