--- tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer widget: - text: 'hasCreatedDate: 2025-01-08, hasCustomerHomeCountry: United Kingdom, hasCustomerID: 14239, hasCustomerName: Asda Stores Ltd(Asda (Spearmint)), hasCutting: Cut to shape, hasElementID: 3728622, hasElementTitle: 7341_40 Showcase Plinth - Small , hasFinishedSizeHeight: 400, hasFinishedSizeWidth: 400, hasFlatSizeHeight: 936, hasFlatSizeWidth: 1258, hasFscPaperBeenSpecified: No, hasInternalID: dadf7de9-5b3b-49f0-a844-ff1c717046e4, hasMachineFinishing: Yes, hasMachineFinishingDetails: Die cut and crease, Glue/Tape as required and supply flat, hasMaterialCategory: Paper, hasMaterialDescription: E Flute, hasMaterialRecycledPercentage: 0%, hasMaterialThicknessOrWeight: 150, hasMaterialType: Paper and board, hasMaterialUnitOfMeasure: GSM, hasNumberOfVersions: 1, hasPackingRequirements: C&P Campaign, hasPrice: 338.27 GBP, hasPrintedSides: Single sided, hasProductCategory: FSDU / Pallet Wrap / QPD, hasProofType: PDF digital proof, hasQuantity: 52, hasQuantityPerVersion: As per brief, hasRecycledContentBeenOffered: N/A, hasSupplierName: Simpson Group- Asda POS Only(Simpson Group- Asda POS & CCEP Only), hasTotalColours: 4, hasUnitOfMeasure: Millimetres (mm), ' - text: 'hasCreatedDate: 2024-05-21, hasCustomerHomeCountry: United Kingdom, hasCustomerID: 14239, hasCustomerName: Asda Stores Ltd(Asda (Spearmint)), hasCutting: Trim to size, hasElementID: 3298451, hasElementTitle: NRC7346_40 Rotis Serve Over Vinyl, hasFinishedSizeHeight: 670, hasFinishedSizeWidth: 490, hasFscPaperBeenSpecified: No, hasInternalID: 3fcd8a8c-4be3-4c55-bda1-397abc7859d5, hasMaterialCategory: Plastic, hasMaterialDescription: 85mic White High Tack Rem Wall and Floor, hasMaterialRecycledPercentage: 0%, hasMaterialThicknessOrWeight: 82, hasMaterialType: PET, hasMaterialUnitOfMeasure: Microns, hasNumberOfVersions: 2, hasPackingRequirements: Please pack as per allocation, overs to advanced, hasPrice: 183.96 GBP, hasPrintedSides: Single sided, hasProductCategory: Wallpapers/Decals, hasProofType: PDF digital proof, hasQuantity: 37, hasQuantityPerVersion: 18 off each, hasRecycledContentBeenOffered: N/A, hasSupplierName: Imprint Creative Print Solutions Limited(Imprint Creative Print Solutions Limited), hasTotalColours: 4, hasUnitOfMeasure: Millimetres (mm), ' - text: 'hasArtworkDoubleSidedStatus: Double Sided Different, hasColourDetails: 4/4 process, hasCreatedDate: 2024-06-03, hasCustomerHomeCountry: United States, hasCustomerID: 31740, hasCustomerName: National Grid (National Grid ), hasCutting: Trim to size, hasElementID: 3324866, hasElementTitle: CM9080 Forestport Event Energy Savings Postcard, hasFinishedSizeHeight: 5, hasFinishedSizeWidth: 7, hasFlatSizeHeight: 5, hasFlatSizeWidth: 7, hasFscPaperBeenSpecified: No, hasInternalID: e5b28942-c487-468c-8c60-fea3076d1ee5, hasMaterialCategory: Paper, hasMaterialDescription: matte, hasMaterialRecycledPercentage: 0%, hasMaterialThicknessOrWeight: 100, hasMaterialType: Paper and board, hasMaterialUnitOfMeasure: Pounds (lbs), hasNumberOfVersions: 1, hasPackingRequirements: Ship to, hasPaperType: Cover, hasPrice: 102.56 USD, hasPrintedSides: Double sided, hasProductCategory: Booklets & Brochures, hasProofType: PDF digital proof, hasQuantity: 50, hasRecycledContentBeenOffered: No, hasSupplierName: Ansun - HHG Strategic Partner(Ansun - 57666 - HHGSP - US Only), hasTotalColours: 4, hasTotalColoursFace: 4, hasUnitOfMeasure: Inches (in), ' - text: 'hasCreatedDate: 2024-10-15, hasCustomerHomeCountry: United States, hasCustomerID: 31735, hasCustomerName: Comcast Corporation(Comcast Corporation), hasCutting: Trim to size, hasElementID: 3568788, hasElementTitle: 2.x Install MWGs, hasFinishedSizeHeight: 101.25, hasFinishedSizeWidth: 96, hasFscPaperBeenSpecified: No, hasInternalID: 0bd0f9f3-3f06-40dc-b947-24e4e5c0c5da, hasMaterialCategory: Paper, hasMaterialDescription: New Life Magnetics .011 White Faced Magnetic Receptive, hasMaterialThicknessOrWeight: 11, hasMaterialType: Paper and board, hasMaterialUnitOfMeasure: Millimetres (mm), hasMinimumRecycledContent: 0%, hasNumberOfVersions: 1, hasPackingRequirements: packed with outer carton sticker and guides, hasPrice: 7371 USD, hasPrintedSides: Single sided, hasProductCategory: Banners (synthetic), hasProofType: PDF digital proof, hasQuantity: 45, hasRecycledContentBeenRequested: No, hasSupplierName: LPC TX VISUAL, LLC(LPC TX Visual, LLC/Lewisberg Printing -HHGSP), hasTotalColours: 4, 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: 3044610, hasElementTitle: G284498 Commodity Moulding Profile Card 77991, hasFinishedSizeHeight: 6.875, hasFinishedSizeWidth: 3, hasFlatSizeHeight: 6.875, hasFlatSizeWidth: 3, hasFscPaperBeenSpecified: No, hasInternalID: 671d6e41-c7c2-4c42-83ff-d1c87deb890b, 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.6077289571201694 name: F1_Micro - type: f1_macro value: 0.07809866671963865 name: F1_Macro - type: f1_weighted value: 0.5583804571604718 name: F1_Weighted - type: precision value: 0.9587973356246948 name: Precision - type: accuracy value: 0.9869484305381775 name: Accuracy - type: recall value: 0.4448463022708893 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 - **Classification head:** a OneVsRestClassifier instance - **Maximum Sequence Length:** 512 tokens - **Number of Classes:** 44 classes ### 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.6077 | 0.0781 | 0.5584 | 0.9588 | 0.9869 | 0.4448 | ## 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: 3044610, hasElementTitle: G284498 Commodity Moulding Profile Card 77991, hasFinishedSizeHeight: 6.875, hasFinishedSizeWidth: 3, hasFlatSizeHeight: 6.875, hasFlatSizeWidth: 3, hasFscPaperBeenSpecified: No, hasInternalID: 671d6e41-c7c2-4c42-83ff-d1c87deb890b, 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), ") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:---------|:----| | Word count | 62 | 109.9067 | 637 | ### 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} } ```