Updating the model card (#1)
- Updating the model card (9c83ec53678e2b05338970246c0aebcc820c0399) Co-authored-by: Tuana Celik <Tuana@users.noreply.huggingface.co>
This commit is contained in:
parent
b3506f363a
commit
b2cff61335
76
README.md
76
README.md
|
@ -1,4 +1,7 @@
|
||||||
---
|
---
|
||||||
|
language: en
|
||||||
|
datasets:
|
||||||
|
- squad_v2
|
||||||
license: cc-by-4.0
|
license: cc-by-4.0
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -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,52 +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">
|
||||||
We bring NLP to the industry via open source!
|
<div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
|
||||||
Our focus: Industry specific language models & large scale QA systems.
|
<img alt="" src="https://huggingface.co/spaces/deepset/README/resolve/main/haystack-logo-colored.svg" class="w-40"/>
|
||||||
|
</div>
|
||||||
Some of our work:
|
<div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
|
||||||
|
<img alt="" src="https://huggingface.co/spaces/deepset/README/resolve/main/deepset-logo-colored.svg" class="w-40"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
[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.
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
<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://haystack.deepset.ai">Documentation</a></strong>.
|
||||||
|
|
||||||
|
We also have a <strong><a class="h-7" href="https://haystack.deepset.ai/community/join"><img alt="slack" class="h-7 inline-block m-0" style="margin: 0" src="https://huggingface.co/spaces/deepset/README/resolve/main/Slack_RGB.png"/>community open to everyone!</a></strong></p>
|
||||||
|
|
||||||
[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)
|
[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!](http://www.deepset.ai/jobs)
|
By the way: [we're hiring!](http://www.deepset.ai/jobs)
|
||||||
|
|
Loading…
Reference in New Issue