julianrisch commited on
Commit
12b287c
1 Parent(s): b489e65

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +27 -14
README.md CHANGED
@@ -132,7 +132,7 @@ model-index:
132
  name: F1
133
  ---
134
 
135
- # tinyroberta-squad2
136
 
137
  This is the *distilled* version of the [deepset/roberta-base-squad2](https://huggingface.co/deepset/roberta-base-squad2) model. This model has a comparable prediction quality and runs at twice the speed of the base model.
138
 
@@ -142,7 +142,7 @@ This is the *distilled* version of the [deepset/roberta-base-squad2](https://hug
142
  **Downstream-task:** Extractive QA
143
  **Training data:** SQuAD 2.0
144
  **Eval data:** SQuAD 2.0
145
- **Code:** See [an example QA pipeline on Haystack](https://haystack.deepset.ai/tutorials/first-qa-system)
146
  **Infrastructure**: 4x Tesla v100
147
 
148
  ## Hyperparameters
@@ -170,13 +170,27 @@ Secondly, we have performed task-specific distillation with [deepset/roberta-bas
170
  ## Usage
171
 
172
  ### In Haystack
173
- Haystack is an NLP framework by deepset. You can use this model in a Haystack pipeline to do question answering at scale (over many documents). To load the model in [Haystack](https://github.com/deepset-ai/haystack/):
174
-
175
  ```python
176
- reader = FARMReader(model_name_or_path="deepset/tinyroberta-squad2")
177
- # or
178
- reader = TransformersReader(model_name_or_path="deepset/tinyroberta-squad2")
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  ```
 
180
 
181
  ### In Transformers
182
  ```python
@@ -231,20 +245,19 @@ Evaluated on the SQuAD 2.0 dev set with the [official eval script](https://works
231
  </div>
232
  </div>
233
 
234
- [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.
235
-
236
 
237
  Some of our other work:
238
- - [roberta-base-squad2]([https://huggingface.co/deepset/roberta-base-squad2)
239
- - [German BERT (aka "bert-base-german-cased")](https://deepset.ai/german-bert)
240
- - [GermanQuAD and GermanDPR datasets and models (aka "gelectra-base-germanquad", "gbert-base-germandpr")](https://deepset.ai/germanquad)
241
 
242
  ## Get in touch and join the Haystack community
243
 
244
  <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>.
245
 
246
- We also have a <strong><a class="h-7" href="https://haystack.deepset.ai/community/join">Discord community open to everyone!</a></strong></p>
247
 
248
- [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)
249
 
250
  By the way: [we're hiring!](http://www.deepset.ai/jobs)
 
132
  name: F1
133
  ---
134
 
135
+ # tinyroberta for Extractive QA
136
 
137
  This is the *distilled* version of the [deepset/roberta-base-squad2](https://huggingface.co/deepset/roberta-base-squad2) model. This model has a comparable prediction quality and runs at twice the speed of the base model.
138
 
 
142
  **Downstream-task:** Extractive QA
143
  **Training data:** SQuAD 2.0
144
  **Eval data:** SQuAD 2.0
145
+ **Code:** See [an example extractive QA pipeline built with Haystack](https://haystack.deepset.ai/tutorials/34_extractive_qa_pipeline)
146
  **Infrastructure**: 4x Tesla v100
147
 
148
  ## Hyperparameters
 
170
  ## Usage
171
 
172
  ### In Haystack
173
+ 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.
174
+ To load and run the model with [Haystack](https://github.com/deepset-ai/haystack/):
175
  ```python
176
+ # After running pip install haystack-ai "transformers[torch,sentencepiece]"
177
+
178
+ from haystack import Document
179
+ from haystack.components.readers import ExtractiveReader
180
+
181
+ docs = [
182
+ Document(content="Python is a popular programming language"),
183
+ Document(content="python ist eine beliebte Programmiersprache"),
184
+ ]
185
+
186
+ reader = ExtractiveReader(model="deepset/tinyroberta-squad2")
187
+ reader.warm_up()
188
+
189
+ question = "What is a popular programming language?"
190
+ result = reader.run(query=question, documents=docs)
191
+ # {'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),...)]}
192
  ```
193
+ 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).
194
 
195
  ### In Transformers
196
  ```python
 
245
  </div>
246
  </div>
247
 
248
+ [deepset](http://deepset.ai/) is the company behind the production-ready open-source AI framework [Haystack](https://haystack.deepset.ai/).
 
249
 
250
  Some of our other work:
251
+ - [Distilled roberta-base-squad2 (aka "tinyroberta-squad2")](https://huggingface.co/deepset/tinyroberta-squad2)
252
+ - [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)
253
+ - [deepset Cloud](https://www.deepset.ai/deepset-cloud-product), [deepset Studio](https://www.deepset.ai/deepset-studio)
254
 
255
  ## Get in touch and join the Haystack community
256
 
257
  <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>.
258
 
259
+ We also have a <strong><a class="h-7" href="https://haystack.deepset.ai/community">Discord community open to everyone!</a></strong></p>
260
 
261
+ [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)
262
 
263
  By the way: [we're hiring!](http://www.deepset.ai/jobs)