LogeshLogesh
commited on
Commit
•
ae28635
1
Parent(s):
5c7c051
Upload 8 file
Browse files- .gitattributes +10 -35
- README.md +200 -1
- added_tokens.json +1 -0
- config.json +23 -0
- model.safetensors +3 -0
- special_tokens_map.json +1 -0
- tokenizer_config.json +1 -0
- vocab.txt +0 -0
.gitattributes
CHANGED
@@ -1,35 +1,10 @@
|
|
1 |
-
*.
|
2 |
-
*.
|
3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
-
*.
|
5 |
-
*.
|
6 |
-
*.
|
7 |
-
*.
|
8 |
-
*.
|
9 |
-
*.
|
10 |
-
|
11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
1 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
10 |
+
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
@@ -1,3 +1,202 @@
|
|
1 |
---
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language: en
|
3 |
+
license: cc-by-4.0
|
4 |
+
datasets:
|
5 |
+
- squad_v2
|
6 |
+
model-index:
|
7 |
+
- name: vicky4s4s/deepsets-bert-large-uncased-whole-word-masking-squad2
|
8 |
+
results:
|
9 |
+
- task:
|
10 |
+
type: question-answering
|
11 |
+
name: Question Answering
|
12 |
+
dataset:
|
13 |
+
name: squad_v2
|
14 |
+
type: squad_v2
|
15 |
+
config: squad_v2
|
16 |
+
split: validation
|
17 |
+
metrics:
|
18 |
+
- type: exact_match
|
19 |
+
value: 80.8846
|
20 |
+
name: Exact Match
|
21 |
+
verified: true
|
22 |
+
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiY2E5ZGNkY2ExZWViZGEwNWE3OGRmMWM2ZmE4ZDU4ZDQ1OGM3ZWE0NTVmZjFmYmZjZmJmNjJmYTc3NTM3OTk3OSIsInZlcnNpb24iOjF9.aSblF4ywh1fnHHrN6UGL392R5KLaH3FCKQlpiXo_EdQ4XXEAENUCjYm9HWDiFsgfSENL35GkbSyz_GAhnefsAQ
|
23 |
+
- type: f1
|
24 |
+
value: 83.8765
|
25 |
+
name: F1
|
26 |
+
verified: true
|
27 |
+
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiNGFlNmEzMTk2NjRkNTI3ZTk3ZTU1NWNlYzIyN2E0ZDFlNDA2ZjYwZWJlNThkMmRmMmE0YzcwYjIyZDM5NmRiMCIsInZlcnNpb24iOjF9.-rc2_Bsp_B26-o12MFYuAU0Ad2Hg9PDx7Preuk27WlhYJDeKeEr32CW8LLANQABR3Mhw2x8uTYkEUrSDMxxLBw
|
28 |
+
- task:
|
29 |
+
type: question-answering
|
30 |
+
name: Question Answering
|
31 |
+
dataset:
|
32 |
+
name: squad
|
33 |
+
type: squad
|
34 |
+
config: plain_text
|
35 |
+
split: validation
|
36 |
+
metrics:
|
37 |
+
- type: exact_match
|
38 |
+
value: 85.904
|
39 |
+
name: Exact Match
|
40 |
+
- type: f1
|
41 |
+
value: 92.586
|
42 |
+
name: F1
|
43 |
+
- task:
|
44 |
+
type: question-answering
|
45 |
+
name: Question Answering
|
46 |
+
dataset:
|
47 |
+
name: adversarial_qa
|
48 |
+
type: adversarial_qa
|
49 |
+
config: adversarialQA
|
50 |
+
split: validation
|
51 |
+
metrics:
|
52 |
+
- type: exact_match
|
53 |
+
value: 28.233
|
54 |
+
name: Exact Match
|
55 |
+
- type: f1
|
56 |
+
value: 41.170
|
57 |
+
name: F1
|
58 |
+
- task:
|
59 |
+
type: question-answering
|
60 |
+
name: Question Answering
|
61 |
+
dataset:
|
62 |
+
name: squad_adversarial
|
63 |
+
type: squad_adversarial
|
64 |
+
config: AddOneSent
|
65 |
+
split: validation
|
66 |
+
metrics:
|
67 |
+
- type: exact_match
|
68 |
+
value: 78.064
|
69 |
+
name: Exact Match
|
70 |
+
- type: f1
|
71 |
+
value: 83.591
|
72 |
+
name: F1
|
73 |
+
- task:
|
74 |
+
type: question-answering
|
75 |
+
name: Question Answering
|
76 |
+
dataset:
|
77 |
+
name: squadshifts amazon
|
78 |
+
type: squadshifts
|
79 |
+
config: amazon
|
80 |
+
split: test
|
81 |
+
metrics:
|
82 |
+
- type: exact_match
|
83 |
+
value: 65.615
|
84 |
+
name: Exact Match
|
85 |
+
- type: f1
|
86 |
+
value: 80.733
|
87 |
+
name: F1
|
88 |
+
- task:
|
89 |
+
type: question-answering
|
90 |
+
name: Question Answering
|
91 |
+
dataset:
|
92 |
+
name: squadshifts new_wiki
|
93 |
+
type: squadshifts
|
94 |
+
config: new_wiki
|
95 |
+
split: test
|
96 |
+
metrics:
|
97 |
+
- type: exact_match
|
98 |
+
value: 81.570
|
99 |
+
name: Exact Match
|
100 |
+
- type: f1
|
101 |
+
value: 91.199
|
102 |
+
name: F1
|
103 |
+
- task:
|
104 |
+
type: question-answering
|
105 |
+
name: Question Answering
|
106 |
+
dataset:
|
107 |
+
name: squadshifts nyt
|
108 |
+
type: squadshifts
|
109 |
+
config: nyt
|
110 |
+
split: test
|
111 |
+
metrics:
|
112 |
+
- type: exact_match
|
113 |
+
value: 83.279
|
114 |
+
name: Exact Match
|
115 |
+
- type: f1
|
116 |
+
value: 91.090
|
117 |
+
name: F1
|
118 |
+
- task:
|
119 |
+
type: question-answering
|
120 |
+
name: Question Answering
|
121 |
+
dataset:
|
122 |
+
name: squadshifts reddit
|
123 |
+
type: squadshifts
|
124 |
+
config: reddit
|
125 |
+
split: test
|
126 |
+
metrics:
|
127 |
+
- type: exact_match
|
128 |
+
value: 69.305
|
129 |
+
name: Exact Match
|
130 |
+
- type: f1
|
131 |
+
value: 82.405
|
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 |
+
|
139 |
+
## Overview
|
140 |
+
**Language model:** bert-large
|
141 |
+
**Language:** English
|
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 |
+
|
147 |
+
## Usage
|
148 |
+
|
149 |
+
### In Haystack
|
150 |
+
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/):
|
151 |
+
```python
|
152 |
+
reader = FARMReader(model_name_or_path="vicky4s4s/deepsets-bert-large-uncased-whole-word-masking-squad2")
|
153 |
+
# or
|
154 |
+
reader = TransformersReader(model_name_or_path="FILL",tokenizer="vicky4s4s/deepsets-bert-large-uncased-whole-word-masking-squad2")
|
155 |
+
```
|
156 |
+
|
157 |
+
### In Transformers
|
158 |
+
```python
|
159 |
+
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
|
160 |
+
|
161 |
+
model_name = "vicky4s4s/deepsets-bert-large-uncased-whole-word-masking-squad2"
|
162 |
+
|
163 |
+
# a) Get predictions
|
164 |
+
nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
|
165 |
+
QA_input = {
|
166 |
+
'question': 'Why is model conversion important?',
|
167 |
+
'context': 'The option to convert models between FARM and transformers gives freedom to the user and let people easily switch between frameworks.'
|
168 |
+
}
|
169 |
+
res = nlp(QA_input)
|
170 |
+
|
171 |
+
# b) Load model & tokenizer
|
172 |
+
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
|
173 |
+
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"/>
|
180 |
+
</div>
|
181 |
+
<div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
|
182 |
+
<img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/haystack-logo-colored.png" class="w-40"/>
|
183 |
+
</div>
|
184 |
+
</div>
|
185 |
+
|
186 |
+
[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.
|
187 |
+
|
188 |
+
|
189 |
+
Some of our other work:
|
190 |
+
- [Distilled roberta-base-squad2 (aka "tinyroberta-squad2")]([https://huggingface.co/deepset/tinyroberta-squad2)
|
191 |
+
- [German BERT (aka "bert-base-german-cased")](https://deepset.ai/german-bert)
|
192 |
+
- [GermanQuAD and GermanDPR datasets and models (aka "gelectra-base-germanquad", "gbert-base-germandpr")](https://deepset.ai/germanquad)
|
193 |
+
|
194 |
+
## Get in touch and join the Haystack community
|
195 |
+
|
196 |
+
<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>.
|
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/deepset_ai) | [LinkedIn](https://www.linkedin.com/company/deepset-ai/) | [Discord](https://haystack.deepset.ai/community/join) | [GitHub Discussions](https://github.com/deepset-ai/haystack/discussions) | [Website](https://deepset.ai)
|
201 |
+
|
202 |
+
By the way: [we're hiring!](http://www.deepset.ai/jobs)
|
added_tokens.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{}
|
config.json
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"BertForQuestionAnswering"
|
4 |
+
],
|
5 |
+
"attention_probs_dropout_prob": 0.1,
|
6 |
+
"finetuning_task": "squad2",
|
7 |
+
"hidden_act": "gelu",
|
8 |
+
"hidden_dropout_prob": 0.1,
|
9 |
+
"hidden_size": 1024,
|
10 |
+
"initializer_range": 0.02,
|
11 |
+
"intermediate_size": 4096,
|
12 |
+
"language": "english",
|
13 |
+
"layer_norm_eps": 1e-12,
|
14 |
+
"max_position_embeddings": 512,
|
15 |
+
"model_type": "bert",
|
16 |
+
"name": "Bert",
|
17 |
+
"num_attention_heads": 16,
|
18 |
+
"num_hidden_layers": 24,
|
19 |
+
"output_past": true,
|
20 |
+
"pad_token_id": 0,
|
21 |
+
"type_vocab_size": 2,
|
22 |
+
"vocab_size": 30522
|
23 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f40d65b33b6c2afd0883afa3b5bb08ab4668497853539ba0809de002dd1deaef
|
3 |
+
size 1340622760
|
special_tokens_map.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"init_inputs": []}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|