rajpurkar/squad_v2
Viewer • Updated • 142k • 37k • 251
How to use LLukas22/deberta-v3-base-qa-en with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("question-answering", model="LLukas22/deberta-v3-base-qa-en") # Load model directly
from transformers import AutoTokenizer, AutoModelForQuestionAnswering
tokenizer = AutoTokenizer.from_pretrained("LLukas22/deberta-v3-base-qa-en")
model = AutoModelForQuestionAnswering.from_pretrained("LLukas22/deberta-v3-base-qa-en")This model is an extractive qa model. It's a fine-tuned version of deberta-v3-base on the following datasets: squad_v2, LLukas22/nq-simplified.
You can use the model like this:
from transformers import pipeline
#Make predictions
model_name = "LLukas22/deberta-v3-base-qa-en"
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/deberta-v3-base-qa-en"
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
The following hyperparameters were used during training:
| Epoch | Train Loss | Validation Loss |
|---|---|---|
| 0 | 1.57 | 1.47 |
| 1 | 1.22 | 1.46 |
| 2 | 1.09 | 1.48 |
| 3 | 1.02 | 1.5 |
| Epoch | f1 | exact_match |
|---|---|---|
| 0 | 0.658 | 0.514 |
| 1 | 0.661 | 0.522 |
| 2 | 0.664 | 0.525 |
| 3 | 0.666 | 0.524 |
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.