模型:
deepset/xlm-roberta-base-squad2-distilled
语言模型:deepset/xlm-roberta-base-squad2-distilled 语言:多语种 下游任务:抽取型问答 训练数据:SQuAD 2.0 评估数据:SQuAD 2.0 代码:请参见 an example QA pipeline on Haystack 基础设施:1x Tesla v100
batch_size = 56 n_epochs = 4 max_seq_len = 384 learning_rate = 3e-5 lr_schedule = LinearWarmup embeds_dropout_prob = 0.1 temperature = 3 distillation_loss_weight = 0.75
Haystack是一个由deepset开发的NLP框架。您可以在Haystack流程中使用此模型,在许多文档上进行大规模的问答。将模型加载到 Haystack 中:
reader = FARMReader(model_name_or_path="deepset/xlm-roberta-base-squad2-distilled") # or reader = TransformersReader(model_name_or_path="deepset/xlm-roberta-base-squad2-distilled",tokenizer="deepset/xlm-roberta-base-squad2-distilled")
有关deepset/xlm-roberta-base-squad2-distilled用于[问答]的完整示例,请查看 Tutorials in Haystack Documentation
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline model_name = "deepset/xlm-roberta-base-squad2-distilled" # 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开发集上进行评估
"exact": 74.06721131980123% "f1": 76.39919553344667%
Timo Möller: timo.moeller@deepset.ai Julian Risch: julian.risch@deepset.ai Malte Pietsch: malte.pietsch@deepset.ai Michel Bartels: michel.bartels@deepset.ai
deepset 是开源NLP框架 Haystack 背后的公司,旨在帮助您构建使用问题回答、摘要、排名等的生产就绪的NLP系统。
我们的其他工作:
欲了解有关Haystack的更多信息,请访问我们的 GitHub 存储库和 Documentation 。
我们还有一个 Discord community open to everyone!
Twitter | LinkedIn | Discord | GitHub Discussions | Website
顺便说一句: we're hiring!