--- library_name: setfit tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer metrics: - accuracy widget: - text: スマホやタブレットPC、Oculus GOやVIVE、Apple Watchなど新しいデバイス向けアプリの企画・開発を行うスタートアップ。 - text: ベンチャー企業へのハンズオン投資などを行うベンチャーキャピタル。 - text: GoogleカレンダーやZoomと連携してスケジュール調整を自動化する日程調整ツール「Jicoo」を開発、提供するスタートアップ - text: 住まい探しに特化したウェブサイト「TOKYO APARTMENTS」を提供する企業。 - text: 医療機器、産業機器の研究開発・製造販売を行う企業。 pipeline_tag: text-classification inference: false model-index: - name: SetFit results: - task: type: text-classification name: Text Classification dataset: name: Unknown type: unknown split: test metrics: - type: accuracy value: 0.7272727272727273 name: Accuracy --- # SetFit This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. A OneVsRestClassifier 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 - **Classification head:** a OneVsRestClassifier instance - **Maximum Sequence Length:** 512 tokens ### 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) ## Evaluation ### Metrics | Label | Accuracy | |:--------|:---------| | **all** | 0.7273 | ## 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("Ekohe/RevenueStreamJP") # Run inference preds = model("医療機器、産業機器の研究開発・製造販売を行う企業。") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:-------|:----| | Word count | 1 | 1.9824 | 57 | ### Training Hyperparameters - batch_size: (10, 10) - num_epochs: (35, 35) - max_steps: -1 - sampling_strategy: oversampling - num_iterations: 3 - 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.0029 | 1 | 0.2602 | - | | 0.1462 | 50 | 0.25 | - | | 0.2924 | 100 | 0.1712 | - | | 0.4386 | 150 | 0.2671 | - | | 0.5848 | 200 | 0.2288 | - | | 0.7310 | 250 | 0.2253 | - | | 0.8772 | 300 | 0.2675 | - | | 1.0234 | 350 | 0.1204 | - | | 1.1696 | 400 | 0.1185 | - | | 1.3158 | 450 | 0.1884 | - | | 1.4620 | 500 | 0.2311 | - | | 1.6082 | 550 | 0.0659 | - | | 1.7544 | 600 | 0.1719 | - | | 1.9006 | 650 | 0.0094 | - | | 2.0468 | 700 | 0.0237 | - | | 2.1930 | 750 | 0.0007 | - | | 2.3392 | 800 | 0.0021 | - | | 2.4854 | 850 | 0.0013 | - | | 2.6316 | 900 | 0.1887 | - | | 2.7778 | 950 | 0.0004 | - | | 2.9240 | 1000 | 0.0001 | - | | 3.0702 | 1050 | 0.0003 | - | | 3.2164 | 1100 | 0.0764 | - | | 3.3626 | 1150 | 0.0025 | - | | 3.5088 | 1200 | 0.0001 | - | | 3.6550 | 1250 | 0.0001 | - | | 3.8012 | 1300 | 0.0001 | - | | 3.9474 | 1350 | 0.0001 | - | | 4.0936 | 1400 | 0.0 | - | | 4.2398 | 1450 | 0.0001 | - | | 4.3860 | 1500 | 0.0001 | - | | 4.5322 | 1550 | 0.0 | - | | 4.6784 | 1600 | 0.0 | - | | 4.8246 | 1650 | 0.0 | - | | 4.9708 | 1700 | 0.0 | - | | 5.1170 | 1750 | 0.0001 | - | | 5.2632 | 1800 | 0.0 | - | | 5.4094 | 1850 | 0.0 | - | | 5.5556 | 1900 | 0.0 | - | | 5.7018 | 1950 | 0.0883 | - | | 5.8480 | 2000 | 0.0 | - | | 5.9942 | 2050 | 0.0 | - | | 6.1404 | 2100 | 0.0 | - | | 6.2865 | 2150 | 0.0 | - | | 6.4327 | 2200 | 0.0 | - | | 6.5789 | 2250 | 0.0 | - | | 6.7251 | 2300 | 0.0 | - | | 6.8713 | 2350 | 0.0 | - | | 7.0175 | 2400 | 0.0 | - | | 7.1637 | 2450 | 0.0 | - | | 7.3099 | 2500 | 0.0 | - | | 7.4561 | 2550 | 0.0 | - | | 7.6023 | 2600 | 0.0 | - | | 7.7485 | 2650 | 0.0 | - | | 7.8947 | 2700 | 0.0 | - | | 8.0409 | 2750 | 0.0 | - | | 8.1871 | 2800 | 0.0 | - | | 8.3333 | 2850 | 0.0 | - | | 8.4795 | 2900 | 0.0 | - | | 8.6257 | 2950 | 0.0 | - | | 8.7719 | 3000 | 0.0 | - | | 8.9181 | 3050 | 0.0 | - | | 9.0643 | 3100 | 0.0 | - | | 9.2105 | 3150 | 0.0 | - | | 9.3567 | 3200 | 0.0 | - | | 9.5029 | 3250 | 0.0618 | - | | 9.6491 | 3300 | 0.3522 | - | | 9.7953 | 3350 | 0.0051 | - | | 9.9415 | 3400 | 0.0002 | - | | 10.0877 | 3450 | 0.0018 | - | | 10.2339 | 3500 | 0.0027 | - | | 10.3801 | 3550 | 0.0001 | - | | 10.5263 | 3600 | 0.0 | - | | 10.6725 | 3650 | 0.0 | - | | 10.8187 | 3700 | 0.0001 | - | | 10.9649 | 3750 | 0.0 | - | | 11.1111 | 3800 | 0.0 | - | | 11.2573 | 3850 | 0.0001 | - | | 11.4035 | 3900 | 0.0001 | - | | 11.5497 | 3950 | 0.0 | - | | 11.6959 | 4000 | 0.0 | - | | 11.8421 | 4050 | 0.0 | - | | 11.9883 | 4100 | 0.0 | - | | 12.1345 | 4150 | 0.0 | - | | 12.2807 | 4200 | 0.0001 | - | | 12.4269 | 4250 | 0.0 | - | | 12.5731 | 4300 | 0.0 | - | | 12.7193 | 4350 | 0.0003 | - | | 12.8655 | 4400 | 0.0 | - | | 13.0117 | 4450 | 0.0 | - | | 13.1579 | 4500 | 0.0 | - | | 13.3041 | 4550 | 0.0 | - | | 13.4503 | 4600 | 0.0 | - | | 13.5965 | 4650 | 0.0 | - | | 13.7427 | 4700 | 0.0 | - | | 13.8889 | 4750 | 0.0 | - | | 14.0351 | 4800 | 0.0 | - | | 14.1813 | 4850 | 0.0 | - | | 14.3275 | 4900 | 0.0 | - | | 14.4737 | 4950 | 0.0 | - | | 14.6199 | 5000 | 0.0 | - | | 14.7661 | 5050 | 0.0 | - | | 14.9123 | 5100 | 0.0 | - | | 15.0585 | 5150 | 0.0 | - | | 15.2047 | 5200 | 0.0 | - | | 15.3509 | 5250 | 0.0 | - | | 15.4971 | 5300 | 0.0 | - | | 15.6433 | 5350 | 0.0 | - | | 15.7895 | 5400 | 0.0 | - | | 15.9357 | 5450 | 0.0 | - | | 16.0819 | 5500 | 0.0 | - | | 16.2281 | 5550 | 0.0 | - | | 16.3743 | 5600 | 0.0 | - | | 16.5205 | 5650 | 0.0 | - | | 16.6667 | 5700 | 0.0 | - | | 16.8129 | 5750 | 0.0 | - | | 16.9591 | 5800 | 0.0 | - | | 17.1053 | 5850 | 0.0 | - | | 17.2515 | 5900 | 0.0 | - | | 17.3977 | 5950 | 0.0 | - | | 17.5439 | 6000 | 0.0 | - | | 17.6901 | 6050 | 0.0 | - | | 17.8363 | 6100 | 0.0 | - | | 17.9825 | 6150 | 0.0 | - | | 18.1287 | 6200 | 0.0 | - | | 18.2749 | 6250 | 0.0 | - | | 18.4211 | 6300 | 0.0 | - | | 18.5673 | 6350 | 0.0 | - | | 18.7135 | 6400 | 0.0 | - | | 18.8596 | 6450 | 0.0 | - | | 19.0058 | 6500 | 0.0 | - | | 19.1520 | 6550 | 0.0 | - | | 19.2982 | 6600 | 0.0 | - | | 19.4444 | 6650 | 0.0 | - | | 19.5906 | 6700 | 0.0 | - | | 19.7368 | 6750 | 0.0 | - | | 19.8830 | 6800 | 0.0 | - | | 20.0292 | 6850 | 0.0 | - | | 20.1754 | 6900 | 0.0 | - | | 20.3216 | 6950 | 0.0 | - | | 20.4678 | 7000 | 0.0 | - | | 20.6140 | 7050 | 0.0 | - | | 20.7602 | 7100 | 0.0 | - | | 20.9064 | 7150 | 0.0 | - | | 21.0526 | 7200 | 0.0 | - | | 21.1988 | 7250 | 0.0 | - | | 21.3450 | 7300 | 0.0 | - | | 21.4912 | 7350 | 0.0 | - | | 21.6374 | 7400 | 0.0 | - | | 21.7836 | 7450 | 0.0 | - | | 21.9298 | 7500 | 0.0 | - | | 22.0760 | 7550 | 0.0 | - | | 22.2222 | 7600 | 0.0 | - | | 22.3684 | 7650 | 0.0 | - | | 22.5146 | 7700 | 0.0 | - | | 22.6608 | 7750 | 0.0 | - | | 22.8070 | 7800 | 0.0 | - | | 22.9532 | 7850 | 0.0 | - | | 23.0994 | 7900 | 0.0 | - | | 23.2456 | 7950 | 0.0 | - | | 23.3918 | 8000 | 0.0 | - | | 23.5380 | 8050 | 0.0 | - | | 23.6842 | 8100 | 0.0 | - | | 23.8304 | 8150 | 0.0 | - | | 23.9766 | 8200 | 0.0 | - | | 24.1228 | 8250 | 0.0858 | - | | 24.2690 | 8300 | 0.0 | - | | 24.4152 | 8350 | 0.0001 | - | | 24.5614 | 8400 | 0.0 | - | | 24.7076 | 8450 | 0.0005 | - | | 24.8538 | 8500 | 0.0992 | - | | 25.0 | 8550 | 0.0 | - | | 25.1462 | 8600 | 0.0 | - | | 25.2924 | 8650 | 0.0 | - | | 25.4386 | 8700 | 0.0 | - | | 25.5848 | 8750 | 0.0 | - | | 25.7310 | 8800 | 0.0 | - | | 25.8772 | 8850 | 0.0 | - | | 26.0234 | 8900 | 0.0 | - | | 26.1696 | 8950 | 0.0 | - | | 26.3158 | 9000 | 0.0 | - | | 26.4620 | 9050 | 0.0 | - | | 26.6082 | 9100 | 0.0 | - | | 26.7544 | 9150 | 0.0 | - | | 26.9006 | 9200 | 0.0 | - | | 27.0468 | 9250 | 0.0 | - | | 27.1930 | 9300 | 0.0 | - | | 27.3392 | 9350 | 0.0 | - | | 27.4854 | 9400 | 0.0 | - | | 27.6316 | 9450 | 0.0 | - | | 27.7778 | 9500 | 0.0 | - | | 27.9240 | 9550 | 0.0 | - | | 28.0702 | 9600 | 0.0 | - | | 28.2164 | 9650 | 0.0 | - | | 28.3626 | 9700 | 0.0 | - | | 28.5088 | 9750 | 0.0 | - | | 28.6550 | 9800 | 0.0 | - | | 28.8012 | 9850 | 0.0 | - | | 28.9474 | 9900 | 0.0 | - | | 29.0936 | 9950 | 0.0 | - | | 29.2398 | 10000 | 0.0 | - | | 29.3860 | 10050 | 0.0 | - | | 29.5322 | 10100 | 0.0 | - | | 29.6784 | 10150 | 0.0 | - | | 29.8246 | 10200 | 0.0 | - | | 29.9708 | 10250 | 0.0 | - | | 30.1170 | 10300 | 0.0 | - | | 30.2632 | 10350 | 0.0 | - | | 30.4094 | 10400 | 0.0 | - | | 30.5556 | 10450 | 0.0 | - | | 30.7018 | 10500 | 0.0 | - | | 30.8480 | 10550 | 0.0 | - | | 30.9942 | 10600 | 0.0 | - | | 31.1404 | 10650 | 0.0 | - | | 31.2865 | 10700 | 0.0 | - | | 31.4327 | 10750 | 0.0 | - | | 31.5789 | 10800 | 0.0 | - | | 31.7251 | 10850 | 0.0 | - | | 31.8713 | 10900 | 0.0 | - | | 32.0175 | 10950 | 0.0 | - | | 32.1637 | 11000 | 0.0 | - | | 32.3099 | 11050 | 0.0 | - | | 32.4561 | 11100 | 0.0 | - | | 32.6023 | 11150 | 0.0 | - | | 32.7485 | 11200 | 0.0 | - | | 32.8947 | 11250 | 0.0 | - | | 33.0409 | 11300 | 0.0 | - | | 33.1871 | 11350 | 0.0 | - | | 33.3333 | 11400 | 0.0 | - | | 33.4795 | 11450 | 0.0 | - | | 33.6257 | 11500 | 0.0 | - | | 33.7719 | 11550 | 0.0 | - | | 33.9181 | 11600 | 0.0 | - | | 34.0643 | 11650 | 0.0 | - | | 34.2105 | 11700 | 0.0 | - | | 34.3567 | 11750 | 0.0 | - | | 34.5029 | 11800 | 0.0 | - | | 34.6491 | 11850 | 0.0 | - | | 34.7953 | 11900 | 0.0 | - | | 34.9415 | 11950 | 0.0 | - | ### Framework Versions - Python: 3.10.12 - SetFit: 1.0.1 - Sentence Transformers: 2.2.2 - Transformers: 4.35.2 - PyTorch: 2.1.0+cu118 - Datasets: 2.15.0 - Tokenizers: 0.15.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} } ```