vinulacs commited on
Commit
31693d1
·
verified ·
1 Parent(s): 662509c

Push model using huggingface_hub.

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 1024,
3
+ "pooling_mode_cls_token": false,
4
+ "pooling_mode_mean_tokens": true,
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,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - setfit
4
+ - sentence-transformers
5
+ - text-classification
6
+ - generated_from_setfit_trainer
7
+ widget:
8
+ - text: Also you guys are deducting data so much without using it seems
9
+ - text: ඇත්තටම ගහෝල්ඩ් වටිනවා මම 285 පැකේජය පාවිච්චි කරනවා good
10
+ - text: Gampola Lebsack chater
11
+ - text: Unlimited A2A calls සමඟ අඩුම ගානට වැඩිම data දෙන පට්ට pack එක smiling_face_with_sunglasses
12
+ - text: he shows hw experienced n great he is.. dats da whole turning poi t of da
13
+ match..
14
+ metrics:
15
+ - accuracy
16
+ pipeline_tag: text-classification
17
+ library_name: setfit
18
+ inference: true
19
+ base_model: intfloat/multilingual-e5-large
20
+ ---
21
+
22
+ # SetFit with intfloat/multilingual-e5-large
23
+
24
+ This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [intfloat/multilingual-e5-large](https://huggingface.co/intfloat/multilingual-e5-large) 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.
25
+
26
+ The model has been trained using an efficient few-shot learning technique that involves:
27
+
28
+ 1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
29
+ 2. Training a classification head with features from the fine-tuned Sentence Transformer.
30
+
31
+ ## Model Details
32
+
33
+ ### Model Description
34
+ - **Model Type:** SetFit
35
+ - **Sentence Transformer body:** [intfloat/multilingual-e5-large](https://huggingface.co/intfloat/multilingual-e5-large)
36
+ - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
37
+ - **Maximum Sequence Length:** 512 tokens
38
+ - **Number of Classes:** 3 classes
39
+ <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
40
+ <!-- - **Language:** Unknown -->
41
+ <!-- - **License:** Unknown -->
42
+
43
+ ### Model Sources
44
+
45
+ - **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
46
+ - **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
47
+ - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
48
+
49
+ ### Model Labels
50
+ | Label | Examples |
51
+ |:------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
52
+ | 0 | <ul><li>'Fiber nae.'</li><li>'hey Zemlak boru bill danne ai ewa refund karana kiwata reply na anthima horu tikakne'</li><li>'hey Zemlak boru bill danne ai ewa refund karana kiwata reply na horu tikakne'</li></ul> |
53
+ | 2 | <ul><li>'I think this is the first time Pubg players are awarded with this much of a cash pool in SL.'</li><li>'I think this is the first time players are with this of a pool in'</li><li>'I think this is the first time Pubg players are awarded with in this much of a cash pool in SL.'</li></ul> |
54
+ | 1 | <ul><li>'Koo ampara district alamkulam area 2g coverage'</li><li>'Koo ampara district area 2g coverage'</li><li>'Koo ampara district district alamkulam area 2g coverage'</li></ul> |
55
+
56
+ ## Uses
57
+
58
+ ### Direct Use for Inference
59
+
60
+ First install the SetFit library:
61
+
62
+ ```bash
63
+ pip install setfit
64
+ ```
65
+
66
+ Then you can load this model and run inference.
67
+
68
+ ```python
69
+ from setfit import SetFitModel
70
+
71
+ # Download from the 🤗 Hub
72
+ model = SetFitModel.from_pretrained("vinulacs/sinmix-setfit-sentiment")
73
+ # Run inference
74
+ preds = model("Gampola Lebsack chater")
75
+ ```
76
+
77
+ <!--
78
+ ### Downstream Use
79
+
80
+ *List how someone could finetune this model on their own dataset.*
81
+ -->
82
+
83
+ <!--
84
+ ### Out-of-Scope Use
85
+
86
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
87
+ -->
88
+
89
+ <!--
90
+ ## Bias, Risks and Limitations
91
+
92
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
93
+ -->
94
+
95
+ <!--
96
+ ### Recommendations
97
+
98
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
99
+ -->
100
+
101
+ ## Training Details
102
+
103
+ ### Training Set Metrics
104
+ | Training set | Min | Median | Max |
105
+ |:-------------|:----|:-------|:----|
106
+ | Word count | 1 | 9.7390 | 79 |
107
+
108
+ | Label | Training Sample Count |
109
+ |:------|:----------------------|
110
+ | 0 | 194 |
111
+ | 1 | 185 |
112
+ | 2 | 165 |
113
+
114
+ ### Training Hyperparameters
115
+ - batch_size: (16, 16)
116
+ - num_epochs: (1, 1)
117
+ - max_steps: -1
118
+ - sampling_strategy: oversampling
119
+ - num_iterations: 40
120
+ - body_learning_rate: (2e-05, 1e-05)
121
+ - head_learning_rate: 0.01
122
+ - loss: CosineSimilarityLoss
123
+ - distance_metric: cosine_distance
124
+ - margin: 0.25
125
+ - end_to_end: False
126
+ - use_amp: False
127
+ - warmup_proportion: 0.1
128
+ - l2_weight: 0.01
129
+ - seed: 42
130
+ - eval_max_steps: -1
131
+ - load_best_model_at_end: False
132
+
133
+ ### Training Results
134
+ | Epoch | Step | Training Loss | Validation Loss |
135
+ |:------:|:----:|:-------------:|:---------------:|
136
+ | 0.0004 | 1 | 0.2675 | - |
137
+ | 0.0184 | 50 | 0.3054 | - |
138
+ | 0.0368 | 100 | 0.219 | - |
139
+ | 0.0551 | 150 | 0.1664 | - |
140
+ | 0.0735 | 200 | 0.0785 | - |
141
+ | 0.0919 | 250 | 0.0256 | - |
142
+ | 0.1103 | 300 | 0.009 | - |
143
+ | 0.1287 | 350 | 0.0104 | - |
144
+ | 0.1471 | 400 | 0.0004 | - |
145
+ | 0.1654 | 450 | 0.0003 | - |
146
+ | 0.1838 | 500 | 0.0003 | - |
147
+ | 0.2022 | 550 | 0.0002 | - |
148
+ | 0.2206 | 600 | 0.0002 | - |
149
+ | 0.2390 | 650 | 0.0002 | - |
150
+ | 0.2574 | 700 | 0.0002 | - |
151
+ | 0.2757 | 750 | 0.0002 | - |
152
+ | 0.2941 | 800 | 0.0001 | - |
153
+ | 0.3125 | 850 | 0.0001 | - |
154
+ | 0.3309 | 900 | 0.0001 | - |
155
+ | 0.3493 | 950 | 0.0001 | - |
156
+ | 0.3676 | 1000 | 0.0001 | - |
157
+ | 0.3860 | 1050 | 0.0001 | - |
158
+ | 0.4044 | 1100 | 0.0001 | - |
159
+ | 0.4228 | 1150 | 0.0001 | - |
160
+ | 0.4412 | 1200 | 0.0001 | - |
161
+ | 0.4596 | 1250 | 0.0001 | - |
162
+ | 0.4779 | 1300 | 0.0001 | - |
163
+ | 0.4963 | 1350 | 0.0001 | - |
164
+ | 0.5147 | 1400 | 0.0001 | - |
165
+ | 0.5331 | 1450 | 0.0001 | - |
166
+ | 0.5515 | 1500 | 0.0001 | - |
167
+ | 0.5699 | 1550 | 0.0001 | - |
168
+ | 0.5882 | 1600 | 0.0001 | - |
169
+ | 0.6066 | 1650 | 0.0001 | - |
170
+ | 0.625 | 1700 | 0.0001 | - |
171
+ | 0.6434 | 1750 | 0.0001 | - |
172
+ | 0.6618 | 1800 | 0.0001 | - |
173
+ | 0.6801 | 1850 | 0.0001 | - |
174
+ | 0.6985 | 1900 | 0.0001 | - |
175
+ | 0.7169 | 1950 | 0.0001 | - |
176
+ | 0.7353 | 2000 | 0.0001 | - |
177
+ | 0.7537 | 2050 | 0.0001 | - |
178
+ | 0.7721 | 2100 | 0.0001 | - |
179
+ | 0.7904 | 2150 | 0.0001 | - |
180
+ | 0.8088 | 2200 | 0.0001 | - |
181
+ | 0.8272 | 2250 | 0.0001 | - |
182
+ | 0.8456 | 2300 | 0.0001 | - |
183
+ | 0.8640 | 2350 | 0.0001 | - |
184
+ | 0.8824 | 2400 | 0.0001 | - |
185
+ | 0.9007 | 2450 | 0.0001 | - |
186
+ | 0.9191 | 2500 | 0.0001 | - |
187
+ | 0.9375 | 2550 | 0.0013 | - |
188
+ | 0.9559 | 2600 | 0.0001 | - |
189
+ | 0.9743 | 2650 | 0.0001 | - |
190
+ | 0.9926 | 2700 | 0.0001 | - |
191
+
192
+ ### Framework Versions
193
+ - Python: 3.12.12
194
+ - SetFit: 1.1.3
195
+ - Sentence Transformers: 5.2.3
196
+ - Transformers: 4.51.3
197
+ - PyTorch: 2.10.0+cu128
198
+ - Datasets: 4.0.0
199
+ - Tokenizers: 0.21.4
200
+
201
+ ## Citation
202
+
203
+ ### BibTeX
204
+ ```bibtex
205
+ @article{https://doi.org/10.48550/arxiv.2209.11055,
206
+ doi = {10.48550/ARXIV.2209.11055},
207
+ url = {https://arxiv.org/abs/2209.11055},
208
+ author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
209
+ keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
210
+ title = {Efficient Few-Shot Learning Without Prompts},
211
+ publisher = {arXiv},
212
+ year = {2022},
213
+ copyright = {Creative Commons Attribution 4.0 International}
214
+ }
215
+ ```
216
+
217
+ <!--
218
+ ## Glossary
219
+
220
+ *Clearly define terms in order to be accessible across audiences.*
221
+ -->
222
+
223
+ <!--
224
+ ## Model Card Authors
225
+
226
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
227
+ -->
228
+
229
+ <!--
230
+ ## Model Card Contact
231
+
232
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
233
+ -->
config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "XLMRobertaModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": 0,
7
+ "classifier_dropout": null,
8
+ "eos_token_id": 2,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 1024,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 4096,
14
+ "layer_norm_eps": 1e-05,
15
+ "max_position_embeddings": 514,
16
+ "model_type": "xlm-roberta",
17
+ "num_attention_heads": 16,
18
+ "num_hidden_layers": 24,
19
+ "output_past": true,
20
+ "pad_token_id": 1,
21
+ "position_embedding_type": "absolute",
22
+ "torch_dtype": "float32",
23
+ "transformers_version": "4.51.3",
24
+ "type_vocab_size": 1,
25
+ "use_cache": true,
26
+ "vocab_size": 250002
27
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "SentenceTransformer",
3
+ "__version__": {
4
+ "sentence_transformers": "5.2.3",
5
+ "transformers": "4.51.3",
6
+ "pytorch": "2.10.0+cu128"
7
+ },
8
+ "prompts": {
9
+ "query": "",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "cosine"
14
+ }
config_setfit.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "labels": [
3
+ 0,
4
+ 1,
5
+ 2
6
+ ],
7
+ "normalize_embeddings": false
8
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dd629a518ce24ed8573afca430990a639db54c4a7d284481b2be58bcec91744c
3
+ size 2239607176
model_head.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67a58e3bc81c3b7e289464e8cd996bae0ce8dfdfff4e18395bfd1c896c540245
3
+ size 25471
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": false
4
+ }
sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
3
+ size 5069051
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:883b037111086fd4dfebbbc9b7cee11e1517b5e0c0514879478661440f137085
3
+ size 17082987
tokenizer_config.json ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "250001": {
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
+ "eos_token": "</s>",
48
+ "extra_special_tokens": {},
49
+ "mask_token": "<mask>",
50
+ "model_max_length": 512,
51
+ "pad_token": "<pad>",
52
+ "sep_token": "</s>",
53
+ "tokenizer_class": "XLMRobertaTokenizer",
54
+ "unk_token": "<unk>"
55
+ }