question-answering bert

MODEL DESCRIPTION

huBERT base model (cased) fine-tuned on SQuADv2 (NEW!)

<p> <i> "SQuAD2.0 combines the 100,000 questions in SQuAD1.1 with over 50,000 unanswerable questions written adversarially by crowdworkers to look similar to answerable ones. To do well on SQuAD2.0, systems must not only answer questions when possible, but also determine when no answer is supported by the paragraph and abstain from answering.[1]" </i> </p>

Model in action

from transformers import pipeline
qa_pipeline = pipeline(
    "question-answering",
    model="mcsabai/huBert-fine-tuned-hungarian-squadv2",
    tokenizer="mcsabai/huBert-fine-tuned-hungarian-squadv2",
    topk = 1,
    handle_impossible_answer = True
)
predictions = qa_pipeline({
    'context': "Máté vagyok és Budapesten élek már több mint 4 éve.",
    'question': "Hol lakik Máté?"
})
print(predictions)
# output:
# {'score': 0.9892364144325256, 'start': 16, 'end': 26, 'answer': 'Budapesten'}

Two important parameter:

[1] https://rajpurkar.github.io/SQuAD-explorer/