Downloads · 30 days
19
4% of all-time downloads
AdamCodd/distilroberta-squad2
distilroberta-squad2 is a question answering model from AdamCodd. Use it when the input is a question plus a passage. It is set up for transformers.
This model is Distilroberta base which was fine-tuned for context-based question answering on the SQuAD v2 dataset, a dataset of English-language context-question-answer triples designed for extractive question answer…
Downloads · 30 days
19
4% of all-time downloads
All-time downloads
433
Public
Repo size
1.6 GB
Likes
1
Public
Click a slice to open those files.
.onnx326 MB · 33%
From the Hugging Face model README
This model is Distilroberta base which was fine-tuned for context-based question answering on the SQuAD v2 dataset, a dataset of English-language context-question-answer triples designed for extractive question answering training and benchmarking. Version 2 of SQuAD (Stanford Question Answering Dataset) contains the 100,000 examples from SQuAD Version 1.1, along with 50,000 additional "unanswerable" questions, i.e. questions whose answer cannot be found in the provided context.
This fine-tuned model prioritizes inference speed; DistilRoBERTa operates at a pace twice as fast as the RoBERTa-base model, with only a marginal compromise in quality.
from transformers import pipeline
QA_pipeline = pipeline("question-answering", model="AdamCodd/distilroberta-squad2", handle_impossible_answer=True)
input = {
'question': "Which name is also used to describe the Amazon rainforest in English?",
'context': '''The Amazon rainforest (Portuguese: Floresta Amazônica or Amazônia; Spanish: Selva Amazónica, Amazonía or usually Amazonia; French: Forêt amazonienne; Dutch: Amazoneregenwoud), also known in English as Amazonia or the Amazon Jungle, is a moist broadleaf forest that covers most of the Amazon basin of South America. This basin encompasses 7,000,000 square kilometres (2,700,000 sq mi), of which 5,500,000 square kilometres (2,100,000 sq mi) are covered by the rainforest. This region includes territory belonging to nine nations. The majority of the forest is contained within Brazil, with 60% of the rainforest, followed by Peru with 13%, Colombia with 10%, and with minor amounts in Venezuela, Ecuador, Bolivia, Guyana, Suriname and French Guiana. States or departments in four nations contain "Amazonas" in their names. The Amazon represents over half of the planet's remaining rainforests, and comprises the largest and most biodiverse tract of tropical rainforest in the world, with an estimated 390 billion individual trees divided into 16,000 species.'''
}
response = QA_pipeline(**input)
print(response)
More information needed
The following hyperparameters were used during training:
Evaluated on the SQuAD 2.0 dev set with the official eval script.
Results:
'exact': 72.9470226564474,
'f1': 76.03522762032603,
'total': 11873,
'HasAns_exact': 72.4527665317139,
'HasAns_f1': 78.63803264779528,
'HasAns_total': 5928,
'NoAns_exact': 73.43986543313709,
'NoAns_f1': 73.43986543313709,
'NoAns_total': 5945,
'best_exact': 72.95544512760044,
'best_exact_thresh': 0.0,
'best_f1': 76.04365009147917,
'best_f1_thresh': 0.0
If you want to support me, you can here.