Compare commits
10 Commits
1f7b27bba7
...
fe1c8bf719
Author | SHA1 | Date |
---|---|---|
|
fe1c8bf719 | |
|
781b291412 | |
|
06d3b5d05f | |
|
a01ea93654 | |
|
b2cff61335 | |
|
b3506f363a | |
|
3c63547b34 | |
|
e8b9098e7e | |
|
905c02aef2 | |
|
3fb85a83e9 |
|
@ -6,3 +6,4 @@
|
||||||
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|
79
README.md
79
README.md
|
@ -1,4 +1,7 @@
|
||||||
---
|
---
|
||||||
|
language: en
|
||||||
|
datasets:
|
||||||
|
- squad_v2
|
||||||
license: cc-by-4.0
|
license: cc-by-4.0
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -9,7 +12,7 @@ license: cc-by-4.0
|
||||||
**Language:** English
|
**Language:** English
|
||||||
**Downstream-task:** Extractive QA
|
**Downstream-task:** Extractive QA
|
||||||
**Training data:** [SQuAD-style CORD-19 annotations from 23rd April](https://github.com/deepset-ai/COVID-QA/blob/master/data/question-answering/200423_covidQA.json)
|
**Training data:** [SQuAD-style CORD-19 annotations from 23rd April](https://github.com/deepset-ai/COVID-QA/blob/master/data/question-answering/200423_covidQA.json)
|
||||||
**Code:** See [example](https://github.com/deepset-ai/FARM/blob/master/examples/question_answering_crossvalidation.py) in [FARM](https://github.com/deepset-ai/FARM)
|
**Code:** See [an example QA pipeline on Haystack](https://haystack.deepset.ai/tutorials/01_basic_qa_pipeline)
|
||||||
**Infrastructure**: Tesla v100
|
**Infrastructure**: Tesla v100
|
||||||
|
|
||||||
## Hyperparameters
|
## Hyperparameters
|
||||||
|
@ -44,6 +47,14 @@ This model is the model obtained from the **third** fold of the cross-validation
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
### In Haystack
|
||||||
|
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/):
|
||||||
|
```python
|
||||||
|
reader = FARMReader(model_name_or_path="deepset/roberta-base-squad2-covid")
|
||||||
|
# or
|
||||||
|
reader = TransformersReader(model="deepset/roberta-base-squad2",tokenizer="deepset/roberta-base-squad2-covid")
|
||||||
|
```
|
||||||
|
|
||||||
### In Transformers
|
### In Transformers
|
||||||
```python
|
```python
|
||||||
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
|
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
|
||||||
|
@ -64,53 +75,37 @@ model = AutoModelForQuestionAnswering.from_pretrained(model_name)
|
||||||
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
||||||
```
|
```
|
||||||
|
|
||||||
### In FARM
|
|
||||||
```python
|
|
||||||
from farm.modeling.adaptive_model import AdaptiveModel
|
|
||||||
from farm.modeling.tokenization import Tokenizer
|
|
||||||
from farm.infer import Inferencer
|
|
||||||
|
|
||||||
model_name = "deepset/roberta-base-squad2-covid"
|
|
||||||
|
|
||||||
# a) Get predictions
|
|
||||||
nlp = Inferencer.load(model_name, task_type="question_answering")
|
|
||||||
QA_input = [{"questions": ["Why is model conversion important?"],
|
|
||||||
"text": "The option to convert models between FARM and transformers gives freedom to the user and let people easily switch between frameworks."}]
|
|
||||||
res = nlp.inference_from_dicts(dicts=QA_input, rest_api_schema=True)
|
|
||||||
|
|
||||||
# b) Load model & tokenizer
|
|
||||||
model = AdaptiveModel.convert_from_transformers(model_name, device="cpu", task_type="question_answering")
|
|
||||||
tokenizer = Tokenizer.load(model_name)
|
|
||||||
```
|
|
||||||
|
|
||||||
### In haystack
|
|
||||||
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/):
|
|
||||||
```python
|
|
||||||
reader = FARMReader(model_name_or_path="deepset/roberta-base-squad2-covid")
|
|
||||||
# or
|
|
||||||
reader = TransformersReader(model="deepset/roberta-base-squad2",tokenizer="deepset/roberta-base-squad2-covid")
|
|
||||||
```
|
|
||||||
|
|
||||||
## Authors
|
## Authors
|
||||||
Branden Chan: `branden.chan [at] deepset.ai`
|
**Branden Chan:** branden.chan@deepset.ai
|
||||||
Timo Möller: `timo.moeller [at] deepset.ai`
|
**Timo Möller:** timo.moeller@deepset.ai
|
||||||
Malte Pietsch: `malte.pietsch [at] deepset.ai`
|
**Malte Pietsch:** malte.pietsch@deepset.ai
|
||||||
Tanay Soni: `tanay.soni [at] deepset.ai`
|
**Tanay Soni:** tanay.soni@deepset.ai
|
||||||
Bogdan Kostić: `bogdan.kostic [at] deepset.ai`
|
**Bogdan Kostić:** bogdan.kostic@deepset.ai
|
||||||
|
|
||||||
## About us
|
## About us
|
||||||

|
<div class="grid lg:grid-cols-2 gap-x-4 gap-y-3">
|
||||||
|
<div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
|
||||||
|
<img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/deepset-logo-colored.png" class="w-40"/>
|
||||||
|
</div>
|
||||||
|
<div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
|
||||||
|
<img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/haystack-logo-colored.png" class="w-40"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
We bring NLP to the industry via open source!
|
[deepset](http://deepset.ai/) is the company behind the open-source NLP framework [Haystack](https://haystack.deepset.ai/) which is designed to help you build production ready NLP systems that use: Question answering, summarization, ranking etc.
|
||||||
Our focus: Industry specific language models & large scale QA systems.
|
|
||||||
|
|
||||||
Some of our work:
|
|
||||||
|
Some of our other work:
|
||||||
|
- [Distilled roberta-base-squad2 (aka "tinyroberta-squad2")]([https://huggingface.co/deepset/tinyroberta-squad2)
|
||||||
- [German BERT (aka "bert-base-german-cased")](https://deepset.ai/german-bert)
|
- [German BERT (aka "bert-base-german-cased")](https://deepset.ai/german-bert)
|
||||||
- [GermanQuAD and GermanDPR datasets and models (aka "gelectra-base-germanquad", "gbert-base-germandpr")](https://deepset.ai/germanquad)
|
- [GermanQuAD and GermanDPR datasets and models (aka "gelectra-base-germanquad", "gbert-base-germandpr")](https://deepset.ai/germanquad)
|
||||||
- [FARM](https://github.com/deepset-ai/FARM)
|
|
||||||
- [Haystack](https://github.com/deepset-ai/haystack/)
|
|
||||||
|
|
||||||
Get in touch:
|
## Get in touch and join the Haystack community
|
||||||
[Twitter](https://twitter.com/deepset_ai) | [LinkedIn](https://www.linkedin.com/company/deepset-ai/) | [Slack](https://haystack.deepset.ai/community/join) | [GitHub Discussions](https://github.com/deepset-ai/haystack/discussions) | [Website](https://deepset.ai)
|
|
||||||
|
|
||||||
By the way: [we're hiring!](https://apply.workable.com/deepset/)
|
<p>For more info on Haystack, visit our <strong><a href="https://github.com/deepset-ai/haystack">GitHub</a></strong> repo and <strong><a href="https://docs.haystack.deepset.ai">Documentation</a></strong>.
|
||||||
|
|
||||||
|
We also have a <strong><a class="h-7" href="https://haystack.deepset.ai/community/join">Discord community open to everyone!</a></strong></p>
|
||||||
|
|
||||||
|
[Twitter](https://twitter.com/deepset_ai) | [LinkedIn](https://www.linkedin.com/company/deepset-ai/) | [Discord](https://haystack.deepset.ai/community) | [GitHub Discussions](https://github.com/deepset-ai/haystack/discussions) | [Website](https://deepset.ai)
|
||||||
|
|
||||||
|
By the way: [we're hiring!](http://www.deepset.ai/jobs)
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue