Views
No views yet
30k samples from the Stanford Question Answering Dataset. {
"data":[
{
"title":"Article Title",
"paragraphs":[
{
"context":"The context text of the paragraph",
"qas":[
{
"question":"The question asked about the context",
"id":"A unique identifier for the question",
"answers":[
{
"text":"The answer to the question",
"answer_start":"The starting index of the answer in the context"
}
]
}
]
}
]
}
],
"version":"The version of the SQuAD dataset"
}1from transformers import AutoTokenizer, AutoModelForQuestionAnswering
2
3QAtokenizer = AutoTokenizer.from_pretrained("SRDdev/QABERT-small")
4
5QAmodel = AutoModelForQuestionAnswering.from_pretrained("SRDdev/QABERT-small")1Extractive Question Answering is the task of extracting an answer from a text given a question. An example of a
2question-answering dataset is the SQuAD dataset, which is entirely based on that task. If you would like to fine-tune
3a model on a SQuAD task, you may leverage the examples/pytorch/question-answering/run_squad.py script.1from transformers import pipeline
2
3ask = pipeline("question-answering", model= QAmodel , tokenizer = QAtokenizer)
4
5result = ask(question="What is a good example of a question answering dataset?", context=context)
6
7print(f"Answer: '{result['answer']}'")@citation{ QA-BERT-small,
author = {Shreyas Dixit},
year = {2023},
url = {https://huggingface.co/SRDdev/QA-BERT-small}
}