
# SetFit

This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. 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:** [Unknown](https://huggingface.co/unknown) -->
- **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:** 2 classes
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
<!-- - **Language:** Unknown -->
<!-- - **License:** Unknown -->

### 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|:--------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Non-recurring | <ul><li>'海外に拠点を置くセカンダリー・プライベート・エクイティ投資に特化した独立系運用会社。'</li><li>'我々映像機器システム社は、大正11年から続く長い歴史のある企業です。\n「夢と感動を皆様にお届けする」という信念は今も昔も、これからも変わることはありません。\n\n我々の仕事を通して、エンドユーザーには想像以上の映像・音響体験が生まれ、感謝と感動が循環します。\nまるで自分も映像の中に入り込んだように、全身で作品を味わっていただいています。\n\nただ「映画を観る」だけではなく、「映画を体験」し、その先の感動をお届けし続ける企業であり続けたいと思っています！'</li><li>'報道関係者向けイベントのオンライン開催を支援する動画配信サービス「プレスメイク」などを運営するスタートアップ。'</li></ul>                                                                                                                                         |
| Recurring     | <ul><li>'お米・麦・大豆を使い、\n飲食業に特化した今までにない\n飲食業態を開発運営する会社です。\n\nキャッチコピーは「お米をデザインする」\n\n自社農園での農業から加工・販売まで\n\n育てる・作る・販売するを一貫して行なっており、\n一次産業から三次産業まで\n全てのシーンでお米をデザインしながら、\n日本の食文化で常に\n新しいチャレンジをしています。'</li><li>'アニメ評価ランキングサイト「あにこれ」を運営するスタートアップ。'</li><li>'100人いれば、100通りの美しさがあり、100通りのらしさがある。\n創業以来ずっと、私たちは患者様一人ひとりと向き合い、\n患者さまの立場に立った施術を行うことを信念としてやってきました。\n例えば、カウンセラーではなく医師が時間をかけて患者様と向き合って\nカウンセリングしているのもそのスタンスを実現するためです。\n\n一人一人にクオリティの高い治療を行うために。\n最新技術の研鑽はもちろんのこと、チームワークを大切にしながら、\n美容医療をいかに進化させることができるかを真剣に学べる環境です。'</li></ul> |

## 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("Kurrant/RevenueStreamJP")
# Run inference
preds = model("次世代を担う子どもたちへプログラミングの面白さを伝えるキッズプログラミングスクール「ツクル」を運営するスタートアップ。")
```

<!--
### Downstream Use

*List how someone could finetune this model on their own dataset.*
-->

<!--
### Out-of-Scope Use

*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->

<!--
## Bias, Risks and Limitations

*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
-->

<!--
### Recommendations

*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
-->

## Training Details

### Training Set Metrics
| Training set | Min | Median | Max |
|:-------------|:----|:-------|:----|
| Word count   | 1   | 2.0785 | 65  |

| Label         | Training Sample Count |
|:--------------|:----------------------|
| Non-recurring | 929                   |
| Recurring     | 1467                  |

### Training Hyperparameters
- batch_size: (8, 8)
- num_epochs: (2, 2)
- 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.0006 | 1    | 0.3           | -               |
| 0.0278 | 50   | 0.2769        | -               |
| 0.0556 | 100  | 0.2192        | -               |
| 0.0835 | 150  | 0.323         | -               |
| 0.1113 | 200  | 0.2692        | -               |
| 0.1391 | 250  | 0.1603        | -               |
| 0.1669 | 300  | 0.3578        | -               |
| 0.1948 | 350  | 0.197         | -               |
| 0.2226 | 400  | 0.3582        | -               |
| 0.2504 | 450  | 0.2184        | -               |
| 0.2782 | 500  | 0.182         | -               |
| 0.3061 | 550  | 0.2353        | -               |
| 0.3339 | 600  | 0.2287        | -               |
| 0.3617 | 650  | 0.1228        | -               |
| 0.3895 | 700  | 0.2276        | -               |
| 0.4174 | 750  | 0.2181        | -               |
| 0.4452 | 800  | 0.2857        | -               |
| 0.4730 | 850  | 0.2361        | -               |
| 0.5008 | 900  | 0.2545        | -               |
| 0.5287 | 950  | 0.1986        | -               |
| 0.5565 | 1000 | 0.3308        | -               |
| 0.5843 | 1050 | 0.2126        | -               |
| 0.6121 | 1100 | 0.18          | -               |
| 0.6400 | 1150 | 0.1206        | -               |
| 0.6678 | 1200 | 0.1441        | -               |
| 0.6956 | 1250 | 0.1999        | -               |
| 0.7234 | 1300 | 0.1518        | -               |
| 0.7513 | 1350 | 0.1713        | -               |
| 0.7791 | 1400 | 0.033         | -               |
| 0.8069 | 1450 | 0.1999        | -               |
| 0.8347 | 1500 | 0.0766        | -               |
| 0.8625 | 1550 | 0.1551        | -               |
| 0.8904 | 1600 | 0.363         | -               |
| 0.9182 | 1650 | 0.0398        | -               |
| 0.9460 | 1700 | 0.1047        | -               |
| 0.9738 | 1750 | 0.0475        | -               |
| 1.0017 | 1800 | 0.0331        | -               |
| 1.0295 | 1850 | 0.0113        | -               |
| 1.0573 | 1900 | 0.0099        | -               |
| 1.0851 | 1950 | 0.2228        | -               |
| 1.1130 | 2000 | 0.1168        | -               |
| 1.1408 | 2050 | 0.0687        | -               |
| 1.1686 | 2100 | 0.0018        | -               |
| 1.1964 | 2150 | 0.0043        | -               |
| 1.2243 | 2200 | 0.0016        | -               |
| 1.2521 | 2250 | 0.0488        | -               |
| 1.2799 | 2300 | 0.0029        | -               |
| 1.3077 | 2350 | 0.0053        | -               |
| 1.3356 | 2400 | 0.0659        | -               |
| 1.3634 | 2450 | 0.0662        | -               |
| 1.3912 | 2500 | 0.0013        | -               |
| 1.4190 | 2550 | 0.1195        | -               |
| 1.4469 | 2600 | 0.0004        | -               |
| 1.4747 | 2650 | 0.0028        | -               |
| 1.5025 | 2700 | 0.0002        | -               |
| 1.5303 | 2750 | 0.2196        | -               |
| 1.5582 | 2800 | 0.0011        | -               |
| 1.5860 | 2850 | 0.0086        | -               |
| 1.6138 | 2900 | 0.0017        | -               |
| 1.6416 | 2950 | 0.0048        | -               |
| 1.6694 | 3000 | 0.0003        | -               |
| 1.6973 | 3050 | 0.0003        | -               |
| 1.7251 | 3100 | 0.0002        | -               |
| 1.7529 | 3150 | 0.0002        | -               |
| 1.7807 | 3200 | 0.0003        | -               |
| 1.8086 | 3250 | 0.0001        | -               |
| 1.8364 | 3300 | 0.0002        | -               |
| 1.8642 | 3350 | 0.0133        | -               |
| 1.8920 | 3400 | 0.0003        | -               |
| 1.9199 | 3450 | 0.0003        | -               |
| 1.9477 | 3500 | 0.0007        | -               |
| 1.9755 | 3550 | 0.0005        | -               |

### Framework Versions
- Python: 3.10.12
- SetFit: 1.0.2
- Sentence Transformers: 2.2.2
- Transformers: 4.35.2
- PyTorch: 2.1.0+cu121
- Datasets: 2.16.1
- 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}
}
```

<!--
## Glossary

*Clearly define terms in order to be accessible across audiences.*
-->

<!--
## Model Card Authors

*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->

<!--
## Model Card Contact

*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
-->
{"library_name": "setfit", "tags": ["setfit", "sentence-transformers", "text-classification", "generated_from_setfit_trainer"], "metrics": ["accuracy"], "widget": [{"text": "\u9996\u90fd\u570f\u6700\u5927\u7d1a\u306e\u5e97\u8217\u7269\u4ef6\u5c02\u9580\u60c5\u5831\u30b5\u30fc\u30d3\u30b9\u4f1a\u793e\u3067\u3059\u3002\n\u6b21\u3005\u306b\u51fa\u5e97\u3059\u308b\u5e97\u8217\u3055\u307e\u9054\u3068\u4e00\u7dd2\u306b\u6210\u9577\u3057\u307e\u3057\u3087\u3046\uff01\n\n\u3042\u306e\u5e97\u3082\u3001\u3053\u306e\u5e97\u3082\u3001\u30db\u30af\u30c8\u30b7\u30b9\u30c6\u30e0\u3067\u51fa\u5e97\u3057\u305f\u3093\u3060\uff01\u3068\u8857\u4e2d\u3092\u6b69\u304f\u306e\u304c\u697d\u3057\u304f\u306a\u308a\u307e\u3059( ^\u03c9^ )"}, {"text": "\u3051\u3084\u304d\u51fa\u7248\u306f\u3001\u591a\u6469\u306e\u3072\u3068\u3068\u307e\u3061\u3092\u3064\u306a\u3044\u3067\u3044\u304f\u3068\u3044\u3046\u4f01\u696d\u7406\u5ff5\u306e\u3082\u3068\u3001\u66f8\u7c4d\u30fb\u60c5\u5831\u8a8c\u30fb\u30d1\u30f3\u30d5\u30ec\u30c3\u30c8\u30fb\u4f1a\u793e\u6848\u5185\u30fb\u793e\u53f2\u30fb\u30ed\u30b4\u5236\u4f5c\u3084WEB\u30b5\u30a4\u30c8\u306e\u8a18\u4e8b\u5236\u4f5c\u306a\u3069\u306e\u4ed5\u4e8b\u3092\u3055\u305b\u3066\u3044\u305f\u3060\u3044\u3066\u3044\u307e\u3059\u3002\n\n2020\u5e746\u6708\u306b\u306f\u3001\u65b0\u3057\u3044\u591a\u6469\u306e\u60c5\u5831\u8a8c\u300cBALL.\u300d\u3092\u5275\u520a\uff08\u5e74\uff12\u56de\u767a\u884c\uff09\u3057\u3001\u591a\u6469\u30a8\u30ea\u30a2\u3067\u306f\u305a\u3080\u3088\u3046\u306b\u50cd\u3053\u3046\uff01\u3068\u3044\u3046\u30bf\u30b0\u30e9\u30a4\u30f3\u306e\u3082\u3068\u3001\u591a\u6469\u30a8\u30ea\u30a2\u306e\u4ed5\u4e8b\u306b\u7279\u5316\u3057\u305f\u5185\u5bb9\u3092\u8aad\u8005\u306e\u65b9\u306b\u5c4a\u3051\u3066\u3044\u307e\u3059\u3002\nBALL.\u3092\u4e2d\u5fc3\u306b\u59cb\u307e\u3063\u305f\u3001WEB MAGAZINE\u306a\u3069\u3001\u30af\u30ea\u30a8\u30a4\u30bf\u30fc\u81ea\u3089\u306e\u4f01\u753b\u53c2\u52a0\u578b\u306e\u30e1\u30c7\u30a3\u30a2\u3092\u5f62\u6210\u3057\u3066\u3044\u307e\u3059\u3002\n"}, {"text": "\u79c1\u305f\u3061\u306e\u5b58\u5728\u610f\u7fa9\uff08Purpose\uff09\u306f\u3001\u300c\u5229\u4ed6\u3067\u3042\u3075\u308c\u308b\u793e\u4f1a\u3092\u5275\u308b\u300d\u3067\u3059\u3002\n\u5229\u4ed6\u3068\u306f\u3001\u4ed6\u4eba\u306b\u5229\u76ca\u3092\u4e0e\u3048\u308b\u3053\u3068\u3002\u81ea\u5206\u306e\u4e8b\u3088\u308a\u3082\u4ed6\u4eba\u306e\u5e78\u798f\u3092\u9858\u3046\u3053\u3068\u3002\u30b7\u30f3\u30d7\u30eb\u306b\u8a00\u3046\u3068\u300c\u6c42\u3081\u5408\u3046\u3088\u308a\u4e0e\u3048\u5408\u3046\u300d\u305d\u3093\u306a\u8868\u73fe\u304c\u3074\u3063\u305f\u308a\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\n\n\u79c1\u305f\u3061\u306e\u5922\u306f\u3001\u4e16\u754c\u4e2d\u306e\u3059\u3079\u3066\u306e\u4eba\u305f\u3061\u304c\u5922\u3068\u52c7\u6c17\u3068\u7b11\u9854\u306b\u6ea2\u308c\u305f\u793e\u4f1a\u3092\u5275\u308b\u3053\u3068\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u306b\u306f\u300c\u5229\u4ed6\u306e\u7cbe\u795e\u300d\u306f\u5fc5\u8981\u4e0d\u53ef\u6b20\u3067\u3059\u3002\n\u8ab0\u304b\u306b\u671f\u5f85\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u81ea\u3089\u5229\u4ed6\u306e\u7cbe\u795e\u3092\u6301\u3061 \u300c\u3069\u3046\u3059\u308c\u3070\u793e\u4f1a\u3084\u4ed6\u4eba\u3092\u5e78\u305b\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3060\u308d\u3046\u300d\u3092\u65e5\u3005\u8003\u3048\u884c\u52d5\u3057\u3001\u793e\u4f1a\u3092\u826f\u304f\u3057\u3066\u3044\u304d\u307e\u3059\u3002"}, {"text": "\u300c\u30e9\u30c6\u30f3\u30a2\u30e1\u30ea\u30ab\u3068\u65e5\u672c\u306e\u65b0\u3057\u3044\u6b74\u53f2\u3092\u5275\u308a\u3001\u4eba\u3005\u306e\u4eba\u751f\u3092\u8c4a\u304b\u306b\u3059\u308b\u300d\u3053\u3068\u3092\u7406\u5ff5\u306b\u3001\u30e1\u30ad\u30b7\u30b3\u5408\u8846\u56fd\u3092\u4e2d\u5fc3\u306b\u4e8b\u696d\u3092\u5c55\u958b\u3057\u3066\u3044\u307e\u3059\uff01\u73fe\u5728\u306f\u30e1\u30ad\u30b7\u30b3\u5408\u8846\u56fd\u3092\u4e2d\u5fc3\u306b\u3001\u30e1\u30ad\u30b7\u30b3\u4eba\u30fb\u65e5\u672c\u4eba\u304a\u3088\u3073\u30bb\u30eb\u30d3\u30a2\u4eba\u306e\u5408\u8a0880\u540d\u3067\u6d3b\u52d5\u3057\u3066\u3044\u307e\u3059\u3002\n\n\u4e3b\u306a\u4e8b\u696d\u5185\u5bb9\u306f \u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002\n\n\u2460\u5e83\u544a\u4ee3\u7406\u5e97\u3001\u306a\u3089\u3073\u306b\u5404\u7a2e\u30b3\u30f3\u30b5\u30eb\u30c6\u30a3\u30f3\u30b0\u4e8b\u696d (\u4f01\u753b\u30fb\u55b6\u696d\u90e8)\n\n\u2461\u30e9\u30c6\u30f3\u30a2\u30e1\u30ea\u30ab\u57df\u5185\u306b\u304a\u3051\u308b\u65e5\u672c\u98df\u30ec\u30b9\u30c8\u30e9\u30f3\u306e\u904b\u55b6\u4e8b\u696d (Food & Beverage \u4e8b\u696d\u90e8)\n\n"}, {"text": "\u6b21\u4e16\u4ee3\u3092\u62c5\u3046\u5b50\u3069\u3082\u305f\u3061\u3078\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u9762\u767d\u3055\u3092\u4f1d\u3048\u308b\u30ad\u30c3\u30ba\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u300c\u30c4\u30af\u30eb\u300d\u3092\u904b\u55b6\u3059\u308b\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u3002"}], "pipeline_tag": "text-classification", "inference": true}
setfit safetensors bert sentence-transformers text-classification generated_from_setfit_trainer arxiv:2209.11055 region:us