这是一个berta-large模型,使用SQuAD2.0数据集进行了细粒度调整,用于问答任务。
语言模型:bert-large 语言:英语 下游任务:抽取式问答 训练数据:SQuAD 2.0 评估数据:SQuAD 2.0 代码:查看 an example QA pipeline on Haystack
Haystack是由deepset开发的自然语言处理框架。您可以在Haystack流水线中使用此模型来批量进行问答(覆盖许多文档)。要在 Haystack 中加载该模型:
reader = FARMReader(model_name_or_path="deepset/bert-large-uncased-whole-word-masking-squad2") # or reader = TransformersReader(model_name_or_path="FILL",tokenizer="deepset/bert-large-uncased-whole-word-masking-squad2")
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline model_name = "deepset/bert-large-uncased-whole-word-masking-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)
deepset 是开源的NLP框架 Haystack 的公司,旨在帮助您构建可用于生产的NLP系统,包括:问答、摘要、排名等。
我们的其他工作包括:
要了解有关Haystack的更多信息,请访问我们的 GitHub 存储库和 Documentation 。
我们还有一个 Discord community open to everyone!
Twitter | LinkedIn | Discord | GitHub Discussions | Website
顺便说一下: we're hiring!