Shobhank-iiitdwd
commited on
Commit
•
252d796
1
Parent(s):
82e6703
Upload 9 files
Browse files- README.md +97 -0
- added_tokens.json +1 -0
- config.json +23 -0
- flax_model.msgpack +3 -0
- index.gitattributes +9 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +1 -0
- tokenizer_config.json +1 -0
- vocab.txt +0 -0
README.md
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: en
|
3 |
+
license: cc-by-4.0
|
4 |
+
datasets:
|
5 |
+
- squad_v2
|
6 |
+
model-index:
|
7 |
+
- name: deepset/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 |
+
---
|
29 |
+
|
30 |
+
# bert-large-uncased-whole-word-masking-squad2
|
31 |
+
|
32 |
+
This is a berta-large model, fine-tuned using the SQuAD2.0 dataset for the task of question answering.
|
33 |
+
|
34 |
+
## Overview
|
35 |
+
**Language model:** bert-large
|
36 |
+
**Language:** English
|
37 |
+
**Downstream-task:** Extractive QA
|
38 |
+
**Training data:** SQuAD 2.0
|
39 |
+
**Eval data:** SQuAD 2.0
|
40 |
+
**Code:** See [an example QA pipeline on Haystack](https://haystack.deepset.ai/tutorials/first-qa-system)
|
41 |
+
|
42 |
+
## Usage
|
43 |
+
|
44 |
+
### In Haystack
|
45 |
+
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/):
|
46 |
+
```python
|
47 |
+
reader = FARMReader(model_name_or_path="deepset/bert-large-uncased-whole-word-masking-squad2")
|
48 |
+
# or
|
49 |
+
reader = TransformersReader(model_name_or_path="FILL",tokenizer="deepset/bert-large-uncased-whole-word-masking-squad2")
|
50 |
+
```
|
51 |
+
|
52 |
+
### In Transformers
|
53 |
+
```python
|
54 |
+
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
|
55 |
+
|
56 |
+
model_name = "deepset/bert-large-uncased-whole-word-masking-squad2"
|
57 |
+
|
58 |
+
# a) Get predictions
|
59 |
+
nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
|
60 |
+
QA_input = {
|
61 |
+
'question': 'Why is model conversion important?',
|
62 |
+
'context': 'The option to convert models between FARM and transformers gives freedom to the user and let people easily switch between frameworks.'
|
63 |
+
}
|
64 |
+
res = nlp(QA_input)
|
65 |
+
|
66 |
+
# b) Load model & tokenizer
|
67 |
+
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
|
68 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
69 |
+
```
|
70 |
+
|
71 |
+
## About us
|
72 |
+
<div class="grid lg:grid-cols-2 gap-x-4 gap-y-3">
|
73 |
+
<div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
|
74 |
+
<img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/deepset-logo-colored.png" class="w-40"/>
|
75 |
+
</div>
|
76 |
+
<div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
|
77 |
+
<img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/haystack-logo-colored.png" class="w-40"/>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
|
81 |
+
[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.
|
82 |
+
|
83 |
+
|
84 |
+
Some of our other work:
|
85 |
+
- [Distilled roberta-base-squad2 (aka "tinyroberta-squad2")]([https://huggingface.co/deepset/tinyroberta-squad2)
|
86 |
+
- [German BERT (aka "bert-base-german-cased")](https://deepset.ai/german-bert)
|
87 |
+
- [GermanQuAD and GermanDPR datasets and models (aka "gelectra-base-germanquad", "gbert-base-germandpr")](https://deepset.ai/germanquad)
|
88 |
+
|
89 |
+
## Get in touch and join the Haystack community
|
90 |
+
|
91 |
+
<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>.
|
92 |
+
|
93 |
+
We also have a <strong><a class="h-7" href="https://haystack.deepset.ai/community">Discord community open to everyone!</a></strong></p>
|
94 |
+
|
95 |
+
[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)
|
96 |
+
|
97 |
+
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 |
+
}
|
flax_model.msgpack
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7a06e722d75519432ad495f4c3d3af07055b34bfc437a17af92c609c97f1e63b
|
3 |
+
size 1336391324
|
index.gitattributes
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bb9ea214f1b492bfe00d692a9583a3eb7f73700b2a4250492f507f0733996fe5
|
3 |
+
size 1340669807
|
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
|
|