--- base_model: mini1013/master_domain library_name: setfit metrics: - metric pipeline_tag: text-classification tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer widget: - text: 귀뚜라미 전기 온수기 50리터 저장식 식당 카페 미용실 온수기 설치 KDEW 상품만 구매(셀프설치)_G-15(벽걸이형) 조아홈시스 - text: 크레모아 선풍기 V1040 서큘레이터 웜그레이 (주)가야미 - text: '[나비아] 가스히터 SGH-200 낚시 1번지(피싱매니저)' - text: 바이빔 닥스훈트 전기방석[1인용] 1인용 주식회사 바이빔 - text: '[정발 한국판] [샤오미코리아 정품][온라인총판 직영점] 미에어 스마트 4 AC-M16-SC 공기청정기 미에어 공기청정기4(AC-M16-SC) (주)더데이' inference: true 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: metric value: 0.87719191055172 name: Metric --- # 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:** 19 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 | |:------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 12 | | | 8 | | | 9 | | | 5 | | | 18 | | | 1 | | | 10 | | | 11 | | | 3 | | | 15 | | | 0 | | | 7 | | | 4 | | | 14 | | | 6 | | | 16 | | | 13 | | | 17 | | | 2 | | ## Evaluation ### Metrics | Label | Metric | |:--------|:-------| | **all** | 0.8772 | ## 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_el4") # Run inference preds = model("바이빔 닥스훈트 전기방석[1인용] 1인용 주식회사 바이빔") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:-------|:----| | Word count | 3 | 9.2892 | 26 | | Label | Training Sample Count | |:------|:----------------------| | 0 | 50 | | 1 | 50 | | 2 | 13 | | 3 | 50 | | 4 | 50 | | 5 | 50 | | 6 | 50 | | 7 | 50 | | 8 | 50 | | 9 | 50 | | 10 | 50 | | 11 | 50 | | 12 | 50 | | 13 | 50 | | 14 | 50 | | 15 | 50 | | 16 | 50 | | 17 | 50 | | 18 | 50 | ### Training Hyperparameters - batch_size: (512, 512) - num_epochs: (20, 20) - max_steps: -1 - sampling_strategy: oversampling - num_iterations: 40 - body_learning_rate: (2e-05, 2e-05) - head_learning_rate: 2e-05 - loss: CosineSimilarityLoss - distance_metric: cosine_distance - margin: 0.25 - end_to_end: False - use_amp: False - warmup_proportion: 0.1 - seed: 42 - eval_max_steps: -1 - load_best_model_at_end: False ### Training Results | Epoch | Step | Training Loss | Validation Loss | |:-------:|:----:|:-------------:|:---------------:| | 0.0070 | 1 | 0.4968 | - | | 0.3497 | 50 | 0.3841 | - | | 0.6993 | 100 | 0.1946 | - | | 1.0490 | 150 | 0.1001 | - | | 1.3986 | 200 | 0.0434 | - | | 1.7483 | 250 | 0.0383 | - | | 2.0979 | 300 | 0.0221 | - | | 2.4476 | 350 | 0.0183 | - | | 2.7972 | 400 | 0.0279 | - | | 3.1469 | 450 | 0.0213 | - | | 3.4965 | 500 | 0.0159 | - | | 3.8462 | 550 | 0.0169 | - | | 4.1958 | 600 | 0.012 | - | | 4.5455 | 650 | 0.0093 | - | | 4.8951 | 700 | 0.004 | - | | 5.2448 | 750 | 0.001 | - | | 5.5944 | 800 | 0.0061 | - | | 5.9441 | 850 | 0.0061 | - | | 6.2937 | 900 | 0.0014 | - | | 6.6434 | 950 | 0.0005 | - | | 6.9930 | 1000 | 0.0003 | - | | 7.3427 | 1050 | 0.0002 | - | | 7.6923 | 1100 | 0.0002 | - | | 8.0420 | 1150 | 0.0002 | - | | 8.3916 | 1200 | 0.0002 | - | | 8.7413 | 1250 | 0.0002 | - | | 9.0909 | 1300 | 0.0001 | - | | 9.4406 | 1350 | 0.0002 | - | | 9.7902 | 1400 | 0.0001 | - | | 10.1399 | 1450 | 0.0001 | - | | 10.4895 | 1500 | 0.0001 | - | | 10.8392 | 1550 | 0.0001 | - | | 11.1888 | 1600 | 0.0001 | - | | 11.5385 | 1650 | 0.0001 | - | | 11.8881 | 1700 | 0.0001 | - | | 12.2378 | 1750 | 0.0001 | - | | 12.5874 | 1800 | 0.0001 | - | | 12.9371 | 1850 | 0.0001 | - | | 13.2867 | 1900 | 0.0001 | - | | 13.6364 | 1950 | 0.0001 | - | | 13.9860 | 2000 | 0.0001 | - | | 14.3357 | 2050 | 0.0001 | - | | 14.6853 | 2100 | 0.0001 | - | | 15.0350 | 2150 | 0.0001 | - | | 15.3846 | 2200 | 0.0001 | - | | 15.7343 | 2250 | 0.0001 | - | | 16.0839 | 2300 | 0.0001 | - | | 16.4336 | 2350 | 0.0001 | - | | 16.7832 | 2400 | 0.0001 | - | | 17.1329 | 2450 | 0.0001 | - | | 17.4825 | 2500 | 0.0001 | - | | 17.8322 | 2550 | 0.0001 | - | | 18.1818 | 2600 | 0.0001 | - | | 18.5315 | 2650 | 0.0 | - | | 18.8811 | 2700 | 0.0001 | - | | 19.2308 | 2750 | 0.0001 | - | | 19.5804 | 2800 | 0.0001 | - | | 19.9301 | 2850 | 0.0001 | - | ### Framework Versions - Python: 3.10.12 - SetFit: 1.1.0.dev0 - Sentence Transformers: 3.1.1 - Transformers: 4.46.1 - PyTorch: 2.4.0+cu121 - Datasets: 2.20.0 - Tokenizers: 0.20.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} } ```