--- tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer widget: - text: 아기 기저귀가방 숄더백 출산가방 애기 엄마 분유가방 그레이 출산/육아 > 외출용품 > 기저귀가방 - text: '[에시앙]모데즈 유모차라이너+목쿠션 (디자인선택) 레몬 출산/육아 > 외출용품 > 기타외출용품' - text: 비트윈 뱀부 사일런스 아기띠 힙시트 무소음클립 허리벨트 올인원 3in1 쿨그레이 출산/육아 > 외출용품 > 힙시트 - text: 팔찌형 스프 랑 미아방지 밴드 다용도 유모차 가방 어린이 끈 아가 유아 용품 줄 아기 링 오렌지1P 출산/육아 > 외출용품 > 미아방지용품 - text: 허리 러닝 파우치 런닝 휴대폰 스마트폰 벨트 달리기용품rva-559636c 프리사이즈_랙 출산/육아 > 외출용품 > 슬링 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:** 10 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 | |:------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 8.0 | | | 3.0 | | | 5.0 | | | 2.0 | | | 0.0 | | | 1.0 | | | 7.0 | | | 4.0 | | | 6.0 | | | 9.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_bc14") # Run inference preds = model("[에시앙]모데즈 유모차라이너+목쿠션 (디자인선택) 레몬 출산/육아 > 외출용품 > 기타외출용품") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:--------|:----| | Word count | 7 | 14.5385 | 42 | | Label | Training Sample Count | |:------|:----------------------| | 0.0 | 70 | | 1.0 | 70 | | 2.0 | 70 | | 3.0 | 70 | | 4.0 | 70 | | 5.0 | 70 | | 6.0 | 20 | | 7.0 | 70 | | 8.0 | 70 | | 9.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.0079 | 1 | 0.4929 | - | | 0.3937 | 50 | 0.4972 | - | | 0.7874 | 100 | 0.4631 | - | | 1.1811 | 150 | 0.0622 | - | | 1.5748 | 200 | 0.0077 | - | | 1.9685 | 250 | 0.0002 | - | | 2.3622 | 300 | 0.0001 | - | | 2.7559 | 350 | 0.0 | - | | 3.1496 | 400 | 0.0 | - | | 3.5433 | 450 | 0.0 | - | | 3.9370 | 500 | 0.0 | - | | 4.3307 | 550 | 0.0 | - | | 4.7244 | 600 | 0.0 | - | | 5.1181 | 650 | 0.0 | - | | 5.5118 | 700 | 0.0 | - | | 5.9055 | 750 | 0.0 | - | | 6.2992 | 800 | 0.0 | - | | 6.6929 | 850 | 0.0 | - | | 7.0866 | 900 | 0.0 | - | | 7.4803 | 950 | 0.0 | - | | 7.8740 | 1000 | 0.0 | - | | 8.2677 | 1050 | 0.0 | - | | 8.6614 | 1100 | 0.0 | - | | 9.0551 | 1150 | 0.0 | - | | 9.4488 | 1200 | 0.0 | - | | 9.8425 | 1250 | 0.0 | - | | 10.2362 | 1300 | 0.0 | - | | 10.6299 | 1350 | 0.0 | - | | 11.0236 | 1400 | 0.0 | - | | 11.4173 | 1450 | 0.0 | - | | 11.8110 | 1500 | 0.0 | - | | 12.2047 | 1550 | 0.0 | - | | 12.5984 | 1600 | 0.0 | - | | 12.9921 | 1650 | 0.0 | - | | 13.3858 | 1700 | 0.0 | - | | 13.7795 | 1750 | 0.0 | - | | 14.1732 | 1800 | 0.0 | - | | 14.5669 | 1850 | 0.0 | - | | 14.9606 | 1900 | 0.0 | - | | 15.3543 | 1950 | 0.0 | - | | 15.7480 | 2000 | 0.0 | - | | 16.1417 | 2050 | 0.0 | - | | 16.5354 | 2100 | 0.0 | - | | 16.9291 | 2150 | 0.0 | - | | 17.3228 | 2200 | 0.0 | - | | 17.7165 | 2250 | 0.0 | - | | 18.1102 | 2300 | 0.0 | - | | 18.5039 | 2350 | 0.0 | - | | 18.8976 | 2400 | 0.0 | - | | 19.2913 | 2450 | 0.0 | - | | 19.6850 | 2500 | 0.0 | - | | 20.0787 | 2550 | 0.0 | - | | 20.4724 | 2600 | 0.0 | - | | 20.8661 | 2650 | 0.0 | - | | 21.2598 | 2700 | 0.0 | - | | 21.6535 | 2750 | 0.0 | - | | 22.0472 | 2800 | 0.0 | - | | 22.4409 | 2850 | 0.0 | - | | 22.8346 | 2900 | 0.0 | - | | 23.2283 | 2950 | 0.0 | - | | 23.6220 | 3000 | 0.0 | - | | 24.0157 | 3050 | 0.0 | - | | 24.4094 | 3100 | 0.0 | - | | 24.8031 | 3150 | 0.0 | - | | 25.1969 | 3200 | 0.0 | - | | 25.5906 | 3250 | 0.0 | - | | 25.9843 | 3300 | 0.0 | - | | 26.3780 | 3350 | 0.0 | - | | 26.7717 | 3400 | 0.0 | - | | 27.1654 | 3450 | 0.0 | - | | 27.5591 | 3500 | 0.0 | - | | 27.9528 | 3550 | 0.0 | - | | 28.3465 | 3600 | 0.0 | - | | 28.7402 | 3650 | 0.0 | - | | 29.1339 | 3700 | 0.0 | - | | 29.5276 | 3750 | 0.0 | - | | 29.9213 | 3800 | 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} } ```