lewtun's picture
lewtun HF staff
Add evaluation results on the squad_v2 config and validation split of squad_v2
48ec152
|
raw
history blame
1.57 kB
metadata
datasets:
  - squad_v2
language: en
license: mit
pipeline_tag: question-answering
tags:
  - roberta
  - question-answering
model-index:
  - name: navteca/roberta-large-squad2
    results:
      - task:
          type: question-answering
          name: Question Answering
        dataset:
          name: squad_v2
          type: squad_v2
          config: squad_v2
          split: validation
        metrics:
          - name: Exact Match
            type: exact_match
            value: 85.2545
            verified: true
          - name: F1
            type: f1
            value: 88.4396
            verified: true

Roberta large model for QA (SQuAD 2.0)

This model uses roberta-large.

Training Data

The models have been trained on the SQuAD 2.0 dataset.

It can be used for question answering task.

Usage and Performance

The trained model can be used like this:

from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline

# Load model & tokenizer
roberta_model = AutoModelForQuestionAnswering.from_pretrained('navteca/roberta-large-squad2')
roberta_tokenizer = AutoTokenizer.from_pretrained('navteca/roberta-large-squad2')

# Get predictions
nlp = pipeline('question-answering', model=roberta_model, tokenizer=roberta_tokenizer)

result = nlp({
    'question': 'How many people live in Berlin?',
    'context': 'Berlin had a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers.'
})

print(result)

#{
#  "answer": "3,520,031"
#  "end": 36,
#  "score": 0.96186668,
#  "start": 27,
#}