Text Classification
setfit
Safetensors
sentence-transformers
roberta
generated_from_setfit_trainer
Eval Results (legacy)
text-embeddings-inference
Instructions to use mini1013/master_cate_bt10_test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- setfit
How to use mini1013/master_cate_bt10_test with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("mini1013/master_cate_bt10_test") preds = model.predict(["i loved the spiderman movie!", "pineapple on pizza is the worst"]) print(preds) - sentence-transformers
How to use mini1013/master_cate_bt10_test with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("mini1013/master_cate_bt10_test") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Push model using huggingface_hub.
Browse filesFiles changed (13)
- 1_Pooling/config.jsonAdded+10
- README.mdAdded+204
- config.jsonAdded+29
- config_sentence_transformers.jsonAdded+10
- config_setfit.jsonAdded+4
- model.safetensorsAdded+3
- model_head.pklAdded+3
- modules.jsonAdded+14
- sentence_bert_config.jsonAdded+4
- special_tokens_map.jsonAdded+51
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+66
- vocab.txtAdded
12345678910{ "word_embedding_dimension": 768, "pooling_mode_cls_token": false, "pooling_mode_mean_tokens": true, "pooling_mode_max_tokens": false, "pooling_mode_mean_sqrt_len_tokens": false, "pooling_mode_weightedmean_tokens": false, "pooling_mode_lasttoken": false, "include_prompt": true}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204---base_model: mini1013/master_domainlibrary_name: setfitmetrics:- accuracypipeline_tag: text-classificationtags:- setfit- sentence-transformers- text-classification- generated_from_setfit_trainerwidget:- text: 디퓨저 용기 미니프레쉬블랙무광50ml-1개/디퓨져 공병 옵션없음 케이지- text: 아쿠아디파르마 퀘르시아 오드퍼퓸 20ml [백화점 상품] 쇼핑백 신청 다원인사이트- text: '데메테르 시티에디션 송풍구 디퓨저 샤이니아이슬란드 13ml 2+1 옵션없음 '- text: 다타 퍼퓸 자동차 벤트스틱 선물용 2개입 아쿠아시크릿 3.5g 차량용방향제 디퓨저 옵션없음 다타상점- text: '센티드 캔들 인센스 S 블루_170g 'inference: truemodel-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: 0.9879518072289156 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:** 3 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 ||:------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------|| 1.0 | <ul><li>'딥티크 뗌포 오드 퍼퓸 75ml 옵션없음 대박컴퍼니'</li><li>'[태국] 저널 퍼퓸 컬렉션 2.3ml x 5개 1세트 옵션없음 코브네트웍스'</li><li>'[로에베](신세계 강남점)아구아 마이애미 오 드 뚜왈렛 100ML 옵션없음 주식회사 에스에스지닷컴'</li></ul> || 0.0 | <ul><li>'디퓨저 섬유 리드스틱 화이트 50개입 디퓨저 섬유 옵션없음 '</li><li>'에코야 - 리드 디퓨저 - 블러드 오렌지 200ml/6.8oz 스트로베리넷 (홍콩)'</li><li>'아베르힐 아로마 전자 디퓨저 전자디퓨저 1개 러브바니'</li></ul> || 2.0 | <ul><li>'가정용 실내방향제 인센스향 라벤더향 20개입 옵션없음 '</li><li>'인센스 스틱 홀더 인센스스틱홀더 인센스스틱 옵션없음 '</li><li>'홀더 인센스 스틱 옵션없음 '</li></ul> |
## Evaluation
### Metrics| Label | Accuracy ||:--------|:---------|| **all** | 0.9880 |
## Uses
### Direct Use for Inference
First install the SetFit library:
```bashpip install setfit```
Then you can load this model and run inference.
```pythonfrom setfit import SetFitModel
# Download from the 🤗 Hubmodel = SetFitModel.from_pretrained("mini1013/master_cate_bt10_test")# Run inferencepreds = model("센티드 캔들 인센스 S 블루_170g ")```
<!--### 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 | 5 | 9.4127 | 18 |
| Label | Training Sample Count ||:------|:----------------------|| 0.0 | 20 || 1.0 | 23 || 2.0 | 20 |
### Training Hyperparameters- batch_size: (512, 512)- num_epochs: (40, 40)- 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.1429 | 1 | 0.4985 | - || 7.1429 | 50 | 0.1411 | - || 14.2857 | 100 | 0.0 | - || 21.4286 | 150 | 0.0 | - || 28.5714 | 200 | 0.0 | - || 35.7143 | 250 | 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}}```
<!--## 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.*-->1234567891011121314151617181920212223242526272829{ "_name_or_path": "mini1013/master_item_bt_test", "architectures": [ "RobertaModel" ], "attention_probs_dropout_prob": 0.1, "bos_token_id": 0, "classifier_dropout": null, "eos_token_id": 2, "gradient_checkpointing": false, "hidden_act": "gelu", "hidden_dropout_prob": 0.1, "hidden_size": 768, "initializer_range": 0.02, "intermediate_size": 3072, "layer_norm_eps": 1e-05, "max_position_embeddings": 514, "model_type": "roberta", "num_attention_heads": 12, "num_hidden_layers": 12, "pad_token_id": 1, "position_embedding_type": "absolute", "tokenizer_class": "BertTokenizer", "torch_dtype": "float32", "transformers_version": "4.44.2", "type_vocab_size": 1, "use_cache": true, "vocab_size": 32000}12345678910{ "__version__": { "sentence_transformers": "3.3.1", "transformers": "4.44.2", "pytorch": "2.2.0a0+81ea7a4" }, "prompts": {}, "default_prompt_name": null, "similarity_fn_name": "cosine"}1234{ "labels": null, "normalize_embeddings": false}123version https://git-lfs.github.com/spec/v1oid sha256:b47a374331ee92321a52345a935f3588d24fece9f07c68af5cb438a388e72bbesize 442494816123version https://git-lfs.github.com/spec/v1oid sha256:09b48f3e8e926c7accb3017567cc38c8b302268a7336d265ad2a69e02d5c2096size 192951234567891011121314[ { "idx": 0, "name": "0", "path": "", "type": "sentence_transformers.models.Transformer" }, { "idx": 1, "name": "1", "path": "1_Pooling", "type": "sentence_transformers.models.Pooling" }]1234{ "max_seq_length": 512, "do_lower_case": false}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051{ "bos_token": { "content": "[CLS]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "cls_token": { "content": "[CLS]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "eos_token": { "content": "[SEP]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "mask_token": { "content": "[MASK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "pad_token": { "content": "[PAD]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "sep_token": { "content": "[SEP]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "unk_token": { "content": "[UNK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566{ "added_tokens_decoder": { "0": { "content": "[CLS]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "1": { "content": "[PAD]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "2": { "content": "[SEP]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "3": { "content": "[UNK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "4": { "content": "[MASK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "bos_token": "[CLS]", "clean_up_tokenization_spaces": false, "cls_token": "[CLS]", "do_basic_tokenize": true, "do_lower_case": false, "eos_token": "[SEP]", "mask_token": "[MASK]", "max_length": 512, "model_max_length": 512, "never_split": null, "pad_to_multiple_of": null, "pad_token": "[PAD]", "pad_token_type_id": 0, "padding_side": "right", "sep_token": "[SEP]", "stride": 0, "strip_accents": null, "tokenize_chinese_chars": true, "tokenizer_class": "BertTokenizer", "truncation_side": "right", "truncation_strategy": "longest_first", "unk_token": "[UNK]"}1_Pooling/config.jsonAdded+10
README.mdAdded+204
config.jsonAdded+29
config_sentence_transformers.jsonAdded+10
config_setfit.jsonAdded+4
model.safetensorsAdded+3
model_head.pklAdded+3
modules.jsonAdded+14
sentence_bert_config.jsonAdded+4
special_tokens_map.jsonAdded+51
tokenizer.jsonAdded
tokenizer_config.jsonAdded+66
vocab.txtAdded