File size: 11,783 Bytes
3afbcf3
 
 
 
 
 
 
498865b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f172d8c
498865b
 
 
 
 
 
 
 
 
 
3afbcf3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
498865b
3afbcf3
 
498865b
3afbcf3
 
498865b
3afbcf3
 
498865b
3afbcf3
 
498865b
3afbcf3
 
498865b
3afbcf3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
498865b
3afbcf3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
498865b
3afbcf3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
498865b
3afbcf3
 
 
498865b
3afbcf3
498865b
3afbcf3
6fe6d58
3afbcf3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
---
tags:
- setfit
- sentence-transformers
- text-classification
- generated_from_setfit_trainer
widget:
- text: "hasColourDetails: To be printed on external, adhesive-backed vinyl. No installation\
    \ required. It will be installed from outside the window, so the glue needs to\
    \ be on the reverse., hasCreatedDate: 2024-06-11, hasCustomerHomeCountry: United\
    \ Kingdom, hasCustomerID: 12356, hasCustomerName: Post Office(Post Office), hasCutting:\
    \ Trim to size, hasElementID: 3338891, hasElementTitle: Self-adhesive Window Vinyl\
    \ (no installation), hasFinishedSizeHeight: 150, hasFinishedSizeWidth: 1080, hasInternalID:\
    \ a909113d-a92c-48f2-9817-248a984dc5d8, hasMaterialCategory: Plastic, hasMaterialDescription:\
    \ Suitable self-adhesive Window Vinyl - adhesive on back, hasMaterialType: PVC,\
    \ hasMaterialUnitOfMeasure: GSM, hasNumberOfVersions: 1, hasPackingRequirements:\
    \ Installation is NOT required.   Delivery address- FAO Jyoti Rathod, Ayston Road\
    \ Post Office,10 Ayston Road, Leicester LE3 2GA, hasPrice: 30.0, hasPrintedSides:\
    \ Single sided, hasProofType: PDF digital proof, hasQuantity: 1, hasQuantityPerVersion:\
    \ 1, hasSendToDetails: [email protected]., hasSupplierName: Design\
    \ X-Press Limited - CCS Lot 1 Only\t(Design X-Press Limited - CCS Lot 1 Only\t\
    ), hasSustainableOptionBeenOffered: N/A, hasTotalColours: 4, hasUnitOfMeasure:\
    \ Millimetres (mm), "
- text: 'hasAdditionalInformation: 2,600 cards (85 x 55mm), printed one side (full
    colour), delivered to Granby Marketing Services.  26 x packs of 100., hasArtworkDoubleSidedStatus:
    Double Sided Different, hasCreatedDate: 2024-08-22, hasCustomerHomeCountry: United
    Kingdom, hasCustomerID: 29427, hasCustomerName: NHS Blood and Transplant(NHS Blood
    and Transplant), hasCutting: Trim to size, hasElementID: 3466275, hasElementTitle:
    OLC317B Organ Donation Week Cards, hasFinishedSizeHeight: 55, hasFinishedSizeWidth:
    85, hasFscPaperBeenSpecified: No, hasHandFinishing: Yes, hasHandFinishingDetails:
    Shrinkwrap in 100’s, hasInternalID: c171e44e-1c7a-4dba-a6d7-a8c11f317622, hasMaterialCategory:
    Paper, hasMaterialDescription: White Silk Coated Board, hasMaterialRecycledPercentage:
    0%, hasMaterialThicknessOrWeight: 300, hasMaterialType: Paper and board, hasMaterialUnitOfMeasure:
    GSM, hasNumberOfVersions: 1, hasPackingRequirements: DELIVERY, hasPrice: 380.0,
    hasPrintedSides: Double sided, hasProductCategory: Loose Print, hasProofType:
    PDF digital proof, hasQuantity: 2600, hasQuantityPerVersion: 1, hasRecycledContentBeenOffered:
    No, hasSendToDetails: Email to, hasSupplierName: Dataforms Chartered Press Ltd-
    CCS Lot 1 only(Dataforms Chartered Press Ltd- CCS Lot 1 only), hasTotalColours:
    4, hasTotalColoursFace: 4, hasUnitOfMeasure: Millimetres (mm), '
- text: 'hasCreatedDate: 2024-01-26, hasCustomerHomeCountry: United States, hasCustomerID:
    25570, hasCustomerName: Finish Line Group(Finish Line, Inc), hasCutting: Trim
    to size, hasElementID: 3086661, hasElementTitle: F019753 20 x 28 Fabric Graphic,
    hasFinishedSizeHeight: 28, hasFinishedSizeWidth: 20, hasFscPaperBeenSpecified:
    No, hasInternalID: ac97e6d8-0358-4a1b-9da3-5871bb2b04d1, hasMachineFinishing:
    Yes, hasMachineFinishingDetails: Trim to size. Silicone bed top, bottom left and
    right edges, standard bed, hasMaterialCategory: Textiles, hasMaterialDescription:
    Moonlight Itex - 260GSM, hasMaterialRecycledPercentage: 0%, hasMaterialType: Polyester,
    hasNumberOfVersions: 1, hasPackingRequirements: Trim to size. Silicone bed top,
    bottom left and right edges, standard bed, hasPrice: 1395.56, hasPrintedSides:
    Single sided, hasProductCategory: Displays - Backlit, hasProofType: PDF digital
    proof, hasQuantity: 139, hasRecycledContentBeenOffered: N/A, hasSupplierName:
    GSP Custom Color(GSP Custom Color - HHGSP), hasTotalColours: 4, hasUnitOfMeasure:
    Inches (in), '
- text: 'hasAdditionalInformation: AO, hasCreatedDate: 2024-10-08, hasCustomerHomeCountry:
    United States, hasCustomerID: 30642, hasCustomerName: Station Casinos LLC(Station
    Casinos), hasCutting: Trim to size, hasElementID: 3555960, hasElementTitle: 211696
    - 381" X 363" SS FRONTLIT EXTERIOR VINYL SIGN , hasFinishedSizeHeight: 363, hasFinishedSizeWidth:
    381, hasFscPaperBeenSpecified: No, hasInternalID: 04b8890a-dc33-4778-ad73-c1f68f68231c,
    hasMaterialCategory: Plastic, hasMaterialDescription: 13OZ VINYL, hasMaterialRecycledPercentage:
    0%, hasMaterialThicknessOrWeight: 13, hasMaterialType: PVC, hasMaterialUnitOfMeasure:
    Ounces (oz), hasNumberOfVersions: 1, hasPrice: 676.0, hasPrintedSides: Not printed,
    hasProductCategory: Banners (synthetic), hasProofType: PDF digital proof, hasQuantity:
    1, hasRecycledContentBeenOffered: N/A, hasSupplierName: WestRock Company(Westrock
    - 14360 - HHGSP), hasTotalColours: 4, hasUnitOfMeasure: Inches (in), '
- text: 'hasAdditionalInformation: 2 - Pages, hasArtworkDoubleSidedStatus: Double
    Sided Different, hasColourDetails: 1/1 (Black Two-sided), hasCreatedDate: 2024-12-10,
    hasCustomerHomeCountry: United States, hasCustomerID: 26760, hasCustomerName:
    Elanco Animal Health(Elanco Animal Health), hasCutting: Trim to size, hasElementID:
    3687940, hasElementTitle: PA103754X - Galliprant PI, hasFinishedSizeHeight: 11,
    hasFinishedSizeWidth: 8.5, hasFlatSizeHeight: 11, hasFlatSizeWidth: 8.5, hasFscPaperBeenSpecified:
    No, hasInternalID: c0585f9a-6716-4373-a218-041b92baf4a2, hasMachineFinishing:
    Yes, hasMachineFinishingDetails: bleed, hasMaterialCategory: Paper, hasMaterialDescription:
    60# White Offset, hasMaterialThicknessOrWeight: 60, hasMaterialType: Paper and
    board, hasMaterialUnitOfMeasure: Pounds (lbs), hasMinimumRecycledContent: 0%,
    hasNumberOfVersions: 1, hasPackingRequirements: Hold for Kit Packing in Element
    5, hasPaperType: Offset, hasPrice: 350.0, hasPrintedSides: Double sided, hasProductCategory:
    Booklets & Brochures, hasProofType: PDF digital proof, hasQuantity: 3100, hasRecycledContentBeenRequested:
    No, hasSupplierName: Modern Litho – Kansas City(Modernlitho  -James Printing.
    Inc - HHGSP), hasTotalColoursFace: 1, hasTotalColoursReverse: 1, hasUnitOfMeasure:
    Inches (in), '
metrics:
- f1_micro
- f1_macro
- f1_weighted
- precision
- accuracy
- recall
pipeline_tag: text-classification
library_name: setfit
inference: false
model-index:
- name: SetFit
  results:
  - task:
      type: text-classification
      name: Text Classification
    dataset:
      name: Unknown
      type: unknown
      split: test
    metrics:
    - type: f1_micro
      value: 0.9322709163346613
      name: F1_Micro
    - type: f1_macro
      value: 0.37012987012987014
      name: F1_Macro
    - type: f1_weighted
      value: 0.8821255080797066
      name: F1_Weighted
    - type: precision
      value: 0.9750000238418579
      name: Precision
    - type: accuracy
      value: 0.9468749761581421
      name: Accuracy
    - type: recall
      value: 0.8931297659873962
      name: Recall
---

# SetFit

This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. A OneVsRestClassifier instance is used for classification.

The model has been trained using an efficient few-shot learning technique that involves:

1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
2. Training a classification head with features from the fine-tuned Sentence Transformer.

## Model Details

### Model Description
- **Model Type:** SetFit
<!-- - **Sentence Transformer:** [Unknown](https://huggingface.co/unknown) -->
- **Classification head:** a OneVsRestClassifier instance
- **Maximum Sequence Length:** 512 tokens
- **Number of Classes:** 8 classes
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
<!-- - **Language:** Unknown -->
<!-- - **License:** Unknown -->

### Model Sources

- **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
- **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)

## Evaluation

### Metrics
| Label   | F1_Micro | F1_Macro | F1_Weighted | Precision | Accuracy | Recall |
|:--------|:---------|:---------|:------------|:----------|:---------|:-------|
| **all** | 0.9323   | 0.3701   | 0.8821      | 0.9750    | 0.9469   | 0.8931 |

## Uses

### Direct Use for Inference

First install the SetFit library:

```bash
pip install setfit
```

Then you can load this model and run inference.

```python
from setfit import SetFitModel

# Download from the 🤗 Hub
model = SetFitModel.from_pretrained("setfit_model_id")
# Run inference
preds = model("hasAdditionalInformation: AO, hasCreatedDate: 2024-10-08, hasCustomerHomeCountry: United States, hasCustomerID: 30642, hasCustomerName: Station Casinos LLC(Station Casinos), hasCutting: Trim to size, hasElementID: 3555960, hasElementTitle: 211696 - 381\" X 363\" SS FRONTLIT EXTERIOR VINYL SIGN , hasFinishedSizeHeight: 363, hasFinishedSizeWidth: 381, hasFscPaperBeenSpecified: No, hasInternalID: 04b8890a-dc33-4778-ad73-c1f68f68231c, hasMaterialCategory: Plastic, hasMaterialDescription: 13OZ VINYL, hasMaterialRecycledPercentage: 0%, hasMaterialThicknessOrWeight: 13, hasMaterialType: PVC, hasMaterialUnitOfMeasure: Ounces (oz), hasNumberOfVersions: 1, hasPrice: 676.0, hasPrintedSides: Not printed, hasProductCategory: Banners (synthetic), hasProofType: PDF digital proof, hasQuantity: 1, hasRecycledContentBeenOffered: N/A, hasSupplierName: WestRock Company(Westrock - 14360 - HHGSP), hasTotalColours: 4, hasUnitOfMeasure: Inches (in), ")
```

<!--
### Downstream Use

*List how someone could finetune this model on their own dataset.*
-->

<!--
### Out-of-Scope Use

*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->

<!--
## Bias, Risks and Limitations

*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
-->

<!--
### Recommendations

*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
-->

## Training Details

### Training Set Metrics
| Training set | Min | Median   | Max |
|:-------------|:----|:---------|:----|
| Word count   | 67  | 110.9875 | 238 |

### Framework Versions
- Python: 3.10.16
- SetFit: 1.1.2
- Sentence Transformers: 3.4.1
- Transformers: 4.51.3
- PyTorch: 2.6.0+cu124
- Datasets: 3.2.0
- Tokenizers: 0.21.1

## Citation

### BibTeX
```bibtex
@article{https://doi.org/10.48550/arxiv.2209.11055,
    doi = {10.48550/ARXIV.2209.11055},
    url = {https://arxiv.org/abs/2209.11055},
    author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
    keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
    title = {Efficient Few-Shot Learning Without Prompts},
    publisher = {arXiv},
    year = {2022},
    copyright = {Creative Commons Attribution 4.0 International}
}
```

<!--
## Glossary

*Clearly define terms in order to be accessible across audiences.*
-->

<!--
## Model Card Authors

*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->

<!--
## Model Card Contact

*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
-->