--- tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer widget: - text: 아기 모자 돌 유아 캡 털 모자 벙거지 비니 두돌 베레모 겨울 보넷 바라클라바 방한 [B타입] 바라클라바&방한모_B3-무지 바라클라바_블랙 출산/육아 > 유아동잡화 > 모자 - text: 23겨울 색종이장갑 노랑 출산/육아 > 유아동잡화 > 장갑 - text: 어린이 미니 캐릭터 공룡 크로스백 소지품 분실방지 힙색 공룡디자인 어린이크로스백 유아용가방 소지품보관 블루 출산/육아 > 유아동잡화 > 가방 > 크로스백 - text: 콜맨슈즈 바론2 아동 레인부츠 키즈장화 네이비_210 출산/육아 > 유아동잡화 > 신발 > 장화 - text: 마리앤키즈 유아 아동 아기 겨울 여아털구두 05_MK-R09_레인보우 퍼플_170 출산/육아 > 유아동잡화 > 신발 > 구두 metrics: - accuracy pipeline_tag: text-classification library_name: setfit inference: true base_model: mini1013/master_domain model-index: - name: SetFit with mini1013/master_domain results: - task: type: text-classification name: Text Classification dataset: name: Unknown type: unknown split: test metrics: - type: accuracy value: 1.0 name: Accuracy --- # SetFit with mini1013/master_domain This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [mini1013/master_domain](https://huggingface.co/mini1013/master_domain) 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. 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 body:** [mini1013/master_domain](https://huggingface.co/mini1013/master_domain) - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance - **Maximum Sequence Length:** 512 tokens - **Number of Classes:** 18 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) ### Model Labels | Label | Examples | |:------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 6.0 | | | 9.0 | | | 1.0 | | | 2.0 | | | 3.0 | | | 5.0 | | | 7.0 | | | 10.0 | | | 12.0 | | | 14.0 | | | 0.0 | | | 11.0 | | | 13.0 | | | 16.0 | | | 17.0 | | | 8.0 | | | 15.0 | | | 4.0 | | ## Evaluation ### Metrics | Label | Accuracy | |:--------|:---------| | **all** | 1.0 | ## 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("mini1013/master_cate_bc20") # Run inference preds = model("23겨울 색종이장갑 노랑 출산/육아 > 유아동잡화 > 장갑") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:--------|:----| | Word count | 7 | 15.3769 | 28 | | Label | Training Sample Count | |:------|:----------------------| | 0.0 | 70 | | 1.0 | 70 | | 2.0 | 70 | | 3.0 | 70 | | 4.0 | 70 | | 5.0 | 70 | | 6.0 | 70 | | 7.0 | 70 | | 8.0 | 70 | | 9.0 | 70 | | 10.0 | 70 | | 11.0 | 70 | | 12.0 | 70 | | 13.0 | 70 | | 14.0 | 70 | | 15.0 | 70 | | 16.0 | 20 | | 17.0 | 70 | ### Training Hyperparameters - batch_size: (256, 256) - num_epochs: (30, 30) - max_steps: -1 - sampling_strategy: oversampling - num_iterations: 50 - body_learning_rate: (2e-05, 1e-05) - head_learning_rate: 0.01 - loss: CosineSimilarityLoss - distance_metric: cosine_distance - margin: 0.25 - end_to_end: False - use_amp: False - warmup_proportion: 0.1 - l2_weight: 0.01 - seed: 42 - eval_max_steps: -1 - load_best_model_at_end: False ### Training Results | Epoch | Step | Training Loss | Validation Loss | |:-------:|:----:|:-------------:|:---------------:| | 0.0042 | 1 | 0.4815 | - | | 0.2110 | 50 | 0.5015 | - | | 0.4219 | 100 | 0.425 | - | | 0.6329 | 150 | 0.1055 | - | | 0.8439 | 200 | 0.035 | - | | 1.0549 | 250 | 0.0152 | - | | 1.2658 | 300 | 0.0077 | - | | 1.4768 | 350 | 0.0043 | - | | 1.6878 | 400 | 0.0018 | - | | 1.8987 | 450 | 0.0008 | - | | 2.1097 | 500 | 0.0009 | - | | 2.3207 | 550 | 0.0008 | - | | 2.5316 | 600 | 0.0006 | - | | 2.7426 | 650 | 0.0004 | - | | 2.9536 | 700 | 0.0002 | - | | 3.1646 | 750 | 0.0001 | - | | 3.3755 | 800 | 0.0001 | - | | 3.5865 | 850 | 0.0001 | - | | 3.7975 | 900 | 0.0001 | - | | 4.0084 | 950 | 0.0 | - | | 4.2194 | 1000 | 0.0 | - | | 4.4304 | 1050 | 0.0 | - | | 4.6414 | 1100 | 0.0 | - | | 4.8523 | 1150 | 0.0 | - | | 5.0633 | 1200 | 0.0 | - | | 5.2743 | 1250 | 0.0 | - | | 5.4852 | 1300 | 0.0 | - | | 5.6962 | 1350 | 0.0 | - | | 5.9072 | 1400 | 0.0 | - | | 6.1181 | 1450 | 0.0 | - | | 6.3291 | 1500 | 0.0 | - | | 6.5401 | 1550 | 0.0 | - | | 6.7511 | 1600 | 0.0 | - | | 6.9620 | 1650 | 0.0 | - | | 7.1730 | 1700 | 0.0 | - | | 7.3840 | 1750 | 0.0 | - | | 7.5949 | 1800 | 0.0 | - | | 7.8059 | 1850 | 0.0 | - | | 8.0169 | 1900 | 0.0 | - | | 8.2278 | 1950 | 0.0 | - | | 8.4388 | 2000 | 0.0 | - | | 8.6498 | 2050 | 0.0 | - | | 8.8608 | 2100 | 0.0 | - | | 9.0717 | 2150 | 0.0 | - | | 9.2827 | 2200 | 0.0 | - | | 9.4937 | 2250 | 0.0 | - | | 9.7046 | 2300 | 0.0 | - | | 9.9156 | 2350 | 0.0 | - | | 10.1266 | 2400 | 0.0 | - | | 10.3376 | 2450 | 0.0 | - | | 10.5485 | 2500 | 0.0 | - | | 10.7595 | 2550 | 0.0 | - | | 10.9705 | 2600 | 0.0 | - | | 11.1814 | 2650 | 0.0 | - | | 11.3924 | 2700 | 0.0 | - | | 11.6034 | 2750 | 0.0 | - | | 11.8143 | 2800 | 0.0 | - | | 12.0253 | 2850 | 0.0 | - | | 12.2363 | 2900 | 0.0 | - | | 12.4473 | 2950 | 0.0 | - | | 12.6582 | 3000 | 0.0 | - | | 12.8692 | 3050 | 0.0 | - | | 13.0802 | 3100 | 0.0 | - | | 13.2911 | 3150 | 0.0 | - | | 13.5021 | 3200 | 0.0 | - | | 13.7131 | 3250 | 0.0 | - | | 13.9241 | 3300 | 0.0 | - | | 14.1350 | 3350 | 0.0 | - | | 14.3460 | 3400 | 0.0 | - | | 14.5570 | 3450 | 0.0 | - | | 14.7679 | 3500 | 0.0 | - | | 14.9789 | 3550 | 0.0 | - | | 15.1899 | 3600 | 0.0 | - | | 15.4008 | 3650 | 0.0 | - | | 15.6118 | 3700 | 0.0 | - | | 15.8228 | 3750 | 0.0 | - | | 16.0338 | 3800 | 0.0 | - | | 16.2447 | 3850 | 0.0 | - | | 16.4557 | 3900 | 0.0 | - | | 16.6667 | 3950 | 0.0 | - | | 16.8776 | 4000 | 0.0 | - | | 17.0886 | 4050 | 0.0 | - | | 17.2996 | 4100 | 0.0 | - | | 17.5105 | 4150 | 0.0 | - | | 17.7215 | 4200 | 0.0 | - | | 17.9325 | 4250 | 0.0 | - | | 18.1435 | 4300 | 0.0 | - | | 18.3544 | 4350 | 0.0 | - | | 18.5654 | 4400 | 0.0 | - | | 18.7764 | 4450 | 0.0 | - | | 18.9873 | 4500 | 0.0 | - | | 19.1983 | 4550 | 0.0 | - | | 19.4093 | 4600 | 0.0 | - | | 19.6203 | 4650 | 0.0 | - | | 19.8312 | 4700 | 0.0 | - | | 20.0422 | 4750 | 0.0 | - | | 20.2532 | 4800 | 0.0 | - | | 20.4641 | 4850 | 0.0 | - | | 20.6751 | 4900 | 0.0 | - | | 20.8861 | 4950 | 0.0 | - | | 21.0970 | 5000 | 0.0 | - | | 21.3080 | 5050 | 0.0 | - | | 21.5190 | 5100 | 0.0 | - | | 21.7300 | 5150 | 0.0 | - | | 21.9409 | 5200 | 0.0 | - | | 22.1519 | 5250 | 0.0 | - | | 22.3629 | 5300 | 0.0 | - | | 22.5738 | 5350 | 0.0 | - | | 22.7848 | 5400 | 0.0 | - | | 22.9958 | 5450 | 0.0 | - | | 23.2068 | 5500 | 0.0 | - | | 23.4177 | 5550 | 0.0 | - | | 23.6287 | 5600 | 0.0 | - | | 23.8397 | 5650 | 0.0 | - | | 24.0506 | 5700 | 0.0 | - | | 24.2616 | 5750 | 0.0 | - | | 24.4726 | 5800 | 0.0 | - | | 24.6835 | 5850 | 0.0 | - | | 24.8945 | 5900 | 0.0 | - | | 25.1055 | 5950 | 0.0 | - | | 25.3165 | 6000 | 0.0 | - | | 25.5274 | 6050 | 0.0 | - | | 25.7384 | 6100 | 0.0 | - | | 25.9494 | 6150 | 0.0 | - | | 26.1603 | 6200 | 0.0 | - | | 26.3713 | 6250 | 0.0 | - | | 26.5823 | 6300 | 0.0 | - | | 26.7932 | 6350 | 0.0 | - | | 27.0042 | 6400 | 0.0 | - | | 27.2152 | 6450 | 0.0 | - | | 27.4262 | 6500 | 0.0 | - | | 27.6371 | 6550 | 0.0 | - | | 27.8481 | 6600 | 0.0 | - | | 28.0591 | 6650 | 0.0 | - | | 28.2700 | 6700 | 0.0 | - | | 28.4810 | 6750 | 0.0 | - | | 28.6920 | 6800 | 0.0 | - | | 28.9030 | 6850 | 0.0 | - | | 29.1139 | 6900 | 0.0 | - | | 29.3249 | 6950 | 0.0 | - | | 29.5359 | 7000 | 0.0 | - | | 29.7468 | 7050 | 0.0 | - | | 29.9578 | 7100 | 0.0 | - | ### Framework Versions - Python: 3.10.12 - SetFit: 1.1.0 - Sentence Transformers: 3.3.1 - Transformers: 4.44.2 - PyTorch: 2.2.0a0+81ea7a4 - Datasets: 3.2.0 - Tokenizers: 0.19.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} } ```