metadata
license: cc-by-nc-4.0
pipeline_tag: question-answering
tags:
- question-answering
- transformers
- generated_from_trainer
datasets:
- squad_v2
- LLukas22/nq-simplified
- LLukas22/NLQuAD
- deepset/germanquad
all-MiniLM-L12-v2-qa-all
This model is an extractive qa model. It's a fine-tuned version of all-MiniLM-L12-v2 on the following datasets: squad_v2, LLukas22/nq-simplified, LLukas22/NLQuAD, deepset/germanquad.
Usage
You can use the model like this:
from transformers import pipeline
#Make predictions
model_name = "LLukas22/all-MiniLM-L12-v2-qa-all"
nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
QA_input = {
"question": "What's my name?",
"context": "My name is Clara and I live in Berkeley."
}
result = nlp(QA_input)
print(result)
Alternatively you can load the model and tokenizer on their own:
from transformers import AutoModelForQuestionAnswering, AutoTokenizer
#Make predictions
model_name = "LLukas22/all-MiniLM-L12-v2-qa-all"
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 2E-05
- per device batch size: 60
- effective batch size: 180
- seed: 42
- optimizer: AdamW with betas (0.9,0.999) and eps 1E-08
- weight decay: 1E-02
- D-Adaptation: False
- Warmup: True
- number of epochs: 15
- mixed_precision_training: bf16
Training results
Epoch | Train Loss | Validation Loss |
---|---|---|
0 | 3.58 | 2.91 |
Evaluation results
Epoch | f1 | exact_match |
---|---|---|
0 | 0.309 | 0.255 |
Framework versions
- Transformers: 4.25.1
- PyTorch: 2.0.0.dev20230210+cu118
- PyTorch Lightning: 1.8.6
- Datasets: 2.7.1
- Tokenizers: 0.13.1
- Sentence Transformers: 2.2.2
Additional Information
This model was trained as part of my Master's Thesis 'Evaluation of transformer based language models for use in service information systems'. The source code is available on Github.