josecar24 commited on
Commit
588036e
·
verified ·
1 Parent(s): c2e9fa4

Add SetFit model

Browse files
1_Pooling/config.json CHANGED
@@ -1,10 +1,10 @@
1
  {
2
- "word_embedding_dimension": 768,
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
  }
 
1
  {
2
+ "word_embedding_dimension": 768,
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 CHANGED
@@ -16,8 +16,6 @@ metrics:
16
  pipeline_tag: text-classification
17
  library_name: setfit
18
  inference: true
19
- datasets:
20
- - SetFit/SentEval-CR
21
  base_model: sentence-transformers/paraphrase-mpnet-base-v2
22
  model-index:
23
  - name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2
@@ -26,18 +24,18 @@ model-index:
26
  type: text-classification
27
  name: Text Classification
28
  dataset:
29
- name: SetFit/SentEval-CR
30
- type: SetFit/SentEval-CR
31
  split: test
32
  metrics:
33
  - type: accuracy
34
- value: 0.8645418326693227
35
  name: Accuracy
36
  ---
37
 
38
  # SetFit with sentence-transformers/paraphrase-mpnet-base-v2
39
 
40
- This is a [SetFit](https://github.com/huggingface/setfit) model trained on the [SetFit/SentEval-CR](https://huggingface.co/datasets/SetFit/SentEval-CR) dataset 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.
41
 
42
  The model has been trained using an efficient few-shot learning technique that involves:
43
 
@@ -52,7 +50,7 @@ The model has been trained using an efficient few-shot learning technique that i
52
  - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
53
  - **Maximum Sequence Length:** 512 tokens
54
  - **Number of Classes:** 2 classes
55
- - **Training Dataset:** [SetFit/SentEval-CR](https://huggingface.co/datasets/SetFit/SentEval-CR)
56
  <!-- - **Language:** Unknown -->
57
  <!-- - **License:** Unknown -->
58
 
@@ -73,7 +71,7 @@ The model has been trained using an efficient few-shot learning technique that i
73
  ### Metrics
74
  | Label | Accuracy |
75
  |:--------|:---------|
76
- | **all** | 0.8645 |
77
 
78
  ## Uses
79
 
@@ -91,7 +89,7 @@ Then you can load this model and run inference.
91
  from setfit import SetFitModel
92
 
93
  # Download from the 🤗 Hub
94
- model = SetFitModel.from_pretrained("rajistics/setfit-model")
95
  # Run inference
96
  preds = model("great phone . . .")
97
  ```
@@ -137,7 +135,7 @@ preds = model("great phone . . .")
137
  - num_epochs: (1, 1)
138
  - max_steps: -1
139
  - sampling_strategy: oversampling
140
- - num_iterations: 20
141
  - body_learning_rate: (2e-05, 2e-05)
142
  - head_learning_rate: 2e-05
143
  - loss: CosineSimilarityLoss
@@ -152,18 +150,20 @@ preds = model("great phone . . .")
152
  - load_best_model_at_end: False
153
 
154
  ### Training Results
155
- | Epoch | Step | Training Loss | Validation Loss |
156
- |:-----:|:----:|:-------------:|:---------------:|
157
- | 0.025 | 1 | 0.3257 | - |
 
 
158
 
159
  ### Framework Versions
160
- - Python: 3.12.12
161
  - SetFit: 1.1.3
162
- - Sentence Transformers: 5.2.0
163
- - Transformers: 4.57.3
164
- - PyTorch: 2.9.0+cpu
165
- - Datasets: 4.0.0
166
- - Tokenizers: 0.22.1
167
 
168
  ## Citation
169
 
 
16
  pipeline_tag: text-classification
17
  library_name: setfit
18
  inference: true
 
 
19
  base_model: sentence-transformers/paraphrase-mpnet-base-v2
20
  model-index:
21
  - name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2
 
24
  type: text-classification
25
  name: Text Classification
26
  dataset:
27
+ name: Unknown
28
+ type: unknown
29
  split: test
30
  metrics:
31
  - type: accuracy
32
+ value: 0.8804780876494024
33
  name: Accuracy
34
  ---
35
 
36
  # SetFit with sentence-transformers/paraphrase-mpnet-base-v2
37
 
38
+ 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.
39
 
40
  The model has been trained using an efficient few-shot learning technique that involves:
41
 
 
50
  - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
51
  - **Maximum Sequence Length:** 512 tokens
52
  - **Number of Classes:** 2 classes
53
+ <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
54
  <!-- - **Language:** Unknown -->
55
  <!-- - **License:** Unknown -->
56
 
 
71
  ### Metrics
72
  | Label | Accuracy |
73
  |:--------|:---------|
74
+ | **all** | 0.8805 |
75
 
76
  ## Uses
77
 
 
89
  from setfit import SetFitModel
90
 
91
  # Download from the 🤗 Hub
92
+ model = SetFitModel.from_pretrained("josecar24/Setfit_test")
93
  # Run inference
94
  preds = model("great phone . . .")
95
  ```
 
135
  - num_epochs: (1, 1)
136
  - max_steps: -1
137
  - sampling_strategy: oversampling
138
+ - num_iterations: 60
139
  - body_learning_rate: (2e-05, 2e-05)
140
  - head_learning_rate: 2e-05
141
  - loss: CosineSimilarityLoss
 
150
  - load_best_model_at_end: False
151
 
152
  ### Training Results
153
+ | Epoch | Step | Training Loss | Validation Loss |
154
+ |:------:|:----:|:-------------:|:---------------:|
155
+ | 0.0083 | 1 | 0.4167 | - |
156
+ | 0.4167 | 50 | 0.0621 | - |
157
+ | 0.8333 | 100 | 0.0007 | - |
158
 
159
  ### Framework Versions
160
+ - Python: 3.12.3
161
  - SetFit: 1.1.3
162
+ - Sentence Transformers: 3.4.1
163
+ - Transformers: 4.50.2
164
+ - PyTorch: 2.6.0+cpu
165
+ - Datasets: 3.5.0
166
+ - Tokenizers: 0.21.0
167
 
168
  ## Citation
169
 
config.json CHANGED
@@ -4,7 +4,6 @@
4
  ],
5
  "attention_probs_dropout_prob": 0.1,
6
  "bos_token_id": 0,
7
- "dtype": "float32",
8
  "eos_token_id": 2,
9
  "hidden_act": "gelu",
10
  "hidden_dropout_prob": 0.1,
@@ -18,6 +17,7 @@
18
  "num_hidden_layers": 12,
19
  "pad_token_id": 1,
20
  "relative_attention_num_buckets": 32,
21
- "transformers_version": "4.57.3",
 
22
  "vocab_size": 30527
23
  }
 
4
  ],
5
  "attention_probs_dropout_prob": 0.1,
6
  "bos_token_id": 0,
 
7
  "eos_token_id": 2,
8
  "hidden_act": "gelu",
9
  "hidden_dropout_prob": 0.1,
 
17
  "num_hidden_layers": 12,
18
  "pad_token_id": 1,
19
  "relative_attention_num_buckets": 32,
20
+ "torch_dtype": "float32",
21
+ "transformers_version": "4.50.2",
22
  "vocab_size": 30527
23
  }
config_sentence_transformers.json CHANGED
@@ -1,14 +1,10 @@
1
  {
2
  "__version__": {
3
- "sentence_transformers": "5.2.0",
4
- "transformers": "4.57.3",
5
- "pytorch": "2.9.0+cpu"
6
- },
7
- "model_type": "SentenceTransformer",
8
- "prompts": {
9
- "query": "",
10
- "document": ""
11
  },
 
12
  "default_prompt_name": null,
13
  "similarity_fn_name": "cosine"
14
  }
 
1
  {
2
  "__version__": {
3
+ "sentence_transformers": "3.4.1",
4
+ "transformers": "4.50.2",
5
+ "pytorch": "2.6.0+cpu"
 
 
 
 
 
6
  },
7
+ "prompts": {},
8
  "default_prompt_name": null,
9
  "similarity_fn_name": "cosine"
10
  }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:589f6a91eec40bf75e3ac4fe5a2b5120e980399315eeb716e931b9ebbfdc753f
3
  size 437967672
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:336091ddfb3dbe9654b86cb6ef12e75aa0ac0ea1dcb2824dd551543f13cde4d2
3
  size 437967672
model_head.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:080ea93dd128a9464d2e68793f4832bffde3a610a2b9a0f583d22b98e699db71
3
- size 7007
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb4f614b4c244f1fa63b5d70752db10c4f671ed0b15409824d9ad3c7309e7a01
3
+ size 7059
sentence_bert_config.json CHANGED
@@ -1,4 +1,4 @@
1
  {
2
- "max_seq_length": 512,
3
- "do_lower_case": false
4
  }
 
1
  {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": false
4
  }