Views
No views yet
distilbert-finetuned-squad is a distilled version of BERT that has been fine-tuned on a question-answering dataset. The distillation process makes the model smaller and faster while retaining much of the original model's performance. This fine-tuned variant is specifically adapted for tasks that involve extracting answers from given context passages.1from transformers import pipeline
2
3# Load the fine-tuned model for question answering
4model_checkpoint = "Ashaduzzaman/distilbert-finetuned-squad"
5
6question_answerer = pipeline(
7 "question-answering",
8 model=model_checkpoint,
9)
10
11# Perform question answering on the provided question and context
12question = "What is the capital of France?"
13context = "The capital of France is Paris."
14result = question_answerer(question=question, context=context)
15
16print(result['answer'])transformers library and perform question answering with a sample question and context.