Commit
路
7a2866c
1
Parent(s):
a620af2
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
datasets:
|
| 3 |
- squad_v2
|
| 4 |
license: cc-by-4.0
|
|
@@ -57,7 +58,7 @@ model_name = "deepset/electra-base-squad2"
|
|
| 57 |
nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
|
| 58 |
QA_input = {
|
| 59 |
'question': 'Why is model conversion important?',
|
| 60 |
-
'context': 'The option to convert models between FARM and transformers gives freedom to the user and
|
| 61 |
}
|
| 62 |
res = nlp(QA_input)
|
| 63 |
|
|
@@ -78,7 +79,7 @@ model_name = "deepset/electra-base-squad2"
|
|
| 78 |
# a) Get predictions
|
| 79 |
nlp = Inferencer.load(model_name, task_type="question_answering")
|
| 80 |
QA_input = [{"questions": ["Why is model conversion important?"],
|
| 81 |
-
"text": "The option to convert models between FARM and transformers gives freedom to the user and
|
| 82 |
res = nlp.inference_from_dicts(dicts=QA_input)
|
| 83 |
|
| 84 |
# b) Load model & tokenizer
|
|
@@ -87,7 +88,7 @@ tokenizer = Tokenizer.load(model_name)
|
|
| 87 |
```
|
| 88 |
|
| 89 |
### In haystack
|
| 90 |
-
For doing QA at scale (i.e. many docs instead of single paragraph), you can load the model also in [haystack](https://github.com/deepset-ai/haystack/):
|
| 91 |
```python
|
| 92 |
reader = FARMReader(model_name_or_path="deepset/electra-base-squad2")
|
| 93 |
# or
|
|
|
|
| 1 |
---
|
| 2 |
+
language: en
|
| 3 |
datasets:
|
| 4 |
- squad_v2
|
| 5 |
license: cc-by-4.0
|
|
|
|
| 58 |
nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
|
| 59 |
QA_input = {
|
| 60 |
'question': 'Why is model conversion important?',
|
| 61 |
+
'context': 'The option to convert models between FARM and transformers gives freedom to the user and lets people easily switch between frameworks.'
|
| 62 |
}
|
| 63 |
res = nlp(QA_input)
|
| 64 |
|
|
|
|
| 79 |
# a) Get predictions
|
| 80 |
nlp = Inferencer.load(model_name, task_type="question_answering")
|
| 81 |
QA_input = [{"questions": ["Why is model conversion important?"],
|
| 82 |
+
"text": "The option to convert models between FARM and transformers gives freedom to the user and lets people easily switch between frameworks."}]
|
| 83 |
res = nlp.inference_from_dicts(dicts=QA_input)
|
| 84 |
|
| 85 |
# b) Load model & tokenizer
|
|
|
|
| 88 |
```
|
| 89 |
|
| 90 |
### In haystack
|
| 91 |
+
For doing QA at scale (i.e. many docs instead of a single paragraph), you can load the model also in [haystack](https://github.com/deepset-ai/haystack/):
|
| 92 |
```python
|
| 93 |
reader = FARMReader(model_name_or_path="deepset/electra-base-squad2")
|
| 94 |
# or
|