Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- hu
|
| 4 |
+
pipeline_tag: question-answering
|
| 5 |
+
---
|
| 6 |
+
This model is a fine-tuned version of deepset/xlm-roberta-large-squad2 on the milqa dataset.
|
| 7 |
+
|
| 8 |
+
Packages to install for large roberta model:
|
| 9 |
+
```py
|
| 10 |
+
sentencepiece==0.1.97
|
| 11 |
+
protobuf==3.20.0
|
| 12 |
+
```
|
| 13 |
+
|
| 14 |
+
How to use:
|
| 15 |
+
```py
|
| 16 |
+
from transformers import pipeline
|
| 17 |
+
qa_pipeline = pipeline(
|
| 18 |
+
"question-answering",
|
| 19 |
+
model = "ZTamas/xlm-roberta-large-squad2_impossible_long_answer",
|
| 20 |
+
tokenizer = "ZTamas/xlm-roberta-large-squad2_impossible_long_answer",
|
| 21 |
+
device = 0, #GPU selection, -1 on CPU
|
| 22 |
+
handle_impossible_answer = True,
|
| 23 |
+
max_answer_len = 1000 #This can be modified, but to let the model's
|
| 24 |
+
#answer be as long as it wants so I
|
| 25 |
+
#decided to add a big number
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
predictions = qa_pipeline({
|
| 29 |
+
'context': context,
|
| 30 |
+
'question': question
|
| 31 |
+
})
|
| 32 |
+
|
| 33 |
+
print(predictions)
|
| 34 |
+
|
| 35 |
+
```
|