基于百度webqa与dureader数据集训练的Albert Large QA模型
整理后形成类似squad数据集的形式,包含训练数据705139条,验证数据69638条。基于google提供的albert chinese large模型进行finetune。最终f1约0.7
from transformers import AutoModelForQuestionAnswering, BertTokenizer
model = AutoModelForQuestionAnswering.from_pretrained('./model/albert-chinese-large-qa')
tokenizer = BertTokenizer.from_pretrained('./model/albert-chinese-large-qa')
# or use transformers repo
model = AutoModelForQuestionAnswering.from_pretrained('wptoux/albert-chinese-large-qa')
tokenizer = BertTokenizer.from_pretrained('wptoux/albert-chinese-large-qa')
transformers实现的SquadExample类缺乏对中文的支持,导致其推理结果会存在问题,所以Metric中的F1和Exact会比真实结果低。但是这个不会影响到训练。