Add SetFit model
Browse files- 1_Pooling/config.json +1 -1
- README.md +37 -34
- config.json +13 -22
- model.safetensors +2 -2
- model_head.pkl +2 -2
- modules.json +6 -0
- sentence_bert_config.json +1 -1
- special_tokens_map.json +49 -5
- tokenizer.json +0 -0
- tokenizer_config.json +34 -19
- vocab.txt +5 -0
1_Pooling/config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"word_embedding_dimension":
|
3 |
"pooling_mode_cls_token": false,
|
4 |
"pooling_mode_mean_tokens": true,
|
5 |
"pooling_mode_max_tokens": false,
|
|
|
1 |
{
|
2 |
+
"word_embedding_dimension": 768,
|
3 |
"pooling_mode_cls_token": false,
|
4 |
"pooling_mode_mean_tokens": true,
|
5 |
"pooling_mode_max_tokens": false,
|
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
base_model:
|
3 |
library_name: setfit
|
4 |
metrics:
|
5 |
- accuracy
|
@@ -10,21 +10,24 @@ tags:
|
|
10 |
- text-classification
|
11 |
- generated_from_setfit_trainer
|
12 |
widget:
|
13 |
-
- text:
|
14 |
-
|
15 |
-
- text:
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
22 |
inference: true
|
23 |
---
|
24 |
|
25 |
-
# SetFit with
|
26 |
|
27 |
-
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [
|
28 |
|
29 |
The model has been trained using an efficient few-shot learning technique that involves:
|
30 |
|
@@ -35,9 +38,9 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
35 |
|
36 |
### Model Description
|
37 |
- **Model Type:** SetFit
|
38 |
-
- **Sentence Transformer body:** [
|
39 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
40 |
-
- **Maximum Sequence Length:**
|
41 |
- **Number of Classes:** 2 classes
|
42 |
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
|
43 |
<!-- - **Language:** Unknown -->
|
@@ -50,10 +53,10 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
50 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
51 |
|
52 |
### Model Labels
|
53 |
-
| Label | Examples
|
54 |
-
|
55 |
-
|
|
56 |
-
|
|
57 |
|
58 |
## Uses
|
59 |
|
@@ -73,7 +76,7 @@ from setfit import SetFitModel
|
|
73 |
# Download from the 🤗 Hub
|
74 |
model = SetFitModel.from_pretrained("yasirdemircan/setfit_rng_v3")
|
75 |
# Run inference
|
76 |
-
preds = model("
|
77 |
```
|
78 |
|
79 |
<!--
|
@@ -103,14 +106,14 @@ preds = model("X9.31 PRNG seed keys Triple-DES (112 bit) Generated by gathering
|
|
103 |
## Training Details
|
104 |
|
105 |
### Training Set Metrics
|
106 |
-
| Training set | Min | Median
|
107 |
-
|
108 |
-
| Word count | 6 |
|
109 |
|
110 |
| Label | Training Sample Count |
|
111 |
|:---------|:----------------------|
|
112 |
-
| negative |
|
113 |
-
| positive |
|
114 |
|
115 |
### Training Hyperparameters
|
116 |
- batch_size: (16, 16)
|
@@ -133,16 +136,16 @@ preds = model("X9.31 PRNG seed keys Triple-DES (112 bit) Generated by gathering
|
|
133 |
### Training Results
|
134 |
| Epoch | Step | Training Loss | Validation Loss |
|
135 |
|:------:|:----:|:-------------:|:---------------:|
|
136 |
-
| 0.0149 | 1 | 0.
|
137 |
-
| 0.7463 | 50 | 0.
|
138 |
-
| 1.0 | 67 | - | 0.
|
139 |
-
| 1.4925 | 100 | 0.
|
140 |
-
| 2.0 | 134 | - | 0.
|
141 |
-
| 2.2388 | 150 | 0.
|
142 |
-
| 2.9851 | 200 | 0.
|
143 |
-
| 3.0 | 201 | - | 0.
|
144 |
-
| 3.7313 | 250 | 0.
|
145 |
-
| 4.0 | 268 | - | 0.
|
146 |
|
147 |
### Framework Versions
|
148 |
- Python: 3.10.15
|
|
|
1 |
---
|
2 |
+
base_model: basel/ATTACK-BERT
|
3 |
library_name: setfit
|
4 |
metrics:
|
5 |
- accuracy
|
|
|
10 |
- text-classification
|
11 |
- generated_from_setfit_trainer
|
12 |
widget:
|
13 |
+
- text: With the exception of the DHSK and the RNG seed, all critical security parameters
|
14 |
+
are loaded during manufacturing.
|
15 |
+
- text: The private key component of an ANSI X9.31-compliant PRNG is stored securely
|
16 |
+
in NVRAM.
|
17 |
+
- text: This DRNG uses an 8-byte Seed and an 16-byte Seed Key as inputs to the DRNG.
|
18 |
+
The seed & seed-key values are generated by the hardware RNG and stored only in
|
19 |
+
RAM. These values are zeroized when the module is reset in contact mode or when
|
20 |
+
the module is deselected in contactless mode.
|
21 |
+
- text: The seed key is used as an input to the X9.31 RNG, a deterministic random
|
22 |
+
number generator, and is generally not stored long term.
|
23 |
+
- text: PRNG seed key X9.31 SDRAM This is the seed key for the PRNG. It is statically
|
24 |
+
stored in the code.
|
25 |
inference: true
|
26 |
---
|
27 |
|
28 |
+
# SetFit with basel/ATTACK-BERT
|
29 |
|
30 |
+
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [basel/ATTACK-BERT](https://huggingface.co/basel/ATTACK-BERT) as the Sentence Transformer embedding model. A [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance is used for classification.
|
31 |
|
32 |
The model has been trained using an efficient few-shot learning technique that involves:
|
33 |
|
|
|
38 |
|
39 |
### Model Description
|
40 |
- **Model Type:** SetFit
|
41 |
+
- **Sentence Transformer body:** [basel/ATTACK-BERT](https://huggingface.co/basel/ATTACK-BERT)
|
42 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
43 |
+
- **Maximum Sequence Length:** 384 tokens
|
44 |
- **Number of Classes:** 2 classes
|
45 |
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
|
46 |
<!-- - **Language:** Unknown -->
|
|
|
53 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
54 |
|
55 |
### Model Labels
|
56 |
+
| Label | Examples |
|
57 |
+
|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
58 |
+
| negative | <ul><li>'ANSI X9.31 Appendix A.2.4 PRNG key AES 128-bit key Internally generated Never exits the module Plaintext in volatile memory Rebooting the modules Seeding the FIPS-Approved ANSI X9.31 PRNG'</li><li>'PRNG seed key Continually polled from various system resources to accrue entropy.'</li><li>'module stores RNG and DRBG state values only in RAM.'</li></ul> |
|
59 |
+
| positive | <ul><li>"The PRNG's seed key is encrypted with a device-specific key and securely stored in non-volatile memory."</li><li>'An RNG key compliant with ANSI X9.31 AES 128-bit standards is used by the underlying encryption algorithm and stored in plaintext within tamper-protected memory during factory setup.'</li><li>'The PRNG seed key is pre-loaded during manufacturing and compiled directly into the binary code.'</li></ul> |
|
60 |
|
61 |
## Uses
|
62 |
|
|
|
76 |
# Download from the 🤗 Hub
|
77 |
model = SetFitModel.from_pretrained("yasirdemircan/setfit_rng_v3")
|
78 |
# Run inference
|
79 |
+
preds = model("The private key component of an ANSI X9.31-compliant PRNG is stored securely in NVRAM.")
|
80 |
```
|
81 |
|
82 |
<!--
|
|
|
106 |
## Training Details
|
107 |
|
108 |
### Training Set Metrics
|
109 |
+
| Training set | Min | Median | Max |
|
110 |
+
|:-------------|:----|:--------|:----|
|
111 |
+
| Word count | 6 | 18.8444 | 59 |
|
112 |
|
113 |
| Label | Training Sample Count |
|
114 |
|:---------|:----------------------|
|
115 |
+
| negative | 21 |
|
116 |
+
| positive | 24 |
|
117 |
|
118 |
### Training Hyperparameters
|
119 |
- batch_size: (16, 16)
|
|
|
136 |
### Training Results
|
137 |
| Epoch | Step | Training Loss | Validation Loss |
|
138 |
|:------:|:----:|:-------------:|:---------------:|
|
139 |
+
| 0.0149 | 1 | 0.2442 | - |
|
140 |
+
| 0.7463 | 50 | 0.1714 | - |
|
141 |
+
| 1.0 | 67 | - | 0.1785 |
|
142 |
+
| 1.4925 | 100 | 0.0029 | - |
|
143 |
+
| 2.0 | 134 | - | 0.1880 |
|
144 |
+
| 2.2388 | 150 | 0.0004 | - |
|
145 |
+
| 2.9851 | 200 | 0.0003 | - |
|
146 |
+
| 3.0 | 201 | - | 0.1818 |
|
147 |
+
| 3.7313 | 250 | 0.0003 | - |
|
148 |
+
| 4.0 | 268 | - | 0.1837 |
|
149 |
|
150 |
### Framework Versions
|
151 |
- Python: 3.10.15
|
config.json
CHANGED
@@ -1,33 +1,24 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "
|
3 |
"architectures": [
|
4 |
-
"
|
5 |
],
|
6 |
"attention_probs_dropout_prob": 0.1,
|
7 |
-
"
|
8 |
-
"
|
9 |
"hidden_act": "gelu",
|
10 |
"hidden_dropout_prob": 0.1,
|
11 |
-
"hidden_size":
|
12 |
-
"id2label": {
|
13 |
-
"0": "LABEL_0"
|
14 |
-
},
|
15 |
"initializer_range": 0.02,
|
16 |
-
"intermediate_size":
|
17 |
-
"
|
18 |
-
|
19 |
-
|
20 |
-
"layer_norm_eps": 1e-12,
|
21 |
-
"max_position_embeddings": 512,
|
22 |
-
"model_type": "bert",
|
23 |
"num_attention_heads": 12,
|
24 |
-
"num_hidden_layers":
|
25 |
-
"pad_token_id":
|
26 |
-
"
|
27 |
-
"sbert_ce_default_activation_function": "torch.nn.modules.linear.Identity",
|
28 |
"torch_dtype": "float32",
|
29 |
"transformers_version": "4.45.2",
|
30 |
-
"
|
31 |
-
"use_cache": true,
|
32 |
-
"vocab_size": 30522
|
33 |
}
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "basel/ATTACK-BERT",
|
3 |
"architectures": [
|
4 |
+
"MPNetModel"
|
5 |
],
|
6 |
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"bos_token_id": 0,
|
8 |
+
"eos_token_id": 2,
|
9 |
"hidden_act": "gelu",
|
10 |
"hidden_dropout_prob": 0.1,
|
11 |
+
"hidden_size": 768,
|
|
|
|
|
|
|
12 |
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 3072,
|
14 |
+
"layer_norm_eps": 1e-05,
|
15 |
+
"max_position_embeddings": 514,
|
16 |
+
"model_type": "mpnet",
|
|
|
|
|
|
|
17 |
"num_attention_heads": 12,
|
18 |
+
"num_hidden_layers": 12,
|
19 |
+
"pad_token_id": 1,
|
20 |
+
"relative_attention_num_buckets": 32,
|
|
|
21 |
"torch_dtype": "float32",
|
22 |
"transformers_version": "4.45.2",
|
23 |
+
"vocab_size": 30527
|
|
|
|
|
24 |
}
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b25cc944d4dc118c5ae874af016d2f93be1cdc8eaea62e7e5a03e21efc9755d1
|
3 |
+
size 437967672
|
model_head.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8deee61a156ac484a68ce871d613d34b8c40e12e855e641de092d0f0b87423f4
|
3 |
+
size 7055
|
modules.json
CHANGED
@@ -10,5 +10,11 @@
|
|
10 |
"name": "1",
|
11 |
"path": "1_Pooling",
|
12 |
"type": "sentence_transformers.models.Pooling"
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
}
|
14 |
]
|
|
|
10 |
"name": "1",
|
11 |
"path": "1_Pooling",
|
12 |
"type": "sentence_transformers.models.Pooling"
|
13 |
+
},
|
14 |
+
{
|
15 |
+
"idx": 2,
|
16 |
+
"name": "2",
|
17 |
+
"path": "2_Normalize",
|
18 |
+
"type": "sentence_transformers.models.Normalize"
|
19 |
}
|
20 |
]
|
sentence_bert_config.json
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
{
|
2 |
-
"max_seq_length":
|
3 |
"do_lower_case": false
|
4 |
}
|
|
|
1 |
{
|
2 |
+
"max_seq_length": 384,
|
3 |
"do_lower_case": false
|
4 |
}
|
special_tokens_map.json
CHANGED
@@ -1,7 +1,51 @@
|
|
1 |
{
|
2 |
-
"
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
}
|
|
|
1 |
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"cls_token": {
|
10 |
+
"content": "<s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"eos_token": {
|
17 |
+
"content": "</s>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"mask_token": {
|
24 |
+
"content": "<mask>",
|
25 |
+
"lstrip": true,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
},
|
30 |
+
"pad_token": {
|
31 |
+
"content": "<pad>",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false
|
36 |
+
},
|
37 |
+
"sep_token": {
|
38 |
+
"content": "</s>",
|
39 |
+
"lstrip": false,
|
40 |
+
"normalized": false,
|
41 |
+
"rstrip": false,
|
42 |
+
"single_word": false
|
43 |
+
},
|
44 |
+
"unk_token": {
|
45 |
+
"content": "[UNK]",
|
46 |
+
"lstrip": false,
|
47 |
+
"normalized": false,
|
48 |
+
"rstrip": false,
|
49 |
+
"single_word": false
|
50 |
+
}
|
51 |
}
|
tokenizer.json
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
CHANGED
@@ -1,57 +1,72 @@
|
|
1 |
{
|
2 |
"added_tokens_decoder": {
|
3 |
"0": {
|
4 |
-
"content": "
|
5 |
"lstrip": false,
|
6 |
"normalized": false,
|
7 |
"rstrip": false,
|
8 |
"single_word": false,
|
9 |
"special": true
|
10 |
},
|
11 |
-
"
|
12 |
-
"content": "
|
13 |
"lstrip": false,
|
14 |
"normalized": false,
|
15 |
"rstrip": false,
|
16 |
"single_word": false,
|
17 |
"special": true
|
18 |
},
|
19 |
-
"
|
20 |
-
"content": "
|
21 |
"lstrip": false,
|
22 |
"normalized": false,
|
23 |
"rstrip": false,
|
24 |
"single_word": false,
|
25 |
"special": true
|
26 |
},
|
27 |
-
"
|
28 |
-
"content": "
|
29 |
"lstrip": false,
|
30 |
-
"normalized":
|
31 |
"rstrip": false,
|
32 |
"single_word": false,
|
33 |
"special": true
|
34 |
},
|
35 |
-
"
|
36 |
-
"content": "[
|
37 |
"lstrip": false,
|
38 |
"normalized": false,
|
39 |
"rstrip": false,
|
40 |
"single_word": false,
|
41 |
"special": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
},
|
44 |
-
"
|
45 |
-
"
|
46 |
-
"
|
47 |
"do_lower_case": true,
|
48 |
-
"
|
49 |
-
"
|
50 |
-
"
|
51 |
-
"
|
52 |
-
"
|
|
|
|
|
|
|
|
|
|
|
53 |
"strip_accents": null,
|
54 |
"tokenize_chinese_chars": true,
|
55 |
-
"tokenizer_class": "
|
|
|
|
|
56 |
"unk_token": "[UNK]"
|
57 |
}
|
|
|
1 |
{
|
2 |
"added_tokens_decoder": {
|
3 |
"0": {
|
4 |
+
"content": "<s>",
|
5 |
"lstrip": false,
|
6 |
"normalized": false,
|
7 |
"rstrip": false,
|
8 |
"single_word": false,
|
9 |
"special": true
|
10 |
},
|
11 |
+
"1": {
|
12 |
+
"content": "<pad>",
|
13 |
"lstrip": false,
|
14 |
"normalized": false,
|
15 |
"rstrip": false,
|
16 |
"single_word": false,
|
17 |
"special": true
|
18 |
},
|
19 |
+
"2": {
|
20 |
+
"content": "</s>",
|
21 |
"lstrip": false,
|
22 |
"normalized": false,
|
23 |
"rstrip": false,
|
24 |
"single_word": false,
|
25 |
"special": true
|
26 |
},
|
27 |
+
"3": {
|
28 |
+
"content": "<unk>",
|
29 |
"lstrip": false,
|
30 |
+
"normalized": true,
|
31 |
"rstrip": false,
|
32 |
"single_word": false,
|
33 |
"special": true
|
34 |
},
|
35 |
+
"104": {
|
36 |
+
"content": "[UNK]",
|
37 |
"lstrip": false,
|
38 |
"normalized": false,
|
39 |
"rstrip": false,
|
40 |
"single_word": false,
|
41 |
"special": true
|
42 |
+
},
|
43 |
+
"30526": {
|
44 |
+
"content": "<mask>",
|
45 |
+
"lstrip": true,
|
46 |
+
"normalized": false,
|
47 |
+
"rstrip": false,
|
48 |
+
"single_word": false,
|
49 |
+
"special": true
|
50 |
}
|
51 |
},
|
52 |
+
"bos_token": "<s>",
|
53 |
+
"clean_up_tokenization_spaces": false,
|
54 |
+
"cls_token": "<s>",
|
55 |
"do_lower_case": true,
|
56 |
+
"eos_token": "</s>",
|
57 |
+
"mask_token": "<mask>",
|
58 |
+
"max_length": 384,
|
59 |
+
"model_max_length": 384,
|
60 |
+
"pad_to_multiple_of": null,
|
61 |
+
"pad_token": "<pad>",
|
62 |
+
"pad_token_type_id": 0,
|
63 |
+
"padding_side": "right",
|
64 |
+
"sep_token": "</s>",
|
65 |
+
"stride": 0,
|
66 |
"strip_accents": null,
|
67 |
"tokenize_chinese_chars": true,
|
68 |
+
"tokenizer_class": "MPNetTokenizer",
|
69 |
+
"truncation_side": "right",
|
70 |
+
"truncation_strategy": "longest_first",
|
71 |
"unk_token": "[UNK]"
|
72 |
}
|
vocab.txt
CHANGED
@@ -1,3 +1,7 @@
|
|
|
|
|
|
|
|
|
|
1 |
[PAD]
|
2 |
[unused0]
|
3 |
[unused1]
|
@@ -30520,3 +30524,4 @@ necessitated
|
|
30520 |
##:
|
30521 |
##?
|
30522 |
##~
|
|
|
|
1 |
+
<s>
|
2 |
+
<pad>
|
3 |
+
</s>
|
4 |
+
<unk>
|
5 |
[PAD]
|
6 |
[unused0]
|
7 |
[unused1]
|
|
|
30524 |
##:
|
30525 |
##?
|
30526 |
##~
|
30527 |
+
<mask>
|