File size: 764 Bytes
09e34af
 
 
 
 
5106c2f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
language:
- hu
pipeline_tag: question-answering
---
This model is a fine-tuned version of deepset/xlm-roberta-large-squad2 on the milqa dataset.

Packages to install for large roberta model:
```py
sentencepiece==0.1.97
protobuf==3.20.0
```

How to use:
```py
from transformers import pipeline
qa_pipeline = pipeline(
  "question-answering",
  model = "ZTamas/xlm-roberta-large-squad2-qa-milqa-impossible",
  tokenizer = "ZTamas/xlm-roberta-large-squad2-qa-milqa-impossible",
  device = 0,                      #GPU selection, -1 on CPU
  handle_impossible_answer = True,
  max_answer_len = 50              #This can be modified
  )

predictions = qa_pipeline({
    'context': context,            
    'question': question           
})

print(predictions)

```