BERT Sequence Labeling
1.0.0
Repostiory นี้รวมโมเดลของ HuggingFaces ในไปป์ไลน์แบบ end-to-end สำหรับการติดฉลากลำดับ นี่คือรายการที่สมบูรณ์ของรุ่นที่มีอยู่
หากคุณพบว่าพื้นที่เก็บข้อมูลนี้มีประโยชน์โปรดให้ดาว: BLUSH:
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 | XPOS |
|---|---|---|
| เบิร์ตเบส | 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}
}