Update README.md
Browse files
README.md
CHANGED
|
@@ -132,7 +132,7 @@ model-index:
|
|
| 132 |
name: F1
|
| 133 |
---
|
| 134 |
|
| 135 |
-
# bert-large-uncased-whole-word-masking-squad2
|
| 136 |
|
| 137 |
This is a berta-large model, fine-tuned using the SQuAD2.0 dataset for the task of question answering.
|
| 138 |
|
|
@@ -142,17 +142,32 @@ This is a berta-large model, fine-tuned using the SQuAD2.0 dataset for the task
|
|
| 142 |
**Downstream-task:** Extractive QA
|
| 143 |
**Training data:** SQuAD 2.0
|
| 144 |
**Eval data:** SQuAD 2.0
|
| 145 |
-
**Code:** See [an example QA pipeline
|
| 146 |
|
| 147 |
## Usage
|
| 148 |
|
| 149 |
### In Haystack
|
| 150 |
-
Haystack is an
|
|
|
|
| 151 |
```python
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
```
|
|
|
|
| 156 |
|
| 157 |
### In Transformers
|
| 158 |
```python
|
|
@@ -174,6 +189,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
| 174 |
```
|
| 175 |
|
| 176 |
## About us
|
|
|
|
| 177 |
<div class="grid lg:grid-cols-2 gap-x-4 gap-y-3">
|
| 178 |
<div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
|
| 179 |
<img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/deepset-logo-colored.png" class="w-40"/>
|
|
@@ -183,13 +199,12 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
| 183 |
</div>
|
| 184 |
</div>
|
| 185 |
|
| 186 |
-
[deepset](http://deepset.ai/) is the company behind the open-source
|
| 187 |
-
|
| 188 |
|
| 189 |
Some of our other work:
|
| 190 |
-
- [Distilled roberta-base-squad2 (aka "tinyroberta-squad2")](
|
| 191 |
-
- [German BERT
|
| 192 |
-
- [
|
| 193 |
|
| 194 |
## Get in touch and join the Haystack community
|
| 195 |
|
|
@@ -197,6 +212,6 @@ Some of our other work:
|
|
| 197 |
|
| 198 |
We also have a <strong><a class="h-7" href="https://haystack.deepset.ai/community">Discord community open to everyone!</a></strong></p>
|
| 199 |
|
| 200 |
-
[Twitter](https://twitter.com/
|
| 201 |
|
| 202 |
By the way: [we're hiring!](http://www.deepset.ai/jobs)
|
|
|
|
| 132 |
name: F1
|
| 133 |
---
|
| 134 |
|
| 135 |
+
# bert-large-uncased-whole-word-masking-squad2 for Extractive QA
|
| 136 |
|
| 137 |
This is a berta-large model, fine-tuned using the SQuAD2.0 dataset for the task of question answering.
|
| 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 |
|
| 147 |
## Usage
|
| 148 |
|
| 149 |
### In Haystack
|
| 150 |
+
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.
|
| 151 |
+
To load and run the model with [Haystack](https://github.com/deepset-ai/haystack/):
|
| 152 |
```python
|
| 153 |
+
# After running pip install haystack-ai "transformers[torch,sentencepiece]"
|
| 154 |
+
|
| 155 |
+
from haystack import Document
|
| 156 |
+
from haystack.components.readers import ExtractiveReader
|
| 157 |
+
|
| 158 |
+
docs = [
|
| 159 |
+
Document(content="Python is a popular programming language"),
|
| 160 |
+
Document(content="python ist eine beliebte Programmiersprache"),
|
| 161 |
+
]
|
| 162 |
+
|
| 163 |
+
reader = ExtractiveReader(model="deepset/bert-large-uncased-whole-word-masking-squad2")
|
| 164 |
+
reader.warm_up()
|
| 165 |
+
|
| 166 |
+
question = "What is a popular programming language?"
|
| 167 |
+
result = reader.run(query=question, documents=docs)
|
| 168 |
+
# {'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),...)]}
|
| 169 |
```
|
| 170 |
+
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).
|
| 171 |
|
| 172 |
### In Transformers
|
| 173 |
```python
|
|
|
|
| 189 |
```
|
| 190 |
|
| 191 |
## About us
|
| 192 |
+
|
| 193 |
<div class="grid lg:grid-cols-2 gap-x-4 gap-y-3">
|
| 194 |
<div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
|
| 195 |
<img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/deepset-logo-colored.png" class="w-40"/>
|
|
|
|
| 199 |
</div>
|
| 200 |
</div>
|
| 201 |
|
| 202 |
+
[deepset](http://deepset.ai/) is the company behind the production-ready open-source AI framework [Haystack](https://haystack.deepset.ai/).
|
|
|
|
| 203 |
|
| 204 |
Some of our other work:
|
| 205 |
+
- [Distilled roberta-base-squad2 (aka "tinyroberta-squad2")](https://huggingface.co/deepset/tinyroberta-squad2)
|
| 206 |
+
- [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)
|
| 207 |
+
- [deepset Cloud](https://www.deepset.ai/deepset-cloud-product), [deepset Studio](https://www.deepset.ai/deepset-studio)
|
| 208 |
|
| 209 |
## Get in touch and join the Haystack community
|
| 210 |
|
|
|
|
| 212 |
|
| 213 |
We also have a <strong><a class="h-7" href="https://haystack.deepset.ai/community">Discord community open to everyone!</a></strong></p>
|
| 214 |
|
| 215 |
+
[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)
|
| 216 |
|
| 217 |
By the way: [we're hiring!](http://www.deepset.ai/jobs)
|