julianrisch commited on
Commit
934656c
1 Parent(s): 8a01115

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +41 -27
README.md CHANGED
@@ -27,7 +27,7 @@ model-index:
27
  verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZmJlYTIyOTg2NjMyMzg4NzNlNGIzMTY2NDVkMjg0ODdiOWRmYjVkZDYyZjBjNWNiNTBhNjcwOWUzMDM4ZWJiZiIsInZlcnNpb24iOjF9.gxpwIBBA3_5xPi-TaZcqWNnGgCiHzxaUNgrS2jucxoVWGxhBtnPdwKVCxLleQoDDZenAXB3Yh71zMP3xTSeHCw
28
  ---
29
 
30
- # MiniLM-L12-H384-uncased for QA
31
 
32
  ## Overview
33
  **Language model:** microsoft/MiniLM-L12-H384-uncased
@@ -35,7 +35,7 @@ model-index:
35
  **Downstream-task:** Extractive QA
36
  **Training data:** SQuAD 2.0
37
  **Eval data:** SQuAD 2.0
38
- **Code:** See an [example QA pipeline on Haystack](https://haystack.deepset.ai/tutorials/01_basic_qa_pipeline)
39
  **Infrastructure**: 1x Tesla v100
40
 
41
  ## Hyperparameters
@@ -54,33 +54,34 @@ max_query_length=64
54
  grad_acc_steps=4
55
  ```
56
 
57
- ## Performance
58
- Evaluated on the SQuAD 2.0 dev set with the [official eval script](https://worksheets.codalab.org/rest/bundles/0x6b567e1cf2e041ec80d7098f031c5c9e/contents/blob/).
59
- ```
60
- "exact": 76.13071675229513,
61
- "f1": 79.49786500219953,
62
- "total": 11873,
63
- "HasAns_exact": 78.35695006747639,
64
- "HasAns_f1": 85.10090269418276,
65
- "HasAns_total": 5928,
66
- "NoAns_exact": 73.91084945332211,
67
- "NoAns_f1": 73.91084945332211,
68
- "NoAns_total": 5945
69
- ```
70
-
71
  ## Usage
72
 
73
  ### In Haystack
74
- 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/):
 
75
  ```python
76
- reader = FARMReader(model_name_or_path="deepset/minilm-uncased-squad2")
77
- # or
78
- reader = TransformersReader(model="deepset/minilm-uncased-squad2",tokenizer="deepset/minilm-uncased-squad2")
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  ```
 
80
 
81
  ### In Transformers
82
  ```python
83
- from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
84
 
85
  model_name = "deepset/minilm-uncased-squad2"
86
 
@@ -97,6 +98,19 @@ model = AutoModelForQuestionAnswering.from_pretrained(model_name)
97
  tokenizer = AutoTokenizer.from_pretrained(model_name)
98
  ```
99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
  ## Authors
102
  **Vaishali Pal:** vaishali.pal@deepset.ai
@@ -106,6 +120,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
106
  **Tanay Soni:** tanay.soni@deepset.ai
107
 
108
  ## About us
 
109
  <div class="grid lg:grid-cols-2 gap-x-4 gap-y-3">
110
  <div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
111
  <img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/deepset-logo-colored.png" class="w-40"/>
@@ -115,13 +130,12 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
115
  </div>
116
  </div>
117
 
118
- [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.
119
-
120
 
121
  Some of our other work:
122
- - [Distilled roberta-base-squad2 (aka "tinyroberta-squad2")]([https://huggingface.co/deepset/tinyroberta-squad2)
123
- - [German BERT (aka "bert-base-german-cased")](https://deepset.ai/german-bert)
124
- - [GermanQuAD and GermanDPR datasets and models (aka "gelectra-base-germanquad", "gbert-base-germandpr")](https://deepset.ai/germanquad)
125
 
126
  ## Get in touch and join the Haystack community
127
 
@@ -129,6 +143,6 @@ Some of our other work:
129
 
130
  We also have a <strong><a class="h-7" href="https://haystack.deepset.ai/community">Discord community open to everyone!</a></strong></p>
131
 
132
- [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)
133
 
134
  By the way: [we're hiring!](http://www.deepset.ai/jobs)
 
27
  verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZmJlYTIyOTg2NjMyMzg4NzNlNGIzMTY2NDVkMjg0ODdiOWRmYjVkZDYyZjBjNWNiNTBhNjcwOWUzMDM4ZWJiZiIsInZlcnNpb24iOjF9.gxpwIBBA3_5xPi-TaZcqWNnGgCiHzxaUNgrS2jucxoVWGxhBtnPdwKVCxLleQoDDZenAXB3Yh71zMP3xTSeHCw
28
  ---
29
 
30
+ # MiniLM-L12-H384-uncased for Extractive QA
31
 
32
  ## Overview
33
  **Language model:** microsoft/MiniLM-L12-H384-uncased
 
35
  **Downstream-task:** Extractive QA
36
  **Training data:** SQuAD 2.0
37
  **Eval data:** SQuAD 2.0
38
+ **Code:** See [an example extractive QA pipeline built with Haystack](https://haystack.deepset.ai/tutorials/34_extractive_qa_pipeline)
39
  **Infrastructure**: 1x Tesla v100
40
 
41
  ## Hyperparameters
 
54
  grad_acc_steps=4
55
  ```
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  ## Usage
58
 
59
  ### In Haystack
60
+ 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.
61
+ To load and run the model with [Haystack](https://github.com/deepset-ai/haystack/):
62
  ```python
63
+ # After running pip install haystack-ai "transformers[torch,sentencepiece]"
64
+
65
+ from haystack import Document
66
+ from haystack.components.readers import ExtractiveReader
67
+
68
+ docs = [
69
+ Document(content="Python is a popular programming language"),
70
+ Document(content="python ist eine beliebte Programmiersprache"),
71
+ ]
72
+
73
+ reader = ExtractiveReader(model="deepset/minilm-uncased-squad2")
74
+ reader.warm_up()
75
+
76
+ question = "What is a popular programming language?"
77
+ result = reader.run(query=question, documents=docs)
78
+ # {'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),...)]}
79
  ```
80
+ 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).
81
 
82
  ### In Transformers
83
  ```python
84
+ from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
85
 
86
  model_name = "deepset/minilm-uncased-squad2"
87
 
 
98
  tokenizer = AutoTokenizer.from_pretrained(model_name)
99
  ```
100
 
101
+ ## Performance
102
+ Evaluated on the SQuAD 2.0 dev set with the [official eval script](https://worksheets.codalab.org/rest/bundles/0x6b567e1cf2e041ec80d7098f031c5c9e/contents/blob/).
103
+ ```
104
+ "exact": 76.13071675229513,
105
+ "f1": 79.49786500219953,
106
+ "total": 11873,
107
+ "HasAns_exact": 78.35695006747639,
108
+ "HasAns_f1": 85.10090269418276,
109
+ "HasAns_total": 5928,
110
+ "NoAns_exact": 73.91084945332211,
111
+ "NoAns_f1": 73.91084945332211,
112
+ "NoAns_total": 5945
113
+ ```
114
 
115
  ## Authors
116
  **Vaishali Pal:** vaishali.pal@deepset.ai
 
120
  **Tanay Soni:** tanay.soni@deepset.ai
121
 
122
  ## About us
123
+
124
  <div class="grid lg:grid-cols-2 gap-x-4 gap-y-3">
125
  <div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
126
  <img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/deepset-logo-colored.png" class="w-40"/>
 
130
  </div>
131
  </div>
132
 
133
+ [deepset](http://deepset.ai/) is the company behind the production-ready open-source AI framework [Haystack](https://haystack.deepset.ai/).
 
134
 
135
  Some of our other work:
136
+ - [Distilled roberta-base-squad2 (aka "tinyroberta-squad2")](https://huggingface.co/deepset/tinyroberta-squad2)
137
+ - [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)
138
+ - [deepset Cloud](https://www.deepset.ai/deepset-cloud-product), [deepset Studio](https://www.deepset.ai/deepset-studio)
139
 
140
  ## Get in touch and join the Haystack community
141
 
 
143
 
144
  We also have a <strong><a class="h-7" href="https://haystack.deepset.ai/community">Discord community open to everyone!</a></strong></p>
145
 
146
+ [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)
147
 
148
  By the way: [we're hiring!](http://www.deepset.ai/jobs)