--- library_name: setfit tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer base_model: sentence-transformers/paraphrase-mpnet-base-v2 metrics: - accuracy widget: - text: Thank you for your email. Please go ahead and issue. Please invoice in KES - text: Hi, We are missing some invoices, can you please provide it. 02 - 12 - 2020 AGENT FEE 8900784339018 $21.00 02 - 19 - 2020 AGENT FEE 0017417554160 $22.00 02 - 19 - 2020 AGENT FEE 0017417554143 $22.00 02 - 19 - 2020 AGENT FEE 8900783383420 $21.00 - text: I have reported this in November and not only was the trip supposed to be cancelled and credited I was double billed and the billing has not been corrected. The total credit should be $667.20. Please confirm this will be done. - text: As promised, kindly send the ticket. Dr Ntlatlapa wants to plan for a meeting while in Durban. - text: Amy Pengidore had planned to travel from Washington, DC to Chicago, IL next week and due to the coronavirus concerns we are looking to re-schedule her trip for a future date. She had airfare, car rental, and hotel scheduled and was to leave this Sunday, March 15th. Can you please direct us on what needs to be done to make changes? pipeline_tag: text-classification inference: true --- # SetFit with sentence-transformers/paraphrase-mpnet-base-v2 This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2) 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:** [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2) - **Classification head:** a [SetFitHead](huggingface.co/docs/setfit/reference/main#setfit.SetFitHead) instance - **Maximum Sequence Length:** 512 tokens - **Number of Classes:** 9 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 | |:------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 0 | | | 1 | | | 2 | | | 3 | | | 4 | | | 5 | | | 6 | | | 7 | | | 8 | | ## 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("mann2107/BCMPIIRABSetFit") # Run inference preds = model("Thank you for your email. Please go ahead and issue. Please invoice in KES") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:--------|:----| | Word count | 1 | 30.4097 | 124 | | Label | Training Sample Count | |:------|:----------------------| | 0 | 16 | | 1 | 16 | | 2 | 16 | | 3 | 16 | | 4 | 16 | | 5 | 16 | | 6 | 16 | | 7 | 16 | | 8 | 16 | ### Training Hyperparameters - batch_size: (16, 2) - 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: True - use_amp: False - warmup_proportion: 0.1 - max_length: 512 - seed: 42 - eval_max_steps: -1 - load_best_model_at_end: True ### Training Results | Epoch | Step | Training Loss | Validation Loss | |:-------:|:--------:|:-------------:|:---------------:| | 0.0009 | 1 | 0.2058 | - | | 0.0434 | 50 | 0.1316 | - | | 0.0868 | 100 | 0.0328 | - | | 0.1302 | 150 | 0.0038 | - | | 0.1736 | 200 | 0.0018 | - | | 0.2170 | 250 | 0.0009 | - | | 0.2604 | 300 | 0.002 | - | | 0.3038 | 350 | 0.0008 | - | | 0.3472 | 400 | 0.0006 | - | | 0.3906 | 450 | 0.001 | - | | 0.4340 | 500 | 0.0011 | - | | 0.4774 | 550 | 0.0005 | - | | 0.5208 | 600 | 0.0009 | - | | 0.5642 | 650 | 0.0003 | - | | 0.6076 | 700 | 0.0002 | - | | 0.6510 | 750 | 0.0003 | - | | 0.6944 | 800 | 0.0009 | - | | 0.7378 | 850 | 0.0002 | - | | 0.7812 | 900 | 0.0002 | - | | 0.8247 | 950 | 0.0002 | - | | 0.8681 | 1000 | 0.0004 | - | | 0.9115 | 1050 | 0.0002 | - | | 0.9549 | 1100 | 0.0003 | - | | 0.9983 | 1150 | 0.0003 | - | | **1.0** | **1152** | **-** | **0.0699** | * The bold row denotes the saved checkpoint. ### Framework Versions - Python: 3.9.16 - SetFit: 1.1.0.dev0 - Sentence Transformers: 2.2.2 - Transformers: 4.21.3 - PyTorch: 1.12.1+cu116 - Datasets: 2.4.0 - Tokenizers: 0.12.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} } ```