bert model
#17
by
richasinha12
- opened
- README.md +2 -3
- onnx/added_tokens.json +0 -7
- onnx/config.json +0 -33
- onnx/model.onnx +0 -3
- onnx/special_tokens_map.json +0 -7
- onnx/tokenizer.json +0 -0
- onnx/tokenizer_config.json +0 -58
- onnx/vocab.txt +0 -0
README.md
CHANGED
@@ -131,7 +131,6 @@ This model reaches an accuracy of 91.3 on the dev set (for comparison, Bert bert
|
|
131 |
- **Parent Model:** For more details about DistilBERT, we encourage users to check out [this model card](https://huggingface.co/distilbert-base-uncased).
|
132 |
- **Resources for more information:**
|
133 |
- [Model Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/distilbert#transformers.DistilBertForSequenceClassification)
|
134 |
-
- [DistilBERT paper](https://arxiv.org/abs/1910.01108)
|
135 |
|
136 |
## How to Get Started With the Model
|
137 |
|
@@ -141,8 +140,8 @@ Example of single-label classification:
|
|
141 |
import torch
|
142 |
from transformers import DistilBertTokenizer, DistilBertForSequenceClassification
|
143 |
|
144 |
-
tokenizer = DistilBertTokenizer.from_pretrained("distilbert-base-uncased
|
145 |
-
model = DistilBertForSequenceClassification.from_pretrained("distilbert-base-uncased
|
146 |
|
147 |
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
|
148 |
with torch.no_grad():
|
|
|
131 |
- **Parent Model:** For more details about DistilBERT, we encourage users to check out [this model card](https://huggingface.co/distilbert-base-uncased).
|
132 |
- **Resources for more information:**
|
133 |
- [Model Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/distilbert#transformers.DistilBertForSequenceClassification)
|
|
|
134 |
|
135 |
## How to Get Started With the Model
|
136 |
|
|
|
140 |
import torch
|
141 |
from transformers import DistilBertTokenizer, DistilBertForSequenceClassification
|
142 |
|
143 |
+
tokenizer = DistilBertTokenizer.from_pretrained("distilbert-base-uncased")
|
144 |
+
model = DistilBertForSequenceClassification.from_pretrained("distilbert-base-uncased")
|
145 |
|
146 |
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
|
147 |
with torch.no_grad():
|
onnx/added_tokens.json
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"[CLS]": 101,
|
3 |
-
"[MASK]": 103,
|
4 |
-
"[PAD]": 0,
|
5 |
-
"[SEP]": 102,
|
6 |
-
"[UNK]": 100
|
7 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onnx/config.json
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"_name_or_path": "distilbert-base-uncased-finetuned-sst-2-english",
|
3 |
-
"activation": "gelu",
|
4 |
-
"architectures": [
|
5 |
-
"DistilBertForSequenceClassification"
|
6 |
-
],
|
7 |
-
"attention_dropout": 0.1,
|
8 |
-
"dim": 768,
|
9 |
-
"dropout": 0.1,
|
10 |
-
"finetuning_task": "sst-2",
|
11 |
-
"hidden_dim": 3072,
|
12 |
-
"id2label": {
|
13 |
-
"0": "NEGATIVE",
|
14 |
-
"1": "POSITIVE"
|
15 |
-
},
|
16 |
-
"initializer_range": 0.02,
|
17 |
-
"label2id": {
|
18 |
-
"NEGATIVE": 0,
|
19 |
-
"POSITIVE": 1
|
20 |
-
},
|
21 |
-
"max_position_embeddings": 512,
|
22 |
-
"model_type": "distilbert",
|
23 |
-
"n_heads": 12,
|
24 |
-
"n_layers": 6,
|
25 |
-
"output_past": true,
|
26 |
-
"pad_token_id": 0,
|
27 |
-
"qa_dropout": 0.1,
|
28 |
-
"seq_classif_dropout": 0.2,
|
29 |
-
"sinusoidal_pos_embds": false,
|
30 |
-
"tie_weights_": true,
|
31 |
-
"transformers_version": "4.34.0",
|
32 |
-
"vocab_size": 30522
|
33 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onnx/model.onnx
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:252cf7048af94a1599019fef35961b2bd3d6db13df0b0a4b032b92baeae31939
|
3 |
-
size 267955711
|
|
|
|
|
|
|
|
onnx/special_tokens_map.json
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"cls_token": "[CLS]",
|
3 |
-
"mask_token": "[MASK]",
|
4 |
-
"pad_token": "[PAD]",
|
5 |
-
"sep_token": "[SEP]",
|
6 |
-
"unk_token": "[UNK]"
|
7 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onnx/tokenizer.json
DELETED
The diff for this file is too large to render.
See raw diff
|
|
onnx/tokenizer_config.json
DELETED
@@ -1,58 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"added_tokens_decoder": {
|
3 |
-
"0": {
|
4 |
-
"content": "[PAD]",
|
5 |
-
"lstrip": false,
|
6 |
-
"normalized": false,
|
7 |
-
"rstrip": false,
|
8 |
-
"single_word": false,
|
9 |
-
"special": true
|
10 |
-
},
|
11 |
-
"100": {
|
12 |
-
"content": "[UNK]",
|
13 |
-
"lstrip": false,
|
14 |
-
"normalized": false,
|
15 |
-
"rstrip": false,
|
16 |
-
"single_word": false,
|
17 |
-
"special": true
|
18 |
-
},
|
19 |
-
"101": {
|
20 |
-
"content": "[CLS]",
|
21 |
-
"lstrip": false,
|
22 |
-
"normalized": false,
|
23 |
-
"rstrip": false,
|
24 |
-
"single_word": false,
|
25 |
-
"special": true
|
26 |
-
},
|
27 |
-
"102": {
|
28 |
-
"content": "[SEP]",
|
29 |
-
"lstrip": false,
|
30 |
-
"normalized": false,
|
31 |
-
"rstrip": false,
|
32 |
-
"single_word": false,
|
33 |
-
"special": true
|
34 |
-
},
|
35 |
-
"103": {
|
36 |
-
"content": "[MASK]",
|
37 |
-
"lstrip": false,
|
38 |
-
"normalized": false,
|
39 |
-
"rstrip": false,
|
40 |
-
"single_word": false,
|
41 |
-
"special": true
|
42 |
-
}
|
43 |
-
},
|
44 |
-
"additional_special_tokens": [],
|
45 |
-
"clean_up_tokenization_spaces": true,
|
46 |
-
"cls_token": "[CLS]",
|
47 |
-
"do_basic_tokenize": true,
|
48 |
-
"do_lower_case": true,
|
49 |
-
"mask_token": "[MASK]",
|
50 |
-
"model_max_length": 512,
|
51 |
-
"never_split": null,
|
52 |
-
"pad_token": "[PAD]",
|
53 |
-
"sep_token": "[SEP]",
|
54 |
-
"strip_accents": null,
|
55 |
-
"tokenize_chinese_chars": true,
|
56 |
-
"tokenizer_class": "DistilBertTokenizer",
|
57 |
-
"unk_token": "[UNK]"
|
58 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onnx/vocab.txt
DELETED
The diff for this file is too large to render.
See raw diff
|
|