英文

BatteryOnlyBERT-cased用于问答任务

语言模型:batteryonlybert-cased 语言:英语 下游任务:提取型问答 训练数据:SQuAD v1 评估数据:SQuAD v1 代码:查看 example 基础设施:8x DGX A100

超参数

batch_size = 16
n_epochs = 3
base_LM_model = "batteryonlybert-cased"
max_seq_len = 386
learning_rate = 2e-5
doc_stride=128
max_query_length=64

性能

在SQuAD v1.0开发集上评估。

"exact": 79.61,
"f1": 87.30,

在电池设备数据集上评估。

"precision": 64.28,
"recall": 82.72,

使用方法

在Transformers中

from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline

model_name = "batterydata/batteryonlybert-cased-squad-v1"
# a) Get predictions
nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
QA_input = {
    'question': 'What is the electrolyte?',
    'context': 'The typical non-aqueous electrolyte for commercial Li-ion cells is a solution of LiPF6 in linear and cyclic carbonates.'
}
res = nlp(QA_input)
# b) Load model & tokenizer
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)

作者

Shu Huang:sh2009 [at] cam.ac.uk

Jacqueline Cole:jmc61 [at] cam.ac.uk

引用

BatteryBERT:用于电池数据库增强的预训练语言模型