đ BERT-base-cased for QA
This is a BERT-base-cased model specifically designed for question answering tasks, trained on English text and suitable for extractive question answering.
đ Quick Start
This model is a BERT-base-cased model used for extractive question answering tasks. It is trained on SQuAD v1 data and can be used for question answering in English. For code examples, please refer to example.
⨠Features
- Language Model: bert-base-cased
- Language: English
- Downstream-task: Extractive QA
- Training data: SQuAD v1
- Eval data: SQuAD v1
- Infrastructure: 8x DGX A100
đĻ Installation
No specific installation steps are provided in the original document, so this section is skipped.
đģ Usage Examples
Basic Usage
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
model_name = "batterydata/bert-base-cased-squad-v1"
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)
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
Advanced Usage
No advanced usage examples are provided in the original document, so this part is skipped.
đ Documentation
Hyperparameters
batch_size = 32
n_epochs = 2
base_LM_model = "bert-base-cased"
max_seq_len = 386
learning_rate = 5e-5
doc_stride=128
max_query_length=64
Performance
Evaluated on the SQuAD v1.0 dev set.
"exact": 81.30,
"f1": 88.58,
Evaluated on the battery device dataset.
"precision": 67.02,
"recall": 80.15,
đ§ Technical Details
No specific technical details are provided in the original document, so this section is skipped.
đ License
This project is licensed under the Apache-2.0 license.
đ Information Table
Property |
Details |
Model Type |
bert-base-cased |
Training Data |
SQuAD v1 |
Eval Data |
SQuAD v1 |
Code |
See example |
Infrastructure |
8x DGX A100 |
đĨ Authors
- Shu Huang:
sh2009 [at] cam.ac.uk
- Jacqueline Cole:
jmc61 [at] cam.ac.uk
đ Citation
BatteryBERT: A Pre-trained Language Model for Battery Database Enhancement