这是 deberta-v3-large 模型,使用 SQuAD2.0 数据集进行微调。它已经针对问答对进行了训练,包括包含无法回答的问题。任务是问答。
语言模型:deberta-v3-large 语言:英语 下游任务:提取型问答 训练数据:SQuAD 2.0 评估数据:SQuAD 2.0 代码:见 an example QA pipeline on Haystack 基础设施:1x NVIDIA A10G
batch_size = 2 grad_acc_steps = 32 n_epochs = 6 base_LM_model = "microsoft/deberta-v3-large" max_seq_len = 512 learning_rate = 7e-6 lr_schedule = LinearWarmup warmup_proportion = 0.2 doc_stride=128 max_query_length=64
Haystack是deepset的一个NLP框架。您可以在Haystack流水线中使用该模型进行大规模的问答(对许多文档进行问答)。要在 Haystack 中加载模型:
reader = FARMReader(model_name_or_path="deepset/deberta-v3-large-squad2") # or reader = TransformersReader(model_name_or_path="deepset/deberta-v3-large-squad2",tokenizer="deepset/deberta-v3-large-squad2")
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline model_name = "deepset/deberta-v3-large-squad2" # 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)
在SQuAD 2.0开发集上使用 official eval script 进行评估。
"exact": 87.6105449338836, "f1": 90.75307008866517, "total": 11873, "HasAns_exact": 84.37921727395411, "HasAns_f1": 90.6732795483674, "HasAns_total": 5928, "NoAns_exact": 90.83263246425568, "NoAns_f1": 90.83263246425568, "NoAns_total": 5945
deepset 是开源NLP框架 Haystack 背后的公司,该框架旨在帮助您构建可用于生产的NLP系统,包括问答、摘要、排名等。
我们的其他工作:
要了解有关Haystack的更多信息,请访问我们的 GitHub 存储库和 Documentation 。
我们还有一个 Discord community open to everyone!
Twitter | LinkedIn | Discord | GitHub Discussions | Website
顺便说一句: we're hiring!