--- library_name: setfit tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer metrics: - accuracy widget: - text: aku hanya menyukai setiap menit film ini. - text: bioskop orang dalam kondisi terbaiknya. - text: bukan untuk orang yang mudah tersinggung atau mudah tersinggung, ini adalah pemeriksaan yang berani dan berkepanjangan terhadap budaya yang diidolakan, kebencian terhadap diri sendiri, dan politik seksual. - text: itu curang. - text: Meskipun penduduk setempat akan senang melihat situs-situs Cleveland, seluruh dunia akan menikmati komedi bertempo cepat dengan keunikan yang mungkin membuat iri para coen bersaudara yang telah memenangkan penghargaan. pipeline_tag: text-classification inference: true base_model: firqaaa/indo-sentence-bert-base model-index: - name: SetFit with firqaaa/indo-sentence-bert-base results: - task: type: text-classification name: Text Classification dataset: name: Unknown type: unknown split: test metrics: - type: accuracy value: 0.3425339366515837 name: Accuracy --- # SetFit with firqaaa/indo-sentence-bert-base This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [firqaaa/indo-sentence-bert-base](https://huggingface.co/firqaaa/indo-sentence-bert-base) as the Sentence Transformer embedding model. A [SetFitHead](huggingface.co/docs/setfit/reference/main#setfit.SetFitHead) 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:** [firqaaa/indo-sentence-bert-base](https://huggingface.co/firqaaa/indo-sentence-bert-base) - **Classification head:** a [SetFitHead](huggingface.co/docs/setfit/reference/main#setfit.SetFitHead) instance - **Maximum Sequence Length:** 512 tokens - **Number of Classes:** 5 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 | |:---------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | sangat positif | | | sangat negatif | | | positif | | | negatif | | | netral | | ## Evaluation ### Metrics | Label | Accuracy | |:--------|:---------| | **all** | 0.3425 | ## 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("firqaaa/indo-setfit-bert-base-p2") # Run inference preds = model("itu curang.") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:-------|:----| | Word count | 2 | 15.476 | 46 | | Label | Training Sample Count | |:---------------|:----------------------| | sangat negatif | 200 | | negatif | 200 | | netral | 200 | | positif | 200 | | sangat positif | 200 | ### Training Hyperparameters - batch_size: (128, 32) - num_epochs: (1, 8) - max_steps: -1 - sampling_strategy: oversampling - body_learning_rate: (2e-05, 5e-06) - 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: True ### Training Results | Epoch | Step | Training Loss | Validation Loss | |:-------:|:--------:|:-------------:|:---------------:| | 0.0002 | 1 | 0.3317 | - | | 0.008 | 50 | 0.2883 | - | | 0.016 | 100 | 0.2625 | - | | 0.024 | 150 | 0.2516 | - | | 0.032 | 200 | 0.2075 | - | | 0.04 | 250 | 0.184 | - | | 0.048 | 300 | 0.1632 | - | | 0.056 | 350 | 0.1105 | - | | 0.064 | 400 | 0.1109 | - | | 0.072 | 450 | 0.0934 | - | | 0.08 | 500 | 0.0518 | - | | 0.088 | 550 | 0.0246 | - | | 0.096 | 600 | 0.0133 | - | | 0.104 | 650 | 0.0056 | - | | 0.112 | 700 | 0.006 | - | | 0.12 | 750 | 0.0072 | - | | 0.128 | 800 | 0.0179 | - | | 0.136 | 850 | 0.0025 | - | | 0.144 | 900 | 0.0019 | - | | 0.152 | 950 | 0.0008 | - | | 0.16 | 1000 | 0.0009 | - | | 0.168 | 1050 | 0.0016 | - | | 0.176 | 1100 | 0.0008 | - | | 0.184 | 1150 | 0.0009 | - | | 0.192 | 1200 | 0.0006 | - | | 0.2 | 1250 | 0.0112 | - | | 0.208 | 1300 | 0.0007 | - | | 0.216 | 1350 | 0.0005 | - | | 0.224 | 1400 | 0.0006 | - | | 0.232 | 1450 | 0.0004 | - | | 0.24 | 1500 | 0.0003 | - | | 0.248 | 1550 | 0.0111 | - | | 0.256 | 1600 | 0.0007 | - | | 0.264 | 1650 | 0.0004 | - | | 0.272 | 1700 | 0.0068 | - | | 0.28 | 1750 | 0.0006 | - | | 0.288 | 1800 | 0.008 | - | | 0.296 | 1850 | 0.0004 | - | | 0.304 | 1900 | 0.0009 | - | | 0.312 | 1950 | 0.0004 | - | | 0.32 | 2000 | 0.0003 | - | | 0.328 | 2050 | 0.0034 | - | | 0.336 | 2100 | 0.0003 | - | | 0.344 | 2150 | 0.0002 | - | | 0.352 | 2200 | 0.0002 | - | | 0.36 | 2250 | 0.0002 | - | | 0.368 | 2300 | 0.0002 | - | | 0.376 | 2350 | 0.0002 | - | | 0.384 | 2400 | 0.0002 | - | | 0.392 | 2450 | 0.0001 | - | | 0.4 | 2500 | 0.0002 | - | | 0.408 | 2550 | 0.0001 | - | | 0.416 | 2600 | 0.0001 | - | | 0.424 | 2650 | 0.0002 | - | | 0.432 | 2700 | 0.0001 | - | | 0.44 | 2750 | 0.0001 | - | | 0.448 | 2800 | 0.0001 | - | | 0.456 | 2850 | 0.0003 | - | | 0.464 | 2900 | 0.0001 | - | | 0.472 | 2950 | 0.0001 | - | | 0.48 | 3000 | 0.0004 | - | | 0.488 | 3050 | 0.0002 | - | | 0.496 | 3100 | 0.0001 | - | | 0.504 | 3150 | 0.0003 | - | | 0.512 | 3200 | 0.0001 | - | | 0.52 | 3250 | 0.0001 | - | | 0.528 | 3300 | 0.0002 | - | | 0.536 | 3350 | 0.0001 | - | | 0.544 | 3400 | 0.0001 | - | | 0.552 | 3450 | 0.0001 | - | | 0.56 | 3500 | 0.0001 | - | | 0.568 | 3550 | 0.0001 | - | | 0.576 | 3600 | 0.0001 | - | | 0.584 | 3650 | 0.0001 | - | | 0.592 | 3700 | 0.0001 | - | | 0.6 | 3750 | 0.0 | - | | 0.608 | 3800 | 0.0001 | - | | 0.616 | 3850 | 0.0001 | - | | 0.624 | 3900 | 0.0001 | - | | 0.632 | 3950 | 0.0001 | - | | 0.64 | 4000 | 0.0003 | - | | 0.648 | 4050 | 0.0001 | - | | 0.656 | 4100 | 0.0001 | - | | 0.664 | 4150 | 0.0001 | - | | 0.672 | 4200 | 0.0001 | - | | 0.68 | 4250 | 0.0001 | - | | 0.688 | 4300 | 0.0001 | - | | 0.696 | 4350 | 0.0001 | - | | 0.704 | 4400 | 0.0001 | - | | 0.712 | 4450 | 0.0001 | - | | 0.72 | 4500 | 0.0001 | - | | 0.728 | 4550 | 0.0001 | - | | 0.736 | 4600 | 0.0001 | - | | 0.744 | 4650 | 0.0001 | - | | 0.752 | 4700 | 0.0001 | - | | 0.76 | 4750 | 0.0001 | - | | 0.768 | 4800 | 0.0001 | - | | 0.776 | 4850 | 0.0001 | - | | 0.784 | 4900 | 0.0001 | - | | 0.792 | 4950 | 0.0001 | - | | 0.8 | 5000 | 0.0 | - | | 0.808 | 5050 | 0.0001 | - | | 0.816 | 5100 | 0.0001 | - | | 0.824 | 5150 | 0.0001 | - | | 0.832 | 5200 | 0.0 | - | | 0.84 | 5250 | 0.0001 | - | | 0.848 | 5300 | 0.0001 | - | | 0.856 | 5350 | 0.0 | - | | 0.864 | 5400 | 0.0001 | - | | 0.872 | 5450 | 0.0001 | - | | 0.88 | 5500 | 0.0001 | - | | 0.888 | 5550 | 0.0001 | - | | 0.896 | 5600 | 0.0 | - | | 0.904 | 5650 | 0.0001 | - | | 0.912 | 5700 | 0.0001 | - | | 0.92 | 5750 | 0.0001 | - | | 0.928 | 5800 | 0.0 | - | | 0.936 | 5850 | 0.0 | - | | 0.944 | 5900 | 0.0 | - | | 0.952 | 5950 | 0.0 | - | | 0.96 | 6000 | 0.0 | - | | 0.968 | 6050 | 0.0 | - | | 0.976 | 6100 | 0.0001 | - | | 0.984 | 6150 | 0.0 | - | | 0.992 | 6200 | 0.0 | - | | **1.0** | **6250** | **0.0** | **0.3546** | * The bold row denotes the saved checkpoint. ### Framework Versions - Python: 3.10.13 - SetFit: 1.0.3 - Sentence Transformers: 2.2.2 - Transformers: 4.36.2 - PyTorch: 2.1.2+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} } ```