File size: 12,162 Bytes
5e32075
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
250
251
252
---
tags:
- setfit
- sentence-transformers
- text-classification
- generated_from_setfit_trainer
widget:
- text: 'hasAdditionalInformation: TFP10-73Pepsi Max X 264 TFP10-174 BAT Velo X 353,
    hasColourDetails: 1pp - Face Print, hasCreatedDate: 2024-06-12, hasCustomerHomeCountry:
    United Kingdom, hasCustomerID: 25892, hasCustomerName: Co-operative Group Limited.(Co-operative
    Group Limited (Co-op Food)), hasCutting: Cut to shape, hasElementID: 3343462,
    hasElementTitle: POS028 SECURITY SHROUD, hasFinishedSizeHeight: 1540, hasFinishedSizeWidth:
    600, hasFlatSizeHeight: 3080, hasFlatSizeWidth: 600, hasFscPaperBeenSpecified:
    No, hasInternalID: 354d490a-f709-4034-af56-3e0b28ee34ba, hasMachineFinishing:
    Yes, hasMachineFinishingDetails: Trimmed to Size, Fold in Half, Weld Long Edges
    Only with 2 x PP Eyelets Positioned as Template - Fold Twice (to 600x515 approx)
    for Flat Packing Pack in 2''s, hasMaterialCategory: Plastic, hasMaterialDescription:
    180gsm White/White Woven PE, hasMaterialThicknessOrWeight: 180, hasMaterialType:
    Polypropylene, hasMaterialUnitOfMeasure: GSM, hasNumberOfVersions: 2, hasPackingRequirements:
    Delivery to K Displays, Smith Way Ossett, FAO Dean Newbold. Delivery required
    Friday 21st June.  Please book in 48hrs in advance and mark all pallets on boxes
    with code, qty and P10 2024 Co-op Campaign, hasPrice: 3513.22 GBP, hasPrintedSides:
    Single sided, hasProofType: PDF digital proof, hasQuantity: 617, hasRecycledContentBeenOffered:
    No, hasSupplierName: Dominion Print Limited(Dominion Print Limited), hasTotalColours:
    4, hasUnitOfMeasure: Millimetres (mm), '
- text: 'hasAdditionalInformation: Mailed First Class, hasArtworkDoubleSidedStatus:
    Double Sided Different, hasCreatedDate: 2024-03-21, hasCustomerHomeCountry: United
    States, hasCustomerID: 32065, hasCustomerName: Republic Services, Inc(Republic
    Services), hasCutting: Trim to size, hasElementID: 3192439, hasElementTitle: Crockett
    Residental PC Mailer 2024, hasFinishedSizeHeight: 4, hasFinishedSizeWidth: 6,
    hasFscPaperBeenSpecified: No, hasInternalID: a63ca51f-99e2-4479-abb8-3e1f48c385e8,
    hasMaterialCategory: Paper, hasMaterialDescription: Uncoated Cover, hasMaterialThicknessOrWeight:
    100, hasMaterialType: Paper, hasMaterialUnitOfMeasure: Pounds (lbs), hasNumberOfVersions:
    1, hasPaperType: Cover, hasPrice: 302.6 USD, hasPrintedSides: Double sided, hasProofType:
    PDF digital proof, hasQuantity: 1200, hasRecycledContentBeenOffered: N/A, hasSendToDetails:
    [email protected], hasSupplierName: United Printing and Mail
    - HHG Strategic Partner (United Printing and Mail  - 48084 - HHGSP - US Only),
    hasTotalColours: 4, hasTotalColoursFace: 4, hasUnitOfMeasure: Inches (in), '
- text: 'hasAdditionalInformation: US-89839_AIRSUPRA HCP Discover Leave behind Qt
    150,000 8.5”x11” flat/finished 80# Chorus Art Coated Cover 6/0 (CMYK + 2PMS) +
    Satin AQ S/W in 25s, hasColourDetails: 6/0 (CMYK + 2PMS) + Satin AQ, hasCreatedDate:
    2024-07-11, hasCustomerHomeCountry: United States, hasCustomerID: 31753, hasCustomerName:
    AstraZeneca Pharmaceuticals LP(AstraZeneca - US - BBU), hasCutting: Trim to size,
    hasElementID: 3394425, hasElementTitle: US-89839_AIRSUPRA HCP Discover Leave behind,
    hasFinishedSizeHeight: 11, hasFinishedSizeWidth: 8.5, hasFlatSizeHeight: 11, hasFlatSizeWidth:
    8.5, hasFscPaperBeenSpecified: Yes, hasInternalID: 91a64b08-cb2a-4d8e-b11d-b3908f11f2cd,
    hasMachineFinishing: Yes, hasMachineFinishingDetails: S/W in 25s, hasMaterialCategory:
    Paper, hasMaterialDescription: 80# Chorus Art Coated Cover, hasMaterialRecycledPercentage:
    30%, hasMaterialThicknessOrWeight: 80, hasMaterialType: Paper and board, hasMaterialUnitOfMeasure:
    Pounds (lbs), hasNumberOfVersions: 1, hasPackingRequirements: S/W in 25s, hasPaperType:
    Cover, hasPrice: 13847.67 USD, hasPrintedSides: Single sided, hasProductCategory:
    Loose Print, hasProofType: PDF digital proof,Colour contract proof, hasQuantity:
    150000, hasQuantityPerVersion: 150000, hasRecycledContentBeenOffered: Yes, hasSupplierName:
    Phoenix Lithographing Corporation(Phoenix Lithographing Corp - HHGSP - PI), hasTotalColours:
    6, hasUnitOfMeasure: Inches (in), '
- text: 'hasAdditionalInformation: US-82104_AIRSUPRA HCP Clinical Leave Behind Qt
    650,000 (4pg Bi-fold) 17"x11" flat 8.5"x11" finished 80# Coated Cover 6/6 (CMYK
    + 2PMS) + GLOSS AQ Trim / Score / Bi-Fold S/W in 25s, hasArtworkDoubleSidedStatus:
    Double Sided Different, hasColourDetails: 6/6 (CMYK + 2PMS) + GLOSS AQ, hasCreatedDate:
    2024-01-18, hasCustomerHomeCountry: United States, hasCustomerID: 31753, hasCustomerName:
    AstraZeneca Pharmaceuticals LP(AstraZeneca - US - BBU), hasCutting: Trim to size,
    hasElementID: 3071417, hasElementTitle: US-82104_AIRSUPRA HCP Clinical Leave Behind,
    hasFinishedSizeHeight: 11, hasFinishedSizeWidth: 8.5, hasFlatSizeHeight: 11, hasFlatSizeWidth:
    17, hasFscPaperBeenSpecified: Yes, hasInternalID: a8e77a84-d6af-4478-b83a-a54ea515b6f0,
    hasMachineFinishing: Yes, hasMachineFinishingDetails: Trim / Score / Bi-Fold S/W
    in 25s, hasMaterialCategory: Paper, hasMaterialDescription: 80# Coated Cover,
    hasMaterialRecycledPercentage: 0%, hasMaterialThicknessOrWeight: 80, hasMaterialType:
    Paper and board, hasMaterialUnitOfMeasure: Pounds (lbs), hasNumberOfVersions:
    1, hasPackingRequirements: S/W in 25s, hasPaperType: Cover, hasPrice: 118754 USD,
    hasPrintedSides: Double sided, hasProductCategory: Booklets & Brochures, hasProofType:
    Colour contract proof,PDF digital proof, hasQuantity: 650000, hasQuantityPerVersion:
    650000, hasRecycledContentBeenOffered: Yes, hasSupplierName: Graphic Arts Incorporated(Graphic
    Arts Inc  - 56170 - HHGSP), hasTotalColours: 6, hasUnitOfMeasure: Inches (in), '
- text: 'hasCreatedDate: 2024-01-04, hasCustomerHomeCountry: United States, hasCustomerID:
    14458, hasCustomerName: Lowe''s Companies Inc(Lowe''s FVS), hasCutting: Trim to
    size, hasElementID: 3044623, hasElementTitle: G284515 Commodity Moulding Profile
    Card 110911, hasFinishedSizeHeight: 6.875, hasFinishedSizeWidth: 3, hasFlatSizeHeight:
    6.875, hasFlatSizeWidth: 3, hasFscPaperBeenSpecified: No, hasInternalID: c88f6dd9-5470-4870-a971-6d88eafb768d,
    hasMaterialCategory: Other, hasMaterialDescription: 8PT _C1S Cover, hasMaterialType:
    Other, hasNumberOfVersions: 1, hasPrice: 0.01 USD, hasPrintedSides: Single sided,
    hasProofType: PDF digital proof, hasQuantity: 1, hasRecycledContentBeenOffered:
    N/A, hasSupplierName: HH IC Content Production + Development(HH IC Content Production
    + Development), hasTotalColours: 4, 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: Northell/ros-classifiers-materials-flat
      type: unknown
      split: test
    metrics:
    - type: f1_micro
      value: 0.4888472352389878
      name: F1_Micro
    - type: f1_macro
      value: 0.07490145637740193
      name: F1_Macro
    - type: f1_weighted
      value: 0.45529275569713784
      name: F1_Weighted
    - type: precision
      value: 0.8907103538513184
      name: Precision
    - type: accuracy
      value: 0.9836170077323914
      name: Accuracy
    - type: recall
      value: 0.33686384558677673
      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:** 43 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.4888   | 0.0749   | 0.4553      | 0.8907    | 0.9836   | 0.3369 |

## 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("hasCreatedDate: 2024-01-04, hasCustomerHomeCountry: United States, hasCustomerID: 14458, hasCustomerName: Lowe's Companies Inc(Lowe's FVS), hasCutting: Trim to size, hasElementID: 3044623, hasElementTitle: G284515 Commodity Moulding Profile Card 110911, hasFinishedSizeHeight: 6.875, hasFinishedSizeWidth: 3, hasFlatSizeHeight: 6.875, hasFlatSizeWidth: 3, hasFscPaperBeenSpecified: No, hasInternalID: c88f6dd9-5470-4870-a971-6d88eafb768d, hasMaterialCategory: Other, hasMaterialDescription: 8PT _C1S Cover, hasMaterialType: Other, hasNumberOfVersions: 1, hasPrice: 0.01 USD, hasPrintedSides: Single sided, hasProofType: PDF digital proof, hasQuantity: 1, hasRecycledContentBeenOffered: N/A, hasSupplierName: HH IC Content Production + Development(HH IC Content Production + Development), 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   | 61  | 109.9881 | 766 |

### Framework Versions
- Python: 3.10.16
- SetFit: 1.1.1
- Sentence Transformers: 3.4.1
- Transformers: 4.49.0
- PyTorch: 2.6.0+cu124
- Datasets: 3.2.0
- Tokenizers: 0.21.0

## 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.*
-->