Add SetFit model
Browse files- 1_Pooling/config.json +1 -1
- README.md +16 -26
- config.json +13 -15
- config_sentence_transformers.json +2 -2
- config_setfit.json +2 -2
- model.safetensors +2 -2
- model_head.pkl +2 -2
- modules.json +0 -6
- sentence_bert_config.json +1 -1
- special_tokens_map.json +49 -5
- tokenizer.json +2 -2
- tokenizer_config.json +17 -22
- 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
@@ -23,9 +23,9 @@ widget:
|
|
23 |
fish, suggesting the need for further research into mitigation strategies.
|
24 |
pipeline_tag: text-classification
|
25 |
inference: true
|
26 |
-
base_model: sentence-transformers/
|
27 |
model-index:
|
28 |
-
- name: SetFit with sentence-transformers/
|
29 |
results:
|
30 |
- task:
|
31 |
type: text-classification
|
@@ -36,13 +36,13 @@ model-index:
|
|
36 |
split: test
|
37 |
metrics:
|
38 |
- type: accuracy
|
39 |
-
value: 0.
|
40 |
name: Accuracy
|
41 |
---
|
42 |
|
43 |
-
# SetFit with sentence-transformers/
|
44 |
|
45 |
-
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/
|
46 |
|
47 |
The model has been trained using an efficient few-shot learning technique that involves:
|
48 |
|
@@ -53,9 +53,9 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
53 |
|
54 |
### Model Description
|
55 |
- **Model Type:** SetFit
|
56 |
-
- **Sentence Transformer body:** [sentence-transformers/
|
57 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
58 |
-
- **Maximum Sequence Length:**
|
59 |
- **Number of Classes:** 13 classes
|
60 |
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
|
61 |
<!-- - **Language:** Unknown -->
|
@@ -89,7 +89,7 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
89 |
### Metrics
|
90 |
| Label | Accuracy |
|
91 |
|:--------|:---------|
|
92 |
-
| **all** | 0.
|
93 |
|
94 |
## Uses
|
95 |
|
@@ -160,11 +160,11 @@ preds = model("Further investigations are required to determine the nature of th
|
|
160 |
| Uncertainty | 100 |
|
161 |
|
162 |
### Training Hyperparameters
|
163 |
-
- batch_size: (
|
164 |
- num_epochs: (1, 1)
|
165 |
- max_steps: -1
|
166 |
- sampling_strategy: oversampling
|
167 |
-
- num_iterations:
|
168 |
- body_learning_rate: (2e-05, 1e-05)
|
169 |
- head_learning_rate: 0.01
|
170 |
- loss: CosineSimilarityLoss
|
@@ -180,22 +180,12 @@ preds = model("Further investigations are required to determine the nature of th
|
|
180 |
### Training Results
|
181 |
| Epoch | Step | Training Loss | Validation Loss |
|
182 |
|:------:|:----:|:-------------:|:---------------:|
|
183 |
-
| 0.
|
184 |
-
| 0.
|
185 |
-
| 0.
|
186 |
-
| 0.
|
187 |
-
| 0.
|
188 |
-
| 0
|
189 |
-
| 0.2459 | 150 | 0.1549 | - |
|
190 |
-
| 0.3279 | 200 | 0.1319 | - |
|
191 |
-
| 0.4098 | 250 | 0.084 | - |
|
192 |
-
| 0.4918 | 300 | 0.1165 | - |
|
193 |
-
| 0.5738 | 350 | 0.0836 | - |
|
194 |
-
| 0.6557 | 400 | 0.0813 | - |
|
195 |
-
| 0.7377 | 450 | 0.0852 | - |
|
196 |
-
| 0.8197 | 500 | 0.0854 | - |
|
197 |
-
| 0.9016 | 550 | 0.0932 | - |
|
198 |
-
| 0.9836 | 600 | 0.0955 | - |
|
199 |
|
200 |
### Framework Versions
|
201 |
- Python: 3.10.12
|
|
|
23 |
fish, suggesting the need for further research into mitigation strategies.
|
24 |
pipeline_tag: text-classification
|
25 |
inference: true
|
26 |
+
base_model: sentence-transformers/paraphrase-mpnet-base-v2
|
27 |
model-index:
|
28 |
+
- name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
29 |
results:
|
30 |
- task:
|
31 |
type: text-classification
|
|
|
36 |
split: test
|
37 |
metrics:
|
38 |
- type: accuracy
|
39 |
+
value: 0.803076923076923
|
40 |
name: Accuracy
|
41 |
---
|
42 |
|
43 |
+
# SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
44 |
|
45 |
+
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2) 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.
|
46 |
|
47 |
The model has been trained using an efficient few-shot learning technique that involves:
|
48 |
|
|
|
53 |
|
54 |
### Model Description
|
55 |
- **Model Type:** SetFit
|
56 |
+
- **Sentence Transformer body:** [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2)
|
57 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
58 |
+
- **Maximum Sequence Length:** 512 tokens
|
59 |
- **Number of Classes:** 13 classes
|
60 |
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
|
61 |
<!-- - **Language:** Unknown -->
|
|
|
89 |
### Metrics
|
90 |
| Label | Accuracy |
|
91 |
|:--------|:---------|
|
92 |
+
| **all** | 0.8031 |
|
93 |
|
94 |
## Uses
|
95 |
|
|
|
160 |
| Uncertainty | 100 |
|
161 |
|
162 |
### Training Hyperparameters
|
163 |
+
- batch_size: (156, 156)
|
164 |
- num_epochs: (1, 1)
|
165 |
- max_steps: -1
|
166 |
- sampling_strategy: oversampling
|
167 |
+
- num_iterations: 15
|
168 |
- body_learning_rate: (2e-05, 1e-05)
|
169 |
- head_learning_rate: 0.01
|
170 |
- loss: CosineSimilarityLoss
|
|
|
180 |
### Training Results
|
181 |
| Epoch | Step | Training Loss | Validation Loss |
|
182 |
|:------:|:----:|:-------------:|:---------------:|
|
183 |
+
| 0.0003 | 1 | 0.2399 | - |
|
184 |
+
| 0.2 | 50 | 0.1454 | - |
|
185 |
+
| 0.4 | 100 | 0.142 | - |
|
186 |
+
| 0.6 | 150 | 0.1014 | - |
|
187 |
+
| 0.8 | 200 | 0.0914 | - |
|
188 |
+
| 1.0 | 250 | 0.0784 | - |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
|
190 |
### Framework Versions
|
191 |
- Python: 3.10.12
|
config.json
CHANGED
@@ -1,26 +1,24 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "/root/.cache/torch/sentence_transformers/sentence-
|
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 |
"initializer_range": 0.02,
|
13 |
-
"intermediate_size":
|
14 |
-
"layer_norm_eps": 1e-
|
15 |
-
"max_position_embeddings":
|
16 |
-
"model_type": "
|
17 |
"num_attention_heads": 12,
|
18 |
-
"num_hidden_layers":
|
19 |
-
"pad_token_id":
|
20 |
-
"
|
21 |
"torch_dtype": "float32",
|
22 |
"transformers_version": "4.35.2",
|
23 |
-
"
|
24 |
-
"use_cache": true,
|
25 |
-
"vocab_size": 30522
|
26 |
}
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "/root/.cache/torch/sentence_transformers/sentence-transformers_paraphrase-mpnet-base-v2/",
|
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.35.2",
|
23 |
+
"vocab_size": 30527
|
|
|
|
|
24 |
}
|
config_sentence_transformers.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
{
|
2 |
"__version__": {
|
3 |
"sentence_transformers": "2.0.0",
|
4 |
-
"transformers": "4.
|
5 |
-
"pytorch": "1.
|
6 |
}
|
7 |
}
|
|
|
1 |
{
|
2 |
"__version__": {
|
3 |
"sentence_transformers": "2.0.0",
|
4 |
+
"transformers": "4.7.0",
|
5 |
+
"pytorch": "1.9.0+cu102"
|
6 |
}
|
7 |
}
|
config_setfit.json
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
{
|
2 |
-
"normalize_embeddings": false,
|
3 |
"labels": [
|
4 |
"Aims",
|
5 |
"Background",
|
@@ -14,5 +13,6 @@
|
|
14 |
"Reccomendations",
|
15 |
"Result",
|
16 |
"Uncertainty"
|
17 |
-
]
|
|
|
18 |
}
|
|
|
1 |
{
|
|
|
2 |
"labels": [
|
3 |
"Aims",
|
4 |
"Background",
|
|
|
13 |
"Reccomendations",
|
14 |
"Result",
|
15 |
"Uncertainty"
|
16 |
+
],
|
17 |
+
"normalize_embeddings": false
|
18 |
}
|
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:8e6ed62f9ebe9486c0024d1d67f55b8ac61d89439e4cc86d3d51f234939f864d
|
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:2114204c6bc943d637082385d7f7a227985229c5aa70612992910807d8009a25
|
3 |
+
size 81583
|
modules.json
CHANGED
@@ -10,11 +10,5 @@
|
|
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 |
]
|
|
|
10 |
"name": "1",
|
11 |
"path": "1_Pooling",
|
12 |
"type": "sentence_transformers.models.Pooling"
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
}
|
14 |
]
|
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": 512,
|
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": true,
|
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": true,
|
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
@@ -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:5858fbf3342d891d40efa32ba2478c09c895e7eb3d94cdb721651126f0ba58f9
|
3 |
+
size 711831
|
tokenizer_config.json
CHANGED
@@ -1,64 +1,59 @@
|
|
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": false,
|
31 |
"rstrip": false,
|
32 |
"single_word": false,
|
33 |
"special": true
|
34 |
},
|
35 |
-
"
|
36 |
-
"content": "
|
37 |
-
"lstrip":
|
38 |
"normalized": false,
|
39 |
"rstrip": false,
|
40 |
"single_word": false,
|
41 |
"special": true
|
42 |
}
|
43 |
},
|
|
|
44 |
"clean_up_tokenization_spaces": true,
|
45 |
-
"cls_token": "
|
46 |
"do_basic_tokenize": true,
|
47 |
"do_lower_case": true,
|
48 |
-
"
|
49 |
-
"
|
50 |
"model_max_length": 512,
|
51 |
"never_split": null,
|
52 |
-
"
|
53 |
-
"
|
54 |
-
"pad_token_type_id": 0,
|
55 |
-
"padding_side": "right",
|
56 |
-
"sep_token": "[SEP]",
|
57 |
-
"stride": 0,
|
58 |
"strip_accents": null,
|
59 |
"tokenize_chinese_chars": true,
|
60 |
-
"tokenizer_class": "
|
61 |
-
"truncation_side": "right",
|
62 |
-
"truncation_strategy": "longest_first",
|
63 |
"unk_token": "[UNK]"
|
64 |
}
|
|
|
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 |
+
"104": {
|
28 |
+
"content": "[UNK]",
|
29 |
"lstrip": false,
|
30 |
"normalized": false,
|
31 |
"rstrip": false,
|
32 |
"single_word": false,
|
33 |
"special": true
|
34 |
},
|
35 |
+
"30526": {
|
36 |
+
"content": "<mask>",
|
37 |
+
"lstrip": true,
|
38 |
"normalized": false,
|
39 |
"rstrip": false,
|
40 |
"single_word": false,
|
41 |
"special": true
|
42 |
}
|
43 |
},
|
44 |
+
"bos_token": "<s>",
|
45 |
"clean_up_tokenization_spaces": true,
|
46 |
+
"cls_token": "<s>",
|
47 |
"do_basic_tokenize": true,
|
48 |
"do_lower_case": true,
|
49 |
+
"eos_token": "</s>",
|
50 |
+
"mask_token": "<mask>",
|
51 |
"model_max_length": 512,
|
52 |
"never_split": null,
|
53 |
+
"pad_token": "<pad>",
|
54 |
+
"sep_token": "</s>",
|
|
|
|
|
|
|
|
|
55 |
"strip_accents": null,
|
56 |
"tokenize_chinese_chars": true,
|
57 |
+
"tokenizer_class": "MPNetTokenizer",
|
|
|
|
|
58 |
"unk_token": "[UNK]"
|
59 |
}
|
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>
|