Add SetFit model
Browse files- README.md +7 -66
- config.json +1 -1
- config_setfit.json +2 -2
- model.safetensors +1 -1
- model_head.pkl +2 -2
README.md
CHANGED
|
@@ -9,15 +9,7 @@ tags:
|
|
| 9 |
- sentence-transformers
|
| 10 |
- text-classification
|
| 11 |
- generated_from_setfit_trainer
|
| 12 |
-
widget:
|
| 13 |
-
- text: To make introductions between Camelot's Chairman and the Cabinet Secretary.
|
| 14 |
-
We discussed the operation of the UK National Lottery and how to maximise returns
|
| 15 |
-
to National Lottery Good Causes as well as our plans to celebrate the 25th birthday
|
| 16 |
-
of The National Lottery.
|
| 17 |
-
- text: Discussion on crime
|
| 18 |
-
- text: To discuss Northern Powerhouse Rail and HS2
|
| 19 |
-
- text: To discuss food security
|
| 20 |
-
- text: Electricity market
|
| 21 |
inference: false
|
| 22 |
model-index:
|
| 23 |
- name: SetFit
|
|
@@ -31,10 +23,10 @@ model-index:
|
|
| 31 |
split: test
|
| 32 |
metrics:
|
| 33 |
- type: f1
|
| 34 |
-
value: 0.
|
| 35 |
name: F1
|
| 36 |
- type: accuracy
|
| 37 |
-
value: 0.
|
| 38 |
name: Accuracy
|
| 39 |
---
|
| 40 |
|
|
@@ -68,9 +60,9 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
| 68 |
## Evaluation
|
| 69 |
|
| 70 |
### Metrics
|
| 71 |
-
| Label | F1
|
| 72 |
-
|
| 73 |
-
| **all** | 0.
|
| 74 |
|
| 75 |
## Uses
|
| 76 |
|
|
@@ -90,7 +82,7 @@ from setfit import SetFitModel
|
|
| 90 |
# Download from the 🤗 Hub
|
| 91 |
model = SetFitModel.from_pretrained("twright8/setfit-oversample-lobbying")
|
| 92 |
# Run inference
|
| 93 |
-
preds = model("
|
| 94 |
```
|
| 95 |
|
| 96 |
<!--
|
|
@@ -119,57 +111,6 @@ preds = model("Electricity market")
|
|
| 119 |
|
| 120 |
## Training Details
|
| 121 |
|
| 122 |
-
### Training Set Metrics
|
| 123 |
-
| Training set | Min | Median | Max |
|
| 124 |
-
|:-------------|:----|:--------|:----|
|
| 125 |
-
| Word count | 2 | 26.1406 | 153 |
|
| 126 |
-
|
| 127 |
-
### Training Hyperparameters
|
| 128 |
-
- batch_size: (16, 2)
|
| 129 |
-
- num_epochs: (4, 9)
|
| 130 |
-
- max_steps: -1
|
| 131 |
-
- sampling_strategy: oversampling
|
| 132 |
-
- body_learning_rate: (1.0797496673911536e-05, 3.457046714445997e-05)
|
| 133 |
-
- head_learning_rate: 0.0004470582121407239
|
| 134 |
-
- loss: CoSENTLoss
|
| 135 |
-
- distance_metric: cosine_distance
|
| 136 |
-
- margin: 0.25
|
| 137 |
-
- end_to_end: True
|
| 138 |
-
- use_amp: False
|
| 139 |
-
- warmup_proportion: 0.1
|
| 140 |
-
- seed: 42
|
| 141 |
-
- eval_max_steps: -1
|
| 142 |
-
- load_best_model_at_end: True
|
| 143 |
-
|
| 144 |
-
### Training Results
|
| 145 |
-
| Epoch | Step | Training Loss | Validation Loss |
|
| 146 |
-
|:-------:|:-------:|:-------------:|:---------------:|
|
| 147 |
-
| 0.0040 | 1 | 19.1843 | - |
|
| 148 |
-
| 0.2024 | 50 | 11.3434 | - |
|
| 149 |
-
| 0.4049 | 100 | 9.3116 | - |
|
| 150 |
-
| 0.6073 | 150 | 2.7233 | - |
|
| 151 |
-
| 0.8097 | 200 | 1.5662 | - |
|
| 152 |
-
| **1.0** | **247** | **-** | **14.3603** |
|
| 153 |
-
| 1.0121 | 250 | 0.0159 | - |
|
| 154 |
-
| 1.2146 | 300 | 0.0135 | - |
|
| 155 |
-
| 1.4170 | 350 | 0.0003 | - |
|
| 156 |
-
| 1.6194 | 400 | 0.0002 | - |
|
| 157 |
-
| 1.8219 | 450 | 0.0007 | - |
|
| 158 |
-
| 2.0 | 494 | - | 16.8205 |
|
| 159 |
-
| 2.0243 | 500 | 0.0023 | - |
|
| 160 |
-
| 2.2267 | 550 | 0.0004 | - |
|
| 161 |
-
| 2.4291 | 600 | 0.0001 | - |
|
| 162 |
-
| 2.6316 | 650 | 0.0 | - |
|
| 163 |
-
| 2.8340 | 700 | 0.0003 | - |
|
| 164 |
-
| 3.0 | 741 | - | 15.2312 |
|
| 165 |
-
| 3.0364 | 750 | 0.0 | - |
|
| 166 |
-
| 3.2389 | 800 | 3.1257 | - |
|
| 167 |
-
| 3.4413 | 850 | 0.0001 | - |
|
| 168 |
-
| 3.6437 | 900 | 0.0002 | - |
|
| 169 |
-
| 3.8462 | 950 | 0.0139 | - |
|
| 170 |
-
| 4.0 | 988 | - | 14.4995 |
|
| 171 |
-
|
| 172 |
-
* The bold row denotes the saved checkpoint.
|
| 173 |
### Framework Versions
|
| 174 |
- Python: 3.10.12
|
| 175 |
- SetFit: 1.0.3
|
|
|
|
| 9 |
- sentence-transformers
|
| 10 |
- text-classification
|
| 11 |
- generated_from_setfit_trainer
|
| 12 |
+
widget: []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
inference: false
|
| 14 |
model-index:
|
| 15 |
- name: SetFit
|
|
|
|
| 23 |
split: test
|
| 24 |
metrics:
|
| 25 |
- type: f1
|
| 26 |
+
value: 0.9411764705882353
|
| 27 |
name: F1
|
| 28 |
- type: accuracy
|
| 29 |
+
value: 0.9743589743589743
|
| 30 |
name: Accuracy
|
| 31 |
---
|
| 32 |
|
|
|
|
| 60 |
## Evaluation
|
| 61 |
|
| 62 |
### Metrics
|
| 63 |
+
| Label | F1 | Accuracy |
|
| 64 |
+
|:--------|:-------|:---------|
|
| 65 |
+
| **all** | 0.9412 | 0.9744 |
|
| 66 |
|
| 67 |
## Uses
|
| 68 |
|
|
|
|
| 82 |
# Download from the 🤗 Hub
|
| 83 |
model = SetFitModel.from_pretrained("twright8/setfit-oversample-lobbying")
|
| 84 |
# Run inference
|
| 85 |
+
preds = model("I loved the spiderman movie!")
|
| 86 |
```
|
| 87 |
|
| 88 |
<!--
|
|
|
|
| 111 |
|
| 112 |
## Training Details
|
| 113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
### Framework Versions
|
| 115 |
- Python: 3.10.12
|
| 116 |
- SetFit: 1.0.3
|
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "checkpoints/
|
| 3 |
"architectures": [
|
| 4 |
"BertModel"
|
| 5 |
],
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "checkpoints/step_854",
|
| 3 |
"architectures": [
|
| 4 |
"BertModel"
|
| 5 |
],
|
config_setfit.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
"
|
| 4 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"normalize_embeddings": false,
|
| 3 |
+
"labels": null
|
| 4 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 437951328
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:11f4b60615bc978b2f056c0eaa311082802fbbeee70e340d21a917ebaf3c7cf9
|
| 3 |
size 437951328
|
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:cb2198d33621a6e522f7ffd04d5e97e4ea16bc0dd921d241600aec66b79ce7b7
|
| 3 |
+
size 13856
|