julianrisch commited on
Commit
bd56cd0
1 Parent(s): 2acbc99

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +30 -15
README.md CHANGED
@@ -5,14 +5,14 @@ datasets:
5
  license: cc-by-4.0
6
  ---
7
 
8
- # roberta-base-squad2 for QA on COVID-19
9
 
10
  ## Overview
11
  **Language model:** deepset/roberta-base-squad2
12
  **Language:** English
13
  **Downstream-task:** Extractive QA
14
  **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)
15
- **Code:** See [an example QA pipeline on Haystack](https://haystack.deepset.ai/tutorials/01_basic_qa_pipeline)
16
  **Infrastructure**: Tesla v100
17
 
18
  ## Hyperparameters
@@ -48,19 +48,33 @@ This model is the model obtained from the **third** fold of the cross-validation
48
  ## Usage
49
 
50
  ### In Haystack
51
- 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/):
 
52
  ```python
53
- reader = FARMReader(model_name_or_path="deepset/roberta-base-squad2-covid")
54
- # or
55
- reader = TransformersReader(model="deepset/roberta-base-squad2",tokenizer="deepset/roberta-base-squad2-covid")
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  ```
 
57
 
58
  ### In Transformers
59
  ```python
60
  from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
61
 
62
-
63
- model_name = "deepset/roberta-base-squad2-covid"
64
 
65
  # a) Get predictions
66
  nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
@@ -75,6 +89,7 @@ model = AutoModelForQuestionAnswering.from_pretrained(model_name)
75
  tokenizer = AutoTokenizer.from_pretrained(model_name)
76
  ```
77
 
 
78
  ## Authors
79
  **Branden Chan:** branden.chan@deepset.ai
80
  **Timo Möller:** timo.moeller@deepset.ai
@@ -83,6 +98,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
83
  **Bogdan Kostić:** bogdan.kostic@deepset.ai
84
 
85
  ## About us
 
86
  <div class="grid lg:grid-cols-2 gap-x-4 gap-y-3">
87
  <div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
88
  <img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/deepset-logo-colored.png" class="w-40"/>
@@ -92,20 +108,19 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
92
  </div>
93
  </div>
94
 
95
- [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.
96
-
97
 
98
  Some of our other work:
99
- - [Distilled roberta-base-squad2 (aka "tinyroberta-squad2")]([https://huggingface.co/deepset/tinyroberta-squad2)
100
- - [German BERT (aka "bert-base-german-cased")](https://deepset.ai/german-bert)
101
- - [GermanQuAD and GermanDPR datasets and models (aka "gelectra-base-germanquad", "gbert-base-germandpr")](https://deepset.ai/germanquad)
102
 
103
  ## Get in touch and join the Haystack community
104
 
105
  <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>.
106
 
107
- We also have a <strong><a class="h-7" href="https://haystack.deepset.ai/community/join">Discord community open to everyone!</a></strong></p>
108
 
109
- [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)
110
 
111
  By the way: [we're hiring!](http://www.deepset.ai/jobs)
 
5
  license: cc-by-4.0
6
  ---
7
 
8
+ # roberta-base-squad2 for Extractive QA on COVID-19
9
 
10
  ## Overview
11
  **Language model:** deepset/roberta-base-squad2
12
  **Language:** English
13
  **Downstream-task:** Extractive QA
14
  **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)
15
+ **Code:** See [an example extractive QA pipeline built with Haystack](https://haystack.deepset.ai/tutorials/34_extractive_qa_pipeline)
16
  **Infrastructure**: Tesla v100
17
 
18
  ## Hyperparameters
 
48
  ## Usage
49
 
50
  ### In Haystack
51
+ Haystack is an AI orchestration framework to build customizable, production-ready LLM applications. You can use this model in Haystack to do extractive question answering on documents.
52
+ To load and run the model with [Haystack](https://github.com/deepset-ai/haystack/):
53
  ```python
54
+ # After running pip install haystack-ai "transformers[torch,sentencepiece]"
55
+
56
+ from haystack import Document
57
+ from haystack.components.readers import ExtractiveReader
58
+
59
+ docs = [
60
+ Document(content="Python is a popular programming language"),
61
+ Document(content="python ist eine beliebte Programmiersprache"),
62
+ ]
63
+
64
+ reader = ExtractiveReader(model="deepset/roberta-base-squad2")
65
+ reader.warm_up()
66
+
67
+ question = "What is a popular programming language?"
68
+ result = reader.run(query=question, documents=docs)
69
+ # {'answers': [ExtractedAnswer(query='What is a popular programming language?', score=0.5740374326705933, data='python', document=Document(id=..., content: '...'), context=None, document_offset=ExtractedAnswer.Span(start=0, end=6),...)]}
70
  ```
71
+ For a complete example with an extractive question answering pipeline that scales over many documents, check out the [corresponding Haystack tutorial](https://haystack.deepset.ai/tutorials/34_extractive_qa_pipeline).
72
 
73
  ### In Transformers
74
  ```python
75
  from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
76
 
77
+ model_name = "deepset/roberta-base-squad2"
 
78
 
79
  # a) Get predictions
80
  nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
 
89
  tokenizer = AutoTokenizer.from_pretrained(model_name)
90
  ```
91
 
92
+
93
  ## Authors
94
  **Branden Chan:** branden.chan@deepset.ai
95
  **Timo Möller:** timo.moeller@deepset.ai
 
98
  **Bogdan Kostić:** bogdan.kostic@deepset.ai
99
 
100
  ## About us
101
+
102
  <div class="grid lg:grid-cols-2 gap-x-4 gap-y-3">
103
  <div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
104
  <img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/deepset-logo-colored.png" class="w-40"/>
 
108
  </div>
109
  </div>
110
 
111
+ [deepset](http://deepset.ai/) is the company behind the production-ready open-source AI framework [Haystack](https://haystack.deepset.ai/).
 
112
 
113
  Some of our other work:
114
+ - [Distilled roberta-base-squad2 (aka "tinyroberta-squad2")](https://huggingface.co/deepset/tinyroberta-squad2)
115
+ - [German BERT](https://deepset.ai/german-bert), [GermanQuAD and GermanDPR](https://deepset.ai/germanquad), [German embedding model](https://huggingface.co/mixedbread-ai/deepset-mxbai-embed-de-large-v1)
116
+ - [deepset Cloud](https://www.deepset.ai/deepset-cloud-product), [deepset Studio](https://www.deepset.ai/deepset-studio)
117
 
118
  ## Get in touch and join the Haystack community
119
 
120
  <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>.
121
 
122
+ We also have a <strong><a class="h-7" href="https://haystack.deepset.ai/community">Discord community open to everyone!</a></strong></p>
123
 
124
+ [Twitter](https://twitter.com/Haystack_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://haystack.deepset.ai/) | [YouTube](https://www.youtube.com/@deepset_ai)
125
 
126
  By the way: [we're hiring!](http://www.deepset.ai/jobs)