--- tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer widget: - text: 'Thesis: In my opinion, watching sports on TV is a good opportunity to get relax. There are many reasons why some people like to watch sport games on TV. Last argument: None Target sentence: Where is the truth?' - text: 'Thesis: As for me, I suppose that watching sports via TV won''t help you become a professional at sport. Moreover, sport events are not very interesting to be seen through television channels. Last argument: Besides, it''s much more attractive to visit the play in the real life than to watch it at home for many reasons. Target sentence: If you watch the sport programme, you can see only those things that the operator wants to record.' - text: 'Thesis: Today there are people who belived that watching any sport is a useless time spent. I complitely disagree with this opinion. Last argument: Watching any sort games or individual competition is wonderfull way to spend your free time, by this hobby you can have a lot of profits. Target sentence: Watching any sort games or individual competition is wonderfull way to spend your free time, by this hobby you can have a lot of profits.' - text: 'Thesis: As for me, I suppose that watching sports via TV won''t help you become a professional at sport. Moreover, sport events are not very interesting to be seen through television channels. Last argument: Besides, it''s much more attractive to visit the play in the real life than to watch it at home for many reasons. Target sentence: Besides, it''s much more attractive to visit the play in the real life than to watch it at home for many reasons.' - text: 'Thesis: Some people consider that it is a waste of time, bit I desagree with this statment and try to refute it. Last argument: If looks on this statement otherwise, it is importnat to say that watching sport events is a usual hobby such as cooking, reading books and others. Target sentence: People who work in public catering like cooking and it is their hobby maybe.' metrics: - accuracy pipeline_tag: text-classification library_name: setfit inference: true datasets: - Zlovoblachko/DeepSeek_dim1 base_model: BAAI/bge-small-en-v1.5 model-index: - name: SetFit with BAAI/bge-small-en-v1.5 results: - task: type: text-classification name: Text Classification dataset: name: Zlovoblachko/DeepSeek_dim1 type: Zlovoblachko/DeepSeek_dim1 split: test metrics: - type: accuracy value: 0.8740740740740741 name: Accuracy --- # SetFit with BAAI/bge-small-en-v1.5 This is a [SetFit](https://github.com/huggingface/setfit) model trained on the [Zlovoblachko/DeepSeek_dim1](https://huggingface.co/datasets/Zlovoblachko/DeepSeek_dim1) dataset that can be used for Text Classification. This SetFit model uses [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5) 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:** [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5) - **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:** [Zlovoblachko/DeepSeek_dim1](https://huggingface.co/datasets/Zlovoblachko/DeepSeek_dim1) ### 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 | |:------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | L | | | H | | ## Evaluation ### Metrics | Label | Accuracy | |:--------|:---------| | **all** | 0.8741 | ## 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("Zlovoblachko/dim1_setfit_model") # Run inference preds = model("Thesis: In my opinion, watching sports on TV is a good opportunity to get relax. There are many reasons why some people like to watch sport games on TV. Last argument: None Target sentence: Where is the truth?") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:--------|:----| | Word count | 13 | 62.7806 | 140 | | Label | Training Sample Count | |:------|:----------------------| | L | 540 | | H | 540 | ### Training Hyperparameters - batch_size: (16, 16) - num_epochs: (1, 1) - max_steps: -1 - sampling_strategy: oversampling - 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.0000 | 1 | 0.2674 | - | | 0.0014 | 50 | 0.3254 | - | | 0.0027 | 100 | 0.3135 | 0.3191 | | 0.0041 | 150 | 0.2963 | - | | 0.0055 | 200 | 0.2799 | 0.2615 | | 0.0068 | 250 | 0.2521 | - | | 0.0082 | 300 | 0.2554 | 0.2495 | | 0.0096 | 350 | 0.2518 | - | | 0.0110 | 400 | 0.2484 | 0.2488 | | 0.0123 | 450 | 0.2498 | - | | 0.0137 | 500 | 0.2456 | 0.2465 | | 0.0151 | 550 | 0.2449 | - | | 0.0164 | 600 | 0.2433 | 0.2435 | | 0.0178 | 650 | 0.2416 | - | | 0.0192 | 700 | 0.2424 | 0.2410 | | 0.0205 | 750 | 0.2381 | - | | 0.0219 | 800 | 0.2302 | 0.2300 | | 0.0233 | 850 | 0.227 | - | | 0.0246 | 900 | 0.2222 | 0.2428 | | 0.0260 | 950 | 0.2129 | - | | 0.0274 | 1000 | 0.2138 | 0.2144 | | 0.0288 | 1050 | 0.2026 | - | | 0.0301 | 1100 | 0.1888 | 0.2009 | | 0.0315 | 1150 | 0.1735 | - | | 0.0329 | 1200 | 0.1658 | 0.2017 | | 0.0342 | 1250 | 0.1646 | - | | 0.0356 | 1300 | 0.1442 | 0.1889 | | 0.0370 | 1350 | 0.1428 | - | | 0.0383 | 1400 | 0.1169 | 0.1804 | | 0.0397 | 1450 | 0.1237 | - | | 0.0411 | 1500 | 0.0989 | 0.1838 | | 0.0424 | 1550 | 0.106 | - | | 0.0438 | 1600 | 0.102 | 0.1703 | | 0.0452 | 1650 | 0.0823 | - | | 0.0466 | 1700 | 0.0822 | 0.1786 | | 0.0479 | 1750 | 0.081 | - | | 0.0493 | 1800 | 0.0674 | 0.1685 | | 0.0507 | 1850 | 0.0593 | - | | 0.0520 | 1900 | 0.0659 | 0.1732 | | 0.0534 | 1950 | 0.0546 | - | | 0.0548 | 2000 | 0.0508 | 0.1889 | | 0.0561 | 2050 | 0.0447 | - | | 0.0575 | 2100 | 0.0462 | 0.1637 | | 0.0589 | 2150 | 0.0348 | - | | 0.0602 | 2200 | 0.0256 | 0.2151 | | 0.0616 | 2250 | 0.0273 | - | | 0.0630 | 2300 | 0.0183 | 0.2285 | | 0.0644 | 2350 | 0.0194 | - | | 0.0657 | 2400 | 0.0245 | 0.2068 | ### Framework Versions - Python: 3.11.13 - SetFit: 1.1.3 - Sentence Transformers: 4.1.0 - Transformers: 4.54.0 - PyTorch: 2.6.0+cu124 - Datasets: 4.0.0 - Tokenizers: 0.21.2 ## 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} } ```