Downloads · 30 days
31
0% of all-time downloads
navteca/electra-base-squad2
electra-base-squad2 is a question answering model from navteca. Use it when the input is a question plus a passage. It is set up for transformers. The card lists the license as mit.
Downloads · 30 days
31
0% of all-time downloads
All-time downloads
23.1K
Public
Repo size
871 MB
Likes
0
Public
Click a slice to open those files.
.bin436 MB · 100%
From the Hugging Face model README
This model uses electra-base.
The models have been trained on the SQuAD 2.0 dataset.
It can be used for question answering task.
The trained model can be used like this:
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
# Load model & tokenizer
electra_model = AutoModelForQuestionAnswering.from_pretrained('navteca/electra-base-squad2')
electra_tokenizer = AutoTokenizer.from_pretrained('navteca/electra-base-squad2')
# Get predictions
nlp = pipeline('question-answering', model=electra_model, tokenizer=electra_tokenizer)
result = nlp({
'question': 'How many people live in Berlin?',
'context': 'Berlin had a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers.'
})
print(result)
#{
# "answer": "3,520,031"
# "end": 36,
# "score": 0.99983448,
# "start": 27,
#}