语言模型: deepset/roberta-base-squad2 语言: 英语 下游任务: 抽取式问答 训练数据: SQuAD-style CORD-19 annotations from 23rd April 代码: 参见 an example QA pipeline on Haystack 基础架构: Tesla v100
batch_size = 24 n_epochs = 3 base_LM_model = "deepset/roberta-base-squad2" max_seq_len = 384 learning_rate = 3e-5 lr_schedule = LinearWarmup warmup_proportion = 0.1 doc_stride = 128 xval_folds = 5 dev_split = 0 no_ans_boost = -100
在数据集上进行的5折交叉验证导致以下结果:
单个EM分数: [0.222, 0.123, 0.234, 0.159, 0.158] 单个F1分数: [0.476, 0.493, 0.599, 0.461, 0.465] 单个top\_3\_recall分数: [0.827, 0.776, 0.860, 0.771, 0.777] XVAL EM: 0.17890995260663506 XVAL f1: 0.49925444207319924 XVAL top\_3\_recall: 0.8021327014218009
此模型是交叉验证的第三折的模型。
用于大规模QA(即多个文档而不是单个段落)时,您还可以在 haystack 中加载模型:
reader = FARMReader(model_name_or_path="deepset/roberta-base-squad2-covid") # or reader = TransformersReader(model="deepset/roberta-base-squad2",tokenizer="deepset/roberta-base-squad2-covid")
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline model_name = "deepset/roberta-base-squad2-covid" # a) Get predictions nlp = pipeline('question-answering', model=model_name, tokenizer=model_name) QA_input = { 'question': 'Why is model conversion important?', 'context': 'The option to convert models between FARM and transformers gives freedom to the user and let people easily switch between frameworks.' } res = nlp(QA_input) # b) Load model & tokenizer model = AutoModelForQuestionAnswering.from_pretrained(model_name) tokenizer = AutoTokenizer.from_pretrained(model_name)
Branden Chan: branden.chan@deepset.ai Timo Möller: timo.moeller@deepset.ai Malte Pietsch: malte.pietsch@deepset.ai Tanay Soni: tanay.soni@deepset.ai Bogdan Kostić: bogdan.kostic@deepset.ai
deepset 是开源NLP框架 Haystack 背后的公司,旨在帮助您构建可用于问答、摘要、排名等生产就绪NLP系统。
我们的其他工作包括:
欲了解有关Haystack的更多信息,请访问我们的 GitHub 存储库和 Documentation 。
我们还有一个 Discord community open to everyone!
Twitter | LinkedIn | Discord | GitHub Discussions | Website
顺便说一下: we're hiring!