Update README.md
Browse files
README.md
CHANGED
@@ -60,4 +60,27 @@ pipeline_tag: question-answering
|
|
60 |
---
|
61 |
|
62 |
|
63 |
-
This model is a fine-tuned version of [mcsabai/huBert-fine-tuned-hungarian-squadv2](https://huggingface.co/mcsabai/huBert-fine-tuned-hungarian-squadv2) on the milqa dataset.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
---
|
61 |
|
62 |
|
63 |
+
This model is a fine-tuned version of [mcsabai/huBert-fine-tuned-hungarian-squadv2](https://huggingface.co/mcsabai/huBert-fine-tuned-hungarian-squadv2) on the milqa dataset.
|
64 |
+
|
65 |
+
How to use:
|
66 |
+
```py
|
67 |
+
from transformers import pipeline
|
68 |
+
qa_pipeline = pipeline(
|
69 |
+
"question-answering",
|
70 |
+
model = "ZTamas/hubert-qa-milqa-impossible",
|
71 |
+
tokenizer = "ZTamas/hubert-qa-milqa-impossible",
|
72 |
+
device = 0, #GPU selection, -1 on CPU
|
73 |
+
handle_impossible_answer = True,
|
74 |
+
max_answer_len = 50 #This can be modified, but to let the model's
|
75 |
+
#answer be as long as it wants so I
|
76 |
+
#decided to add a big number
|
77 |
+
)
|
78 |
+
|
79 |
+
predictions = qa_pipeline({
|
80 |
+
'context': context,
|
81 |
+
'question': question
|
82 |
+
})
|
83 |
+
|
84 |
+
print(predictions)
|
85 |
+
|
86 |
+
```
|