Zlovoblachko commited on
Commit
f318b1f
·
verified ·
1 Parent(s): 6857c64

Push model using huggingface_hub.

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 384,
3
+ "pooling_mode_cls_token": true,
4
+ "pooling_mode_mean_tokens": false,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - setfit
4
+ - sentence-transformers
5
+ - text-classification
6
+ - generated_from_setfit_trainer
7
+ widget:
8
+ - text: 'Thesis: In my opinion, watching sports on TV is a good opportunity to get
9
+ relax. There are many reasons why some people like to watch sport games on TV.
10
+ Last argument: None Target sentence: Where is the truth?'
11
+ - text: 'Thesis: As for me, I suppose that watching sports via TV won''t help you
12
+ become a professional at sport. Moreover, sport events are not very interesting
13
+ to be seen through television channels. Last argument: Besides, it''s much more
14
+ attractive to visit the play in the real life than to watch it at home for many
15
+ reasons. Target sentence: If you watch the sport programme, you can see only those
16
+ things that the operator wants to record.'
17
+ - text: 'Thesis: Today there are people who belived that watching any sport is a useless
18
+ time spent. I complitely disagree with this opinion. Last argument: Watching any
19
+ sort games or individual competition is wonderfull way to spend your free time,
20
+ by this hobby you can have a lot of profits. Target sentence: Watching any sort
21
+ games or individual competition is wonderfull way to spend your free time, by
22
+ this hobby you can have a lot of profits.'
23
+ - text: 'Thesis: As for me, I suppose that watching sports via TV won''t help you
24
+ become a professional at sport. Moreover, sport events are not very interesting
25
+ to be seen through television channels. Last argument: Besides, it''s much more
26
+ attractive to visit the play in the real life than to watch it at home for many
27
+ reasons. Target sentence: Besides, it''s much more attractive to visit the play
28
+ in the real life than to watch it at home for many reasons.'
29
+ - text: 'Thesis: Some people consider that it is a waste of time, bit I desagree with
30
+ this statment and try to refute it. Last argument: If looks on this statement
31
+ otherwise, it is importnat to say that watching sport events is a usual hobby
32
+ such as cooking, reading books and others. Target sentence: People who work in
33
+ public catering like cooking and it is their hobby maybe.'
34
+ metrics:
35
+ - accuracy
36
+ pipeline_tag: text-classification
37
+ library_name: setfit
38
+ inference: true
39
+ datasets:
40
+ - Zlovoblachko/DeepSeek_dim1
41
+ base_model: BAAI/bge-small-en-v1.5
42
+ model-index:
43
+ - name: SetFit with BAAI/bge-small-en-v1.5
44
+ results:
45
+ - task:
46
+ type: text-classification
47
+ name: Text Classification
48
+ dataset:
49
+ name: Zlovoblachko/DeepSeek_dim1
50
+ type: Zlovoblachko/DeepSeek_dim1
51
+ split: test
52
+ metrics:
53
+ - type: accuracy
54
+ value: 0.8740740740740741
55
+ name: Accuracy
56
+ ---
57
+
58
+ # SetFit with BAAI/bge-small-en-v1.5
59
+
60
+ This is a [SetFit](https://github.com/huggingface/setfit) model trained on the [Zlovoblachko/DeepSeek_dim1](https://huggingface.co/datasets/Zlovoblachko/DeepSeek_dim1) dataset that can be used for Text Classification. This SetFit model uses [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5) 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.
61
+
62
+ The model has been trained using an efficient few-shot learning technique that involves:
63
+
64
+ 1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
65
+ 2. Training a classification head with features from the fine-tuned Sentence Transformer.
66
+
67
+ ## Model Details
68
+
69
+ ### Model Description
70
+ - **Model Type:** SetFit
71
+ - **Sentence Transformer body:** [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5)
72
+ - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
73
+ - **Maximum Sequence Length:** 512 tokens
74
+ - **Number of Classes:** 2 classes
75
+ - **Training Dataset:** [Zlovoblachko/DeepSeek_dim1](https://huggingface.co/datasets/Zlovoblachko/DeepSeek_dim1)
76
+ <!-- - **Language:** Unknown -->
77
+ <!-- - **License:** Unknown -->
78
+
79
+ ### Model Sources
80
+
81
+ - **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
82
+ - **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
83
+ - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
84
+
85
+ ### Model Labels
86
+ | Label | Examples |
87
+ |:------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
88
+ | L | <ul><li>'Thesis: in my opinion it is uself and fun to do pysical exercise and my activity every day. I disagre wits his opinion because these people do not understand that sport should keep fit and mind. Last argument: Secondly the sport is very fun. Target sentence: However some people prefer to watch sports show on tv.'</li><li>'Thesis: I personally disadree with this opinion because there are many reasons why watching sports can be useful for people. Last argument: However, I can understend people who agree with first point of view. Target sentence: On the other hand, sometimes it is very difficult to control the time which they lose for that.'</li><li>"Thesis: None Last argument: People opposing this position may say that sport is not an intellectual activity, so it is not worth spending time at all. Target sentence: They think that watching sport is not developing people's mind, so it has no sense to watch such things."</li></ul> |
89
+ | H | <ul><li>'Thesis: I think, that watching sports really gives a lot of fun. Last argument: The second point is that sports fans are fond of their teams ond sports favoritres. Target sentence: Sports stimulates them to travel (like UFC or Olympic games), to collect merch, to have new datings.'</li><li>'Thesis: So, can watching sport be called a waste of time. To my mind, observing a sports game is a fascinating pastime. However, in my opinion they are mistaken. Last argument: Even some hidden talents can be discovered. Target sentence: Although, it is obvious that we should not spend much time in front of the TV, some people believe that watching sports can make a person obese.'</li><li>'Thesis: Some people think that spending free time watching sport on TV is just killing precious time. However, my personal opinion is that this activity is useful. Last argument: Also, it can be a good practice if you play some sport Target sentence: because while watching game you can learn some tricks of this game and then apply them in life.'</li></ul> |
90
+
91
+ ## Evaluation
92
+
93
+ ### Metrics
94
+ | Label | Accuracy |
95
+ |:--------|:---------|
96
+ | **all** | 0.8741 |
97
+
98
+ ## Uses
99
+
100
+ ### Direct Use for Inference
101
+
102
+ First install the SetFit library:
103
+
104
+ ```bash
105
+ pip install setfit
106
+ ```
107
+
108
+ Then you can load this model and run inference.
109
+
110
+ ```python
111
+ from setfit import SetFitModel
112
+
113
+ # Download from the 🤗 Hub
114
+ model = SetFitModel.from_pretrained("Zlovoblachko/dim1_setfit_model")
115
+ # Run inference
116
+ preds = model("Thesis: In my opinion, watching sports on TV is a good opportunity to get relax. There are many reasons why some people like to watch sport games on TV. Last argument: None Target sentence: Where is the truth?")
117
+ ```
118
+
119
+ <!--
120
+ ### Downstream Use
121
+
122
+ *List how someone could finetune this model on their own dataset.*
123
+ -->
124
+
125
+ <!--
126
+ ### Out-of-Scope Use
127
+
128
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
129
+ -->
130
+
131
+ <!--
132
+ ## Bias, Risks and Limitations
133
+
134
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
135
+ -->
136
+
137
+ <!--
138
+ ### Recommendations
139
+
140
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
141
+ -->
142
+
143
+ ## Training Details
144
+
145
+ ### Training Set Metrics
146
+ | Training set | Min | Median | Max |
147
+ |:-------------|:----|:--------|:----|
148
+ | Word count | 13 | 62.7806 | 140 |
149
+
150
+ | Label | Training Sample Count |
151
+ |:------|:----------------------|
152
+ | L | 540 |
153
+ | H | 540 |
154
+
155
+ ### Training Hyperparameters
156
+ - batch_size: (16, 16)
157
+ - num_epochs: (1, 1)
158
+ - max_steps: -1
159
+ - sampling_strategy: oversampling
160
+ - body_learning_rate: (2e-05, 1e-05)
161
+ - head_learning_rate: 0.01
162
+ - loss: CosineSimilarityLoss
163
+ - distance_metric: cosine_distance
164
+ - margin: 0.25
165
+ - end_to_end: False
166
+ - use_amp: False
167
+ - warmup_proportion: 0.1
168
+ - l2_weight: 0.01
169
+ - seed: 42
170
+ - eval_max_steps: -1
171
+ - load_best_model_at_end: False
172
+
173
+ ### Training Results
174
+ | Epoch | Step | Training Loss | Validation Loss |
175
+ |:------:|:----:|:-------------:|:---------------:|
176
+ | 0.0000 | 1 | 0.2674 | - |
177
+ | 0.0014 | 50 | 0.3254 | - |
178
+ | 0.0027 | 100 | 0.3135 | 0.3191 |
179
+ | 0.0041 | 150 | 0.2963 | - |
180
+ | 0.0055 | 200 | 0.2799 | 0.2615 |
181
+ | 0.0068 | 250 | 0.2521 | - |
182
+ | 0.0082 | 300 | 0.2554 | 0.2495 |
183
+ | 0.0096 | 350 | 0.2518 | - |
184
+ | 0.0110 | 400 | 0.2484 | 0.2488 |
185
+ | 0.0123 | 450 | 0.2498 | - |
186
+ | 0.0137 | 500 | 0.2456 | 0.2465 |
187
+ | 0.0151 | 550 | 0.2449 | - |
188
+ | 0.0164 | 600 | 0.2433 | 0.2435 |
189
+ | 0.0178 | 650 | 0.2416 | - |
190
+ | 0.0192 | 700 | 0.2424 | 0.2410 |
191
+ | 0.0205 | 750 | 0.2381 | - |
192
+ | 0.0219 | 800 | 0.2302 | 0.2300 |
193
+ | 0.0233 | 850 | 0.227 | - |
194
+ | 0.0246 | 900 | 0.2222 | 0.2428 |
195
+ | 0.0260 | 950 | 0.2129 | - |
196
+ | 0.0274 | 1000 | 0.2138 | 0.2144 |
197
+ | 0.0288 | 1050 | 0.2026 | - |
198
+ | 0.0301 | 1100 | 0.1888 | 0.2009 |
199
+ | 0.0315 | 1150 | 0.1735 | - |
200
+ | 0.0329 | 1200 | 0.1658 | 0.2017 |
201
+ | 0.0342 | 1250 | 0.1646 | - |
202
+ | 0.0356 | 1300 | 0.1442 | 0.1889 |
203
+ | 0.0370 | 1350 | 0.1428 | - |
204
+ | 0.0383 | 1400 | 0.1169 | 0.1804 |
205
+ | 0.0397 | 1450 | 0.1237 | - |
206
+ | 0.0411 | 1500 | 0.0989 | 0.1838 |
207
+ | 0.0424 | 1550 | 0.106 | - |
208
+ | 0.0438 | 1600 | 0.102 | 0.1703 |
209
+ | 0.0452 | 1650 | 0.0823 | - |
210
+ | 0.0466 | 1700 | 0.0822 | 0.1786 |
211
+ | 0.0479 | 1750 | 0.081 | - |
212
+ | 0.0493 | 1800 | 0.0674 | 0.1685 |
213
+ | 0.0507 | 1850 | 0.0593 | - |
214
+ | 0.0520 | 1900 | 0.0659 | 0.1732 |
215
+ | 0.0534 | 1950 | 0.0546 | - |
216
+ | 0.0548 | 2000 | 0.0508 | 0.1889 |
217
+ | 0.0561 | 2050 | 0.0447 | - |
218
+ | 0.0575 | 2100 | 0.0462 | 0.1637 |
219
+ | 0.0589 | 2150 | 0.0348 | - |
220
+ | 0.0602 | 2200 | 0.0256 | 0.2151 |
221
+ | 0.0616 | 2250 | 0.0273 | - |
222
+ | 0.0630 | 2300 | 0.0183 | 0.2285 |
223
+ | 0.0644 | 2350 | 0.0194 | - |
224
+ | 0.0657 | 2400 | 0.0245 | 0.2068 |
225
+
226
+ ### Framework Versions
227
+ - Python: 3.11.13
228
+ - SetFit: 1.1.3
229
+ - Sentence Transformers: 4.1.0
230
+ - Transformers: 4.54.0
231
+ - PyTorch: 2.6.0+cu124
232
+ - Datasets: 4.0.0
233
+ - Tokenizers: 0.21.2
234
+
235
+ ## Citation
236
+
237
+ ### BibTeX
238
+ ```bibtex
239
+ @article{https://doi.org/10.48550/arxiv.2209.11055,
240
+ doi = {10.48550/ARXIV.2209.11055},
241
+ url = {https://arxiv.org/abs/2209.11055},
242
+ author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
243
+ keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
244
+ title = {Efficient Few-Shot Learning Without Prompts},
245
+ publisher = {arXiv},
246
+ year = {2022},
247
+ copyright = {Creative Commons Attribution 4.0 International}
248
+ }
249
+ ```
250
+
251
+ <!--
252
+ ## Glossary
253
+
254
+ *Clearly define terms in order to be accessible across audiences.*
255
+ -->
256
+
257
+ <!--
258
+ ## Model Card Authors
259
+
260
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
261
+ -->
262
+
263
+ <!--
264
+ ## Model Card Contact
265
+
266
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
267
+ -->
config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "classifier_dropout": null,
7
+ "hidden_act": "gelu",
8
+ "hidden_dropout_prob": 0.1,
9
+ "hidden_size": 384,
10
+ "id2label": {
11
+ "0": "LABEL_0"
12
+ },
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 1536,
15
+ "label2id": {
16
+ "LABEL_0": 0
17
+ },
18
+ "layer_norm_eps": 1e-12,
19
+ "max_position_embeddings": 512,
20
+ "model_type": "bert",
21
+ "num_attention_heads": 12,
22
+ "num_hidden_layers": 12,
23
+ "pad_token_id": 0,
24
+ "position_embedding_type": "absolute",
25
+ "torch_dtype": "float32",
26
+ "transformers_version": "4.54.0",
27
+ "type_vocab_size": 2,
28
+ "use_cache": true,
29
+ "vocab_size": 30522
30
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "4.1.0",
4
+ "transformers": "4.54.0",
5
+ "pytorch": "2.6.0+cu124"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": "cosine"
10
+ }
config_setfit.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "labels": [
3
+ "L",
4
+ "H"
5
+ ],
6
+ "normalize_embeddings": false
7
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d18273d12779b50525e47a07336b8ae94f78a96efcae61eb35cc8e640fcbd51
3
+ size 133462128
model_head.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a701584febb621f3aaa4e3c120a0ea43cb874836897a910ea93ec054e4fcc979
3
+ size 3935
modules.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
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 ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": true
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "extra_special_tokens": {},
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": "BertTokenizer",
57
+ "unk_token": "[UNK]"
58
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff