--- tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer widget: - text: 신한벽지 스케치 실크벽지 신비로운 새벽 폭106cm 1롤 15 5m 15099-1 가구/인테리어>DIY자재/용품>벽지>실크벽지 - text: 네오디움 사각 자석 가로x세로x높이 부영 마그네트 캐취 철물 자재 부속 BYNDSB-40-25-10 가구/인테리어>DIY자재/용품>가구부속품>경첩/꺽쇠/자석철물류 - text: 다용도 방수 알미늄 시트지 방유 주방 가구/인테리어>DIY자재/용품>시트지>타일시트지 - text: 카우보이 도어 스윙 1개 카운터 중문 바 협소 화장실 가구/인테리어>DIY자재/용품>리모델링>중문 - text: 피스커버 못자국 스티커 구멍 흠집 보수 가리기 가구/인테리어>DIY자재/용품>접착제/보수용품 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:** 14 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 | | | 4.0 | | | 9.0 | | | 13.0 | | | 7.0 | | | 11.0 | | | 3.0 | | | 12.0 | | | 0.0 | | | 5.0 | | | 1.0 | | | 2.0 | | | 10.0 | | | 8.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_fi0") # Run inference preds = model("다용도 방수 알미늄 시트지 방유 주방 가구/인테리어>DIY자재/용품>시트지>타일시트지") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:-------|:----| | Word count | 2 | 9.0153 | 20 | | 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 | ### 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.0052 | 1 | 0.4943 | - | | 0.2604 | 50 | 0.497 | - | | 0.5208 | 100 | 0.4938 | - | | 0.7812 | 150 | 0.454 | - | | 1.0417 | 200 | 0.31 | - | | 1.3021 | 250 | 0.0825 | - | | 1.5625 | 300 | 0.0174 | - | | 1.8229 | 350 | 0.0104 | - | | 2.0833 | 400 | 0.0018 | - | | 2.3438 | 450 | 0.0002 | - | | 2.6042 | 500 | 0.0001 | - | | 2.8646 | 550 | 0.0001 | - | | 3.125 | 600 | 0.0001 | - | | 3.3854 | 650 | 0.0001 | - | | 3.6458 | 700 | 0.0001 | - | | 3.9062 | 750 | 0.0 | - | | 4.1667 | 800 | 0.0 | - | | 4.4271 | 850 | 0.0 | - | | 4.6875 | 900 | 0.0 | - | | 4.9479 | 950 | 0.0 | - | | 5.2083 | 1000 | 0.0 | - | | 5.4688 | 1050 | 0.0 | - | | 5.7292 | 1100 | 0.0 | - | | 5.9896 | 1150 | 0.0 | - | | 6.25 | 1200 | 0.0 | - | | 6.5104 | 1250 | 0.0 | - | | 6.7708 | 1300 | 0.0 | - | | 7.0312 | 1350 | 0.0 | - | | 7.2917 | 1400 | 0.0 | - | | 7.5521 | 1450 | 0.0 | - | | 7.8125 | 1500 | 0.0 | - | | 8.0729 | 1550 | 0.0 | - | | 8.3333 | 1600 | 0.0 | - | | 8.5938 | 1650 | 0.0 | - | | 8.8542 | 1700 | 0.0 | - | | 9.1146 | 1750 | 0.0 | - | | 9.375 | 1800 | 0.0 | - | | 9.6354 | 1850 | 0.0 | - | | 9.8958 | 1900 | 0.0 | - | | 10.1562 | 1950 | 0.0 | - | | 10.4167 | 2000 | 0.0 | - | | 10.6771 | 2050 | 0.0 | - | | 10.9375 | 2100 | 0.0 | - | | 11.1979 | 2150 | 0.0 | - | | 11.4583 | 2200 | 0.0 | - | | 11.7188 | 2250 | 0.0 | - | | 11.9792 | 2300 | 0.0 | - | | 12.2396 | 2350 | 0.0 | - | | 12.5 | 2400 | 0.0 | - | | 12.7604 | 2450 | 0.0 | - | | 13.0208 | 2500 | 0.0 | - | | 13.2812 | 2550 | 0.0 | - | | 13.5417 | 2600 | 0.0 | - | | 13.8021 | 2650 | 0.0 | - | | 14.0625 | 2700 | 0.0 | - | | 14.3229 | 2750 | 0.0 | - | | 14.5833 | 2800 | 0.0 | - | | 14.8438 | 2850 | 0.0 | - | | 15.1042 | 2900 | 0.0 | - | | 15.3646 | 2950 | 0.0 | - | | 15.625 | 3000 | 0.0 | - | | 15.8854 | 3050 | 0.0 | - | | 16.1458 | 3100 | 0.0 | - | | 16.4062 | 3150 | 0.0 | - | | 16.6667 | 3200 | 0.0 | - | | 16.9271 | 3250 | 0.0 | - | | 17.1875 | 3300 | 0.0 | - | | 17.4479 | 3350 | 0.0 | - | | 17.7083 | 3400 | 0.0 | - | | 17.9688 | 3450 | 0.0 | - | | 18.2292 | 3500 | 0.0 | - | | 18.4896 | 3550 | 0.0 | - | | 18.75 | 3600 | 0.0 | - | | 19.0104 | 3650 | 0.0 | - | | 19.2708 | 3700 | 0.0 | - | | 19.5312 | 3750 | 0.0 | - | | 19.7917 | 3800 | 0.0 | - | | 20.0521 | 3850 | 0.0 | - | | 20.3125 | 3900 | 0.0 | - | | 20.5729 | 3950 | 0.0 | - | | 20.8333 | 4000 | 0.0 | - | | 21.0938 | 4050 | 0.0 | - | | 21.3542 | 4100 | 0.0 | - | | 21.6146 | 4150 | 0.0 | - | | 21.875 | 4200 | 0.0 | - | | 22.1354 | 4250 | 0.0 | - | | 22.3958 | 4300 | 0.0 | - | | 22.6562 | 4350 | 0.0 | - | | 22.9167 | 4400 | 0.0 | - | | 23.1771 | 4450 | 0.0 | - | | 23.4375 | 4500 | 0.0 | - | | 23.6979 | 4550 | 0.0 | - | | 23.9583 | 4600 | 0.0 | - | | 24.2188 | 4650 | 0.0 | - | | 24.4792 | 4700 | 0.0 | - | | 24.7396 | 4750 | 0.0 | - | | 25.0 | 4800 | 0.0 | - | | 25.2604 | 4850 | 0.0 | - | | 25.5208 | 4900 | 0.0 | - | | 25.7812 | 4950 | 0.0 | - | | 26.0417 | 5000 | 0.0 | - | | 26.3021 | 5050 | 0.0 | - | | 26.5625 | 5100 | 0.0 | - | | 26.8229 | 5150 | 0.0 | - | | 27.0833 | 5200 | 0.0 | - | | 27.3438 | 5250 | 0.0 | - | | 27.6042 | 5300 | 0.0 | - | | 27.8646 | 5350 | 0.0 | - | | 28.125 | 5400 | 0.0 | - | | 28.3854 | 5450 | 0.0 | - | | 28.6458 | 5500 | 0.0 | - | | 28.9062 | 5550 | 0.0 | - | | 29.1667 | 5600 | 0.0 | - | | 29.4271 | 5650 | 0.0 | - | | 29.6875 | 5700 | 0.0 | - | | 29.9479 | 5750 | 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} } ```