BERT Sequence Labeling
1.0.0
此重新播放將HuggingFaces的模型集成到端到端的管道中,以進行序列標籤。這是可用型號的完整列表。
如果您發現此存儲庫有幫助,請給它一顆星。
git clone https://github.com/avramandrei/BERT-Sequence-Labeling.git
cd BERT-Sequence-Labeling
pip3 install -r requirements.txt
用於培訓,驗證和測試的文件必須採用類似於CONLL的格式:
# sent_id = email-enronsent20_01-0048
# text = Please let us know if you have additional questions.
1 Please please INTJ UH _ 2 discourse 2:discourse _
2 let let VERB VB Mood=Imp|VerbForm=Fin 0 root 0:root _
3 us we PRON PRP Case=Acc|Number=Plur|Person=1|PronType=Prs 2 obj 2:obj|4:nsubj:xsubj _
4 know know VERB VB VerbForm=Inf 2 xcomp 2:xcomp _
5 if if SCONJ IN _ 7 mark 7:mark _
6 you you PRON PRP Case=Nom|Person=2|PronType=Prs 7 nsubj 7:nsubj _
7 have have VERB VBP Mood=Ind|Tense=Pres|VerbForm=Fin 4 advcl 4:advcl:if _
8 additional additional ADJ JJ Degree=Pos 9 amod 9:amod _
9 questions question NOUN NNS Number=Plur 7 obj 7:obj SpaceAfter=No
10 . . PUNCT . _ 2 punct 2:punct _
要訓練模型,請使用train.py腳本。這將開始訓練一個模型,該模型將預測[predict_column]參數指定的列的標籤。
python3 train.py [path_train_file] [path_dev_file] [tokens_column] [predict_column] [lang_model_name]
要預測新值,請使用predict.py腳本。這將通過用預測值替換測試文件的預測列來創建一個新文件。
python3 predict.py [path_test_file] [model_path] [tokens_column] [predict_column] [lang_model_name]
| 模型 | UPOS | XPO |
|---|---|---|
| Bert-base cased | 95.92 | 95.27 |
| 羅伯塔基地 | 95.77 | 95.18 |
請考慮以下論文表示感謝作者:
@article{avram2020upb,
title={UPB at SemEval-2020 Task 6: Pretrained Language Models for Definition Extraction},
author={Avram, Andrei-Marius and Cercel, Dumitru-Clementin and Chiru, Costin-Gabriel},
journal={arXiv e-prints},
pages={arXiv--2009},
year={2020}
}