🚀 JAlexis/PruebaBert问答模型
本项目基于deepset/bert-base-cased-squad2
模型在Cord19数据集上微调得到一个问答模型,可用于回答关于COVID - 19等相关问题,为疫情防护等信息查询提供支持。
🚀 快速开始
模型描述
该模型是通过在Cord19数据集上对deepset/bert-base-cased-squad2
进行微调得到的。
使用示例
基础用法
from transformers.pipelines import pipeline
model_name = "JAlexis/PruebaBert"
nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
inputs = {
'question': 'How can I protect myself against covid-19?',
'context': 'Preventative measures consist of recommendations to wear a mask in public, maintain social distancing of at least six feet, wash hands regularly, and use hand sanitizer. To facilitate this aim, we adapt the conceptual model and measures of Liao et al. [6] to the current context of the COVID-19 pandemic and the culture of the USA. Applying this model in a different time and context provides an opportunity to make comparisons of reactions to information sources across a decade of evolving attitudes toward media and government, between two cultures (Hong Kong vs. the USA), and between two considerably different global pandemics (H1N1 vs. COVID-19). ',
'question': 'How can I protect myself against covid-19?',
'context': ' ',
}
nlp(inputs)
模型概况
属性 |
详情 |
语言模型 |
deepset/bert-base-cased-squad2 |
语言 |
英文 |
下游任务 |
问答 |
数据集 |
2022年1月31日的CORD - 19 |
代码 |
Haystack和FARM |
基础设施 |
Tesla T4 |
超参数设置
batch_size = 8
n_epochs = 7
max_seq_len = max_length
learning_rate = AdamW: 2e-5
标签与数据集
- 标签:pytorch、question - answering
- 数据集:squad2、cord19
- 评估指标:f1
模型测试示例
模型提供了以下测试示例:
- 问题:"How can I protect myself against covid-19?"
- 上下文:
- "Preventative measures consist of recommendations to wear a mask in public, maintain social distancing of at least six feet, wash hands regularly, and use hand sanitizer. To facilitate this aim, we adapt the conceptual model and measures of Liao et al. [6] to the current context of the COVID-19 pandemic and the culture of the USA. Applying this model in a different time and context provides an opportunity to make comparisons of reactions to information sources across a decade of evolving attitudes toward media and government, between two cultures (Hong Kong vs. the USA), and between two considerably different global pandemics (H1N1 vs. COVID-19)."
- " "