Commit
•
1472f81
1
Parent(s):
7656974
Add SetFit model
Browse files- README.md +22 -22
- config_sentence_transformers.json +2 -2
- config_setfit.json +2 -2
- model.safetensors +1 -1
- model_head.pkl +1 -1
- modules.json +6 -0
- sentence_bert_config.json +1 -1
- tokenizer.json +19 -78
- tokenizer_config.json +9 -3
README.md
CHANGED
@@ -5,7 +5,7 @@ tags:
|
|
5 |
- sentence-transformers
|
6 |
- text-classification
|
7 |
- generated_from_setfit_trainer
|
8 |
-
base_model: sentence-transformers/
|
9 |
metrics:
|
10 |
- accuracy
|
11 |
widget:
|
@@ -17,7 +17,7 @@ widget:
|
|
17 |
pipeline_tag: text-classification
|
18 |
inference: true
|
19 |
model-index:
|
20 |
-
- name: SetFit with sentence-transformers/
|
21 |
results:
|
22 |
- task:
|
23 |
type: text-classification
|
@@ -32,9 +32,9 @@ model-index:
|
|
32 |
name: Accuracy
|
33 |
---
|
34 |
|
35 |
-
# SetFit with sentence-transformers/
|
36 |
|
37 |
-
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/
|
38 |
|
39 |
The model has been trained using an efficient few-shot learning technique that involves:
|
40 |
|
@@ -45,9 +45,9 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
45 |
|
46 |
### Model Description
|
47 |
- **Model Type:** SetFit
|
48 |
-
- **Sentence Transformer body:** [sentence-transformers/
|
49 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
50 |
-
- **Maximum Sequence Length:**
|
51 |
- **Number of Classes:** 4 classes
|
52 |
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
|
53 |
<!-- - **Language:** Unknown -->
|
@@ -153,24 +153,24 @@ preds = model("Comment rédiger un bon CV?")
|
|
153 |
### Training Results
|
154 |
| Epoch | Step | Training Loss | Validation Loss |
|
155 |
|:-------:|:-------:|:-------------:|:---------------:|
|
156 |
-
| 0.0060 | 1 | 0.
|
157 |
-
| 0.3012 | 50 | 0.
|
158 |
-
| 0.6024 | 100 | 0.
|
159 |
-
| 0.9036 | 150 | 0.
|
160 |
-
| 1.0 | 166 | - | 0.
|
161 |
-
| 1.2048 | 200 | 0.
|
162 |
-
| 1.5060 | 250 | 0.
|
163 |
-
| 1.8072 | 300 | 0.
|
164 |
-
| 2.0 | 332 | - | 0.
|
165 |
-
| 2.1084 | 350 | 0.
|
166 |
-
| 2.4096 | 400 | 0.
|
167 |
-
| 2.7108 | 450 | 0.
|
168 |
-
| 3.0 | 498 | - | 0.
|
169 |
-
| 3.0120 | 500 | 0.
|
170 |
-
| 3.3133 | 550 | 0.
|
171 |
| 3.6145 | 600 | 0.0003 | - |
|
172 |
| 3.9157 | 650 | 0.0003 | - |
|
173 |
-
| **4.0** | **664** | **-** | **0.
|
174 |
|
175 |
* The bold row denotes the saved checkpoint.
|
176 |
### Framework Versions
|
|
|
5 |
- sentence-transformers
|
6 |
- text-classification
|
7 |
- generated_from_setfit_trainer
|
8 |
+
base_model: sentence-transformers/all-mpnet-base-v2
|
9 |
metrics:
|
10 |
- accuracy
|
11 |
widget:
|
|
|
17 |
pipeline_tag: text-classification
|
18 |
inference: true
|
19 |
model-index:
|
20 |
+
- name: SetFit with sentence-transformers/all-mpnet-base-v2
|
21 |
results:
|
22 |
- task:
|
23 |
type: text-classification
|
|
|
32 |
name: Accuracy
|
33 |
---
|
34 |
|
35 |
+
# SetFit with sentence-transformers/all-mpnet-base-v2
|
36 |
|
37 |
+
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-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.
|
38 |
|
39 |
The model has been trained using an efficient few-shot learning technique that involves:
|
40 |
|
|
|
45 |
|
46 |
### Model Description
|
47 |
- **Model Type:** SetFit
|
48 |
+
- **Sentence Transformer body:** [sentence-transformers/all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-mpnet-base-v2)
|
49 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
50 |
+
- **Maximum Sequence Length:** 384 tokens
|
51 |
- **Number of Classes:** 4 classes
|
52 |
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
|
53 |
<!-- - **Language:** Unknown -->
|
|
|
153 |
### Training Results
|
154 |
| Epoch | Step | Training Loss | Validation Loss |
|
155 |
|:-------:|:-------:|:-------------:|:---------------:|
|
156 |
+
| 0.0060 | 1 | 0.3577 | - |
|
157 |
+
| 0.3012 | 50 | 0.2222 | - |
|
158 |
+
| 0.6024 | 100 | 0.1178 | - |
|
159 |
+
| 0.9036 | 150 | 0.0031 | - |
|
160 |
+
| 1.0 | 166 | - | 0.0009 |
|
161 |
+
| 1.2048 | 200 | 0.0008 | - |
|
162 |
+
| 1.5060 | 250 | 0.0006 | - |
|
163 |
+
| 1.8072 | 300 | 0.0005 | - |
|
164 |
+
| 2.0 | 332 | - | 0.0003 |
|
165 |
+
| 2.1084 | 350 | 0.0005 | - |
|
166 |
+
| 2.4096 | 400 | 0.0004 | - |
|
167 |
+
| 2.7108 | 450 | 0.0004 | - |
|
168 |
+
| 3.0 | 498 | - | 0.0002 |
|
169 |
+
| 3.0120 | 500 | 0.0004 | - |
|
170 |
+
| 3.3133 | 550 | 0.0004 | - |
|
171 |
| 3.6145 | 600 | 0.0003 | - |
|
172 |
| 3.9157 | 650 | 0.0003 | - |
|
173 |
+
| **4.0** | **664** | **-** | **0.0002** |
|
174 |
|
175 |
* The bold row denotes the saved checkpoint.
|
176 |
### Framework Versions
|
config_sentence_transformers.json
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
{
|
2 |
"__version__": {
|
3 |
"sentence_transformers": "2.0.0",
|
4 |
-
"transformers": "4.
|
5 |
-
"pytorch": "1.
|
6 |
},
|
7 |
"prompts": {},
|
8 |
"default_prompt_name": null
|
|
|
1 |
{
|
2 |
"__version__": {
|
3 |
"sentence_transformers": "2.0.0",
|
4 |
+
"transformers": "4.6.1",
|
5 |
+
"pytorch": "1.8.1"
|
6 |
},
|
7 |
"prompts": {},
|
8 |
"default_prompt_name": null
|
config_setfit.json
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
{
|
|
|
2 |
"labels": [
|
3 |
"very_semantic",
|
4 |
"semantic",
|
5 |
"lexical",
|
6 |
"very_lexical"
|
7 |
-
]
|
8 |
-
"normalize_embeddings": false
|
9 |
}
|
|
|
1 |
{
|
2 |
+
"normalize_embeddings": false,
|
3 |
"labels": [
|
4 |
"very_semantic",
|
5 |
"semantic",
|
6 |
"lexical",
|
7 |
"very_lexical"
|
8 |
+
]
|
|
|
9 |
}
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 437967672
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4ecaf937ec012e0ca789426506a82ac68a73094b315e1a34b0825dd45ea29b8b
|
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 25655
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b6401ba0eccde015d202256f9d2a28bb798e26a65bab62b6d00e056d2ac48706
|
3 |
size 25655
|
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 |
}
|
tokenizer.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
"version": "1.0",
|
3 |
"truncation": {
|
4 |
"direction": "Right",
|
5 |
-
"max_length":
|
6 |
"strategy": "LongestFirst",
|
7 |
"stride": 0
|
8 |
},
|
@@ -42,6 +42,15 @@
|
|
42 |
"normalized": false,
|
43 |
"special": true
|
44 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
{
|
46 |
"id": 104,
|
47 |
"content": "[UNK]",
|
@@ -72,85 +81,17 @@
|
|
72 |
"type": "BertPreTokenizer"
|
73 |
},
|
74 |
"post_processor": {
|
75 |
-
"type": "
|
76 |
-
"
|
77 |
-
|
78 |
-
|
79 |
-
"id": "<s>",
|
80 |
-
"type_id": 0
|
81 |
-
}
|
82 |
-
},
|
83 |
-
{
|
84 |
-
"Sequence": {
|
85 |
-
"id": "A",
|
86 |
-
"type_id": 0
|
87 |
-
}
|
88 |
-
},
|
89 |
-
{
|
90 |
-
"SpecialToken": {
|
91 |
-
"id": "</s>",
|
92 |
-
"type_id": 0
|
93 |
-
}
|
94 |
-
}
|
95 |
],
|
96 |
-
"
|
97 |
-
|
98 |
-
|
99 |
-
"id": "<s>",
|
100 |
-
"type_id": 0
|
101 |
-
}
|
102 |
-
},
|
103 |
-
{
|
104 |
-
"Sequence": {
|
105 |
-
"id": "A",
|
106 |
-
"type_id": 0
|
107 |
-
}
|
108 |
-
},
|
109 |
-
{
|
110 |
-
"SpecialToken": {
|
111 |
-
"id": "</s>",
|
112 |
-
"type_id": 0
|
113 |
-
}
|
114 |
-
},
|
115 |
-
{
|
116 |
-
"SpecialToken": {
|
117 |
-
"id": "</s>",
|
118 |
-
"type_id": 0
|
119 |
-
}
|
120 |
-
},
|
121 |
-
{
|
122 |
-
"Sequence": {
|
123 |
-
"id": "B",
|
124 |
-
"type_id": 1
|
125 |
-
}
|
126 |
-
},
|
127 |
-
{
|
128 |
-
"SpecialToken": {
|
129 |
-
"id": "</s>",
|
130 |
-
"type_id": 1
|
131 |
-
}
|
132 |
-
}
|
133 |
],
|
134 |
-
"
|
135 |
-
|
136 |
-
"id": "</s>",
|
137 |
-
"ids": [
|
138 |
-
2
|
139 |
-
],
|
140 |
-
"tokens": [
|
141 |
-
"</s>"
|
142 |
-
]
|
143 |
-
},
|
144 |
-
"<s>": {
|
145 |
-
"id": "<s>",
|
146 |
-
"ids": [
|
147 |
-
0
|
148 |
-
],
|
149 |
-
"tokens": [
|
150 |
-
"<s>"
|
151 |
-
]
|
152 |
-
}
|
153 |
-
}
|
154 |
},
|
155 |
"decoder": {
|
156 |
"type": "WordPiece",
|
|
|
2 |
"version": "1.0",
|
3 |
"truncation": {
|
4 |
"direction": "Right",
|
5 |
+
"max_length": 384,
|
6 |
"strategy": "LongestFirst",
|
7 |
"stride": 0
|
8 |
},
|
|
|
42 |
"normalized": false,
|
43 |
"special": true
|
44 |
},
|
45 |
+
{
|
46 |
+
"id": 3,
|
47 |
+
"content": "<unk>",
|
48 |
+
"single_word": false,
|
49 |
+
"lstrip": false,
|
50 |
+
"rstrip": false,
|
51 |
+
"normalized": true,
|
52 |
+
"special": true
|
53 |
+
},
|
54 |
{
|
55 |
"id": 104,
|
56 |
"content": "[UNK]",
|
|
|
81 |
"type": "BertPreTokenizer"
|
82 |
},
|
83 |
"post_processor": {
|
84 |
+
"type": "RobertaProcessing",
|
85 |
+
"sep": [
|
86 |
+
"</s>",
|
87 |
+
2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
],
|
89 |
+
"cls": [
|
90 |
+
"<s>",
|
91 |
+
0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
],
|
93 |
+
"trim_offsets": true,
|
94 |
+
"add_prefix_space": false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
},
|
96 |
"decoder": {
|
97 |
"type": "WordPiece",
|
tokenizer_config.json
CHANGED
@@ -24,6 +24,14 @@
|
|
24 |
"single_word": false,
|
25 |
"special": true
|
26 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
"104": {
|
28 |
"content": "[UNK]",
|
29 |
"lstrip": false,
|
@@ -44,13 +52,11 @@
|
|
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 |
-
"max_length":
|
52 |
"model_max_length": 512,
|
53 |
-
"never_split": null,
|
54 |
"pad_to_multiple_of": null,
|
55 |
"pad_token": "<pad>",
|
56 |
"pad_token_type_id": 0,
|
|
|
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,
|
|
|
52 |
"bos_token": "<s>",
|
53 |
"clean_up_tokenization_spaces": true,
|
54 |
"cls_token": "<s>",
|
|
|
55 |
"do_lower_case": true,
|
56 |
"eos_token": "</s>",
|
57 |
"mask_token": "<mask>",
|
58 |
+
"max_length": 128,
|
59 |
"model_max_length": 512,
|
|
|
60 |
"pad_to_multiple_of": null,
|
61 |
"pad_token": "<pad>",
|
62 |
"pad_token_type_id": 0,
|