rajpurkar/squad
Viewer • Updated • 98.2k • 157k • 365
How to use tmt3103/SQuAD_BERT with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("question-answering", model="tmt3103/SQuAD_BERT") # Load model directly
from transformers import AutoTokenizer, AutoModelForQuestionAnswering
tokenizer = AutoTokenizer.from_pretrained("tmt3103/SQuAD_BERT")
model = AutoModelForQuestionAnswering.from_pretrained("tmt3103/SQuAD_BERT")A BERT-based model fine-tuned on SQuAD v1.1 for extractive QA
This model is based on bert-base-uncased and was fine-tuned on the SQuAD v1.1 dataset for extractive question answering. It takes a question and a context passage as input and predicts the span of text in the passage that most likely answers the question.
The model was trained using the Hugging Face 🤗 Transformers library.
The model was evaluated on the SQuAD v1.1 development set using the standard metrics: Exact Match (EM) and F1.
| Metric | Score |
|---|---|
| Exact Match | 82.7 |
| F1 | 87.0039 |
You can load this model using the pipeline API:
from transformers import pipeline
qa_pipeline = pipeline("question-answering", model="tmt3103/SQuAD_BERT")
result = qa_pipeline({
"context": "Hugging Face is creating a tool that democratizes AI.",
"question": "What is Hugging Face creating?"
})
print(result)