--- base_model: klue/roberta-base library_name: setfit metrics: - accuracy pipeline_tag: text-classification tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer widget: - text: 3CE 아이 스위치 스턱 옵션없음 오로라 - text: 데이셀 모발아 탈모 새치케어 더마 스칼프 블랙턴 앤 프로틴 앰플 20ml×3개 옵션없음 주식회사 케이티알파 - text: 라운드랩 1025 독도 클렌징 밀크 200ml 옵션없음 혜담몰 - text: '[네이처리퍼블릭] 블랙빈 탈모증상 완화 두피 토닉 120ml 블랙빈 탈모증상 완화 두피 토닉 (주)네이처리퍼블릭' - text: AHC 텐 레볼루션 리얼 아이크림 포 페이스 12ml 1. 시즌10 아이크림 12ml (주)여인닷컴 inference: true model-index: - name: SetFit with klue/roberta-base results: - task: type: text-classification name: Text Classification dataset: name: Unknown type: unknown split: test metrics: - type: accuracy value: 0.7789760472244296 name: Accuracy --- # SetFit with klue/roberta-base This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [klue/roberta-base](https://huggingface.co/klue/roberta-base) 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:** [klue/roberta-base](https://huggingface.co/klue/roberta-base) - **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:** 13 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 | |:------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1.0 | | | 7.0 | | | 12.0 | | | 2.0 | | | 8.0 | | | 6.0 | | | 0.0 | | | 4.0 | | | 9.0 | | | 10.0 | | | 11.0 | | | 5.0 | | | 3.0 | | ## Evaluation ### Metrics | Label | Accuracy | |:--------|:---------| | **all** | 0.7790 | ## 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_item_bt_test") # Run inference preds = model("3CE 아이 스위치 스턱 옵션없음 오로라") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:-------|:----| | Word count | 3 | 9.3971 | 26 | | Label | Training Sample Count | |:------|:----------------------| | 0.0 | 242 | | 1.0 | 134 | | 2.0 | 161 | | 3.0 | 324 | | 4.0 | 141 | | 5.0 | 130 | | 6.0 | 267 | | 7.0 | 133 | | 8.0 | 257 | | 9.0 | 251 | | 10.0 | 63 | | 11.0 | 117 | | 12.0 | 152 | ### Training Hyperparameters - batch_size: (512, 512) - num_epochs: (30, 30) - max_steps: -1 - sampling_strategy: oversampling - num_iterations: 60 - 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.0036 | 1 | 0.4074 | - | | 0.1799 | 50 | 0.3948 | - | | 0.3597 | 100 | 0.3285 | - | | 0.5396 | 150 | 0.2768 | - | | 0.7194 | 200 | 0.2286 | - | | 0.8993 | 250 | 0.1882 | - | | 1.0791 | 300 | 0.1492 | - | | 1.2590 | 350 | 0.1029 | - | | 1.4388 | 400 | 0.067 | - | | 1.6187 | 450 | 0.0507 | - | | 1.7986 | 500 | 0.0397 | - | | 1.9784 | 550 | 0.0346 | - | | 2.1583 | 600 | 0.0314 | - | | 2.3381 | 650 | 0.0302 | - | | 2.5180 | 700 | 0.0273 | - | | 2.6978 | 750 | 0.0248 | - | | 2.8777 | 800 | 0.022 | - | | 3.0576 | 850 | 0.0192 | - | | 3.2374 | 900 | 0.0122 | - | | 3.4173 | 950 | 0.0077 | - | | 3.5971 | 1000 | 0.007 | - | | 3.7770 | 1050 | 0.0054 | - | | 3.9568 | 1100 | 0.0044 | - | | 4.1367 | 1150 | 0.0038 | - | | 4.3165 | 1200 | 0.0035 | - | | 4.4964 | 1250 | 0.0036 | - | | 4.6763 | 1300 | 0.0026 | - | | 4.8561 | 1350 | 0.0008 | - | | 5.0360 | 1400 | 0.0005 | - | | 5.2158 | 1450 | 0.0003 | - | | 5.3957 | 1500 | 0.0003 | - | | 5.5755 | 1550 | 0.0002 | - | | 5.7554 | 1600 | 0.0002 | - | | 5.9353 | 1650 | 0.0002 | - | | 6.1151 | 1700 | 0.0003 | - | | 6.2950 | 1750 | 0.0002 | - | | 6.4748 | 1800 | 0.0003 | - | | 6.6547 | 1850 | 0.0002 | - | | 6.8345 | 1900 | 0.0001 | - | | 7.0144 | 1950 | 0.0001 | - | | 7.1942 | 2000 | 0.0002 | - | | 7.3741 | 2050 | 0.0002 | - | | 7.5540 | 2100 | 0.0001 | - | | 7.7338 | 2150 | 0.0001 | - | | 7.9137 | 2200 | 0.0001 | - | | 8.0935 | 2250 | 0.0001 | - | | 8.2734 | 2300 | 0.0001 | - | | 8.4532 | 2350 | 0.0002 | - | | 8.6331 | 2400 | 0.0002 | - | | 8.8129 | 2450 | 0.0002 | - | | 8.9928 | 2500 | 0.0001 | - | | 9.1727 | 2550 | 0.0001 | - | | 9.3525 | 2600 | 0.0001 | - | | 9.5324 | 2650 | 0.0008 | - | | 9.7122 | 2700 | 0.0003 | - | | 9.8921 | 2750 | 0.0002 | - | | 10.0719 | 2800 | 0.0005 | - | | 10.2518 | 2850 | 0.0002 | - | | 10.4317 | 2900 | 0.0001 | - | | 10.6115 | 2950 | 0.0001 | - | | 10.7914 | 3000 | 0.0001 | - | | 10.9712 | 3050 | 0.0001 | - | | 11.1511 | 3100 | 0.0 | - | | 11.3309 | 3150 | 0.0 | - | | 11.5108 | 3200 | 0.0 | - | | 11.6906 | 3250 | 0.0 | - | | 11.8705 | 3300 | 0.0 | - | | 12.0504 | 3350 | 0.0 | - | | 12.2302 | 3400 | 0.0 | - | | 12.4101 | 3450 | 0.0 | - | | 12.5899 | 3500 | 0.0 | - | | 12.7698 | 3550 | 0.0 | - | | 12.9496 | 3600 | 0.0 | - | | 13.1295 | 3650 | 0.0 | - | | 13.3094 | 3700 | 0.0 | - | | 13.4892 | 3750 | 0.0 | - | | 13.6691 | 3800 | 0.0 | - | | 13.8489 | 3850 | 0.0 | - | | 14.0288 | 3900 | 0.0 | - | | 14.2086 | 3950 | 0.0 | - | | 14.3885 | 4000 | 0.0 | - | | 14.5683 | 4050 | 0.0 | - | | 14.7482 | 4100 | 0.0 | - | | 14.9281 | 4150 | 0.0 | - | | 15.1079 | 4200 | 0.0 | - | | 15.2878 | 4250 | 0.0 | - | | 15.4676 | 4300 | 0.0 | - | | 15.6475 | 4350 | 0.0 | - | | 15.8273 | 4400 | 0.0003 | - | | 16.0072 | 4450 | 0.0002 | - | | 16.1871 | 4500 | 0.0001 | - | | 16.3669 | 4550 | 0.0 | - | | 16.5468 | 4600 | 0.0 | - | | 16.7266 | 4650 | 0.0 | - | | 16.9065 | 4700 | 0.0 | - | | 17.0863 | 4750 | 0.0002 | - | | 17.2662 | 4800 | 0.0002 | - | | 17.4460 | 4850 | 0.0001 | - | | 17.6259 | 4900 | 0.0 | - | | 17.8058 | 4950 | 0.0 | - | | 17.9856 | 5000 | 0.0 | - | | 18.1655 | 5050 | 0.0 | - | | 18.3453 | 5100 | 0.0 | - | | 18.5252 | 5150 | 0.0 | - | | 18.7050 | 5200 | 0.0 | - | | 18.8849 | 5250 | 0.0 | - | | 19.0647 | 5300 | 0.0 | - | | 19.2446 | 5350 | 0.0 | - | | 19.4245 | 5400 | 0.0 | - | | 19.6043 | 5450 | 0.0 | - | | 19.7842 | 5500 | 0.0 | - | | 19.9640 | 5550 | 0.0 | - | | 20.1439 | 5600 | 0.0001 | - | | 20.3237 | 5650 | 0.0001 | - | | 20.5036 | 5700 | 0.0001 | - | | 20.6835 | 5750 | 0.0001 | - | | 20.8633 | 5800 | 0.0 | - | | 21.0432 | 5850 | 0.0 | - | | 21.2230 | 5900 | 0.0 | - | | 21.4029 | 5950 | 0.0001 | - | | 21.5827 | 6000 | 0.0001 | - | | 21.7626 | 6050 | 0.0001 | - | | 21.9424 | 6100 | 0.0 | - | | 22.1223 | 6150 | 0.0 | - | | 22.3022 | 6200 | 0.0 | - | | 22.4820 | 6250 | 0.0 | - | | 22.6619 | 6300 | 0.0 | - | | 22.8417 | 6350 | 0.0 | - | | 23.0216 | 6400 | 0.0 | - | | 23.2014 | 6450 | 0.0 | - | | 23.3813 | 6500 | 0.0 | - | | 23.5612 | 6550 | 0.0 | - | | 23.7410 | 6600 | 0.0 | - | | 23.9209 | 6650 | 0.0 | - | | 24.1007 | 6700 | 0.0 | - | | 24.2806 | 6750 | 0.0 | - | | 24.4604 | 6800 | 0.0 | - | | 24.6403 | 6850 | 0.0 | - | | 24.8201 | 6900 | 0.0 | - | | 25.0 | 6950 | 0.0 | - | | 25.1799 | 7000 | 0.0 | - | | 25.3597 | 7050 | 0.0 | - | | 25.5396 | 7100 | 0.0 | - | | 25.7194 | 7150 | 0.0 | - | | 25.8993 | 7200 | 0.0 | - | | 26.0791 | 7250 | 0.0 | - | | 26.2590 | 7300 | 0.0 | - | | 26.4388 | 7350 | 0.0 | - | | 26.6187 | 7400 | 0.0 | - | | 26.7986 | 7450 | 0.0 | - | | 26.9784 | 7500 | 0.0 | - | | 27.1583 | 7550 | 0.0 | - | | 27.3381 | 7600 | 0.0 | - | | 27.5180 | 7650 | 0.0 | - | | 27.6978 | 7700 | 0.0 | - | | 27.8777 | 7750 | 0.0 | - | | 28.0576 | 7800 | 0.0 | - | | 28.2374 | 7850 | 0.0 | - | | 28.4173 | 7900 | 0.0 | - | | 28.5971 | 7950 | 0.0 | - | | 28.7770 | 8000 | 0.0 | - | | 28.9568 | 8050 | 0.0 | - | | 29.1367 | 8100 | 0.0 | - | | 29.3165 | 8150 | 0.0 | - | | 29.4964 | 8200 | 0.0 | - | | 29.6763 | 8250 | 0.0 | - | | 29.8561 | 8300 | 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} } ```