--- tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer widget: - text: 'Monorepos, Verified Templates, Replica Metrics It''s Friday and you know what that means! Here''s a summary of the stuff we shipped this week Time! It''s Friday and you know what that means! Here''s a summary of the stuff we shipped this week: First-Class Support for Monorepos Verified Templates Replica Metrics to Priority Boarding Fixes and Improv' - text: 'Thanks for your time Thank you for applying to the Backend Developer position at YinzCam, Inc.. Unfortunately, YinzCam, Inc. has moved to the next step in their hiring process, and your application was not selected at this time.' - text: "Humanoid Alert! Your Data Packet Caught Our Eye at 1X Technologies! Hi Tomiwa,\n\ \nThank you for sending your application data stream our way at 1X Technologies!\n\ \nYour resume just ran through our systems, and let's just say, your skill matrix\ \ looks incredibly promising. We were genuinely intrigued by your experience and\ \ see some serious potential \n\nfor you to help us b" - text: 'Indeed Application: Software Developer We''ll help you get started pplication submitted Software Developer TherapyNotes.com - United States 30 reviews The following items were sent to TherapyNotes.com. Good luck! • Application • Resume Next steps • The employer or job advertiser may reach out to you about your application.' - text: 'Jobs! I have a job that I think lines up well with your resume. It''s new, so they don''t have many candidates yet. Check out the description and hit "View Details" if you like what you see. Entry Level Software Engineer - Revature - Jersey City, NJ Revature is looking to hire Entry Level Software Engineer' metrics: - accuracy pipeline_tag: text-classification library_name: setfit inference: true base_model: sentence-transformers/all-MiniLM-L6-v2 --- # SetFit with sentence-transformers/all-MiniLM-L6-v2 This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) 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:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance - **Maximum Sequence Length:** 256 tokens - **Number of Classes:** 7 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 | |:----------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | next-phase | | | interview | | | not-job-status-update | | | not-job-related | | | applied | | | offer | | | rejected | | ## 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("setfit_model_id") # Run inference preds = model("Thanks for your time Thank you for applying to the Backend Developer position at YinzCam, Inc.. Unfortunately, YinzCam, Inc. has moved to the next step in their hiring process, and your application was not selected at this time.") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:--------|:----| | Word count | 14 | 55.2121 | 288 | | Label | Training Sample Count | |:----------------------|:----------------------| | applied | 40 | | interview | 45 | | next-phase | 35 | | not-job-related | 55 | | not-job-status-update | 41 | | offer | 36 | | rejected | 45 | ### Training Hyperparameters - batch_size: (16, 2) - num_epochs: (1, 16) - 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.0002 | 1 | 0.3397 | - | | 0.0106 | 50 | 0.2699 | - | | 0.0212 | 100 | 0.2293 | - | | 0.0319 | 150 | 0.1907 | - | | 0.0425 | 200 | 0.1685 | - | | 0.0531 | 250 | 0.1174 | - | | 0.0637 | 300 | 0.078 | - | | 0.0743 | 350 | 0.0524 | - | | 0.0849 | 400 | 0.0319 | - | | 0.0956 | 450 | 0.0113 | - | | 0.1062 | 500 | 0.0073 | - | | 0.1168 | 550 | 0.0051 | - | | 0.1274 | 600 | 0.0038 | - | | 0.1380 | 650 | 0.0029 | - | | 0.1487 | 700 | 0.0023 | - | | 0.1593 | 750 | 0.0021 | - | | 0.1699 | 800 | 0.0017 | - | | 0.1805 | 850 | 0.0017 | - | | 0.1911 | 900 | 0.0015 | - | | 0.2017 | 950 | 0.0012 | - | | 0.2124 | 1000 | 0.0011 | - | | 0.2230 | 1050 | 0.0011 | - | | 0.2336 | 1100 | 0.001 | - | | 0.2442 | 1150 | 0.001 | - | | 0.2548 | 1200 | 0.0009 | - | | 0.2654 | 1250 | 0.0008 | - | | 0.2761 | 1300 | 0.0008 | - | | 0.2867 | 1350 | 0.0007 | - | | 0.2973 | 1400 | 0.0007 | - | | 0.3079 | 1450 | 0.0006 | - | | 0.3185 | 1500 | 0.0006 | - | | 0.3292 | 1550 | 0.0006 | - | | 0.3398 | 1600 | 0.0006 | - | | 0.3504 | 1650 | 0.0006 | - | | 0.3610 | 1700 | 0.0005 | - | | 0.3716 | 1750 | 0.0005 | - | | 0.3822 | 1800 | 0.0005 | - | | 0.3929 | 1850 | 0.0005 | - | | 0.4035 | 1900 | 0.0004 | - | | 0.4141 | 1950 | 0.0004 | - | | 0.4247 | 2000 | 0.0004 | - | | 0.4353 | 2050 | 0.0004 | - | | 0.4460 | 2100 | 0.0004 | - | | 0.4566 | 2150 | 0.0004 | - | | 0.4672 | 2200 | 0.0004 | - | | 0.4778 | 2250 | 0.0004 | - | | 0.4884 | 2300 | 0.0003 | - | | 0.4990 | 2350 | 0.0003 | - | | 0.5097 | 2400 | 0.0003 | - | | 0.5203 | 2450 | 0.0003 | - | | 0.5309 | 2500 | 0.0003 | - | | 0.5415 | 2550 | 0.0003 | - | | 0.5521 | 2600 | 0.0003 | - | | 0.5628 | 2650 | 0.0003 | - | | 0.5734 | 2700 | 0.0003 | - | | 0.5840 | 2750 | 0.0002 | - | | 0.5946 | 2800 | 0.0002 | - | | 0.6052 | 2850 | 0.0003 | - | | 0.6158 | 2900 | 0.0002 | - | | 0.6265 | 2950 | 0.0002 | - | | 0.6371 | 3000 | 0.0002 | - | | 0.6477 | 3050 | 0.0002 | - | | 0.6583 | 3100 | 0.0002 | - | | 0.6689 | 3150 | 0.0002 | - | | 0.6795 | 3200 | 0.0002 | - | | 0.6902 | 3250 | 0.0002 | - | | 0.7008 | 3300 | 0.0002 | - | | 0.7114 | 3350 | 0.0002 | - | | 0.7220 | 3400 | 0.0002 | - | | 0.7326 | 3450 | 0.0002 | - | | 0.7433 | 3500 | 0.0002 | - | | 0.7539 | 3550 | 0.0002 | - | | 0.7645 | 3600 | 0.0002 | - | | 0.7751 | 3650 | 0.0002 | - | | 0.7857 | 3700 | 0.0002 | - | | 0.7963 | 3750 | 0.0002 | - | | 0.8070 | 3800 | 0.0002 | - | | 0.8176 | 3850 | 0.0002 | - | | 0.8282 | 3900 | 0.0002 | - | | 0.8388 | 3950 | 0.0002 | - | | 0.8494 | 4000 | 0.0002 | - | | 0.8601 | 4050 | 0.0002 | - | | 0.8707 | 4100 | 0.0002 | - | | 0.8813 | 4150 | 0.0002 | - | | 0.8919 | 4200 | 0.0002 | - | | 0.9025 | 4250 | 0.0002 | - | | 0.9131 | 4300 | 0.0002 | - | | 0.9238 | 4350 | 0.0002 | - | | 0.9344 | 4400 | 0.0002 | - | | 0.9450 | 4450 | 0.0001 | - | | 0.9556 | 4500 | 0.0002 | - | | 0.9662 | 4550 | 0.0001 | - | | 0.9769 | 4600 | 0.0002 | - | | 0.9875 | 4650 | 0.0001 | - | | 0.9981 | 4700 | 0.0002 | - | ### Framework Versions - Python: 3.11.13 - SetFit: 1.1.3 - Sentence Transformers: 5.1.0 - Transformers: 4.56.1 - PyTorch: 2.2.2 - Datasets: 4.0.0 - Tokenizers: 0.22.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} } ```