MODEL DESCRIPTION

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

"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]"

Model in action

  • Fast usage with pipelines:
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:

  • topk (int, optional, defaults to 1) — The number of answers to return (will be chosen by order of likelihood). Note that we return less than topk answers if there are not enough options available within the context.

  • handle_impossible_answer (bool, optional, defaults to False): Whether or not we accept impossible as an answer.

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

Downloads last month
238
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.