--- library_name: setfit tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer metrics: - accuracy widget: - text: 5 days before the flight, we were advised by BA that it had been cancelled and asked us to rebook. There were flights 1 hour before and 1 hour after our original flight but they made us take one 3 hours earlier. Our original ticket (and the return flight a week later) included a checked bag. When we arrive at Heathrow to check in we are told our ticket doesn't included a bag and we will have to pay 75 pounds each to take them. We explained that the original ticket had the bags and when they checked the system they confirmed that it did- but not this one! They would make no effort to sort it out and just told us to pay up or they would remove us from the flight. So we had no choice but to pay up, thinking it should be pretty easy to get a refund. 15 months and 10 emails later we have still not seen a penny. Every time I ask where my refund is and state how long we have been waiting I get an inane email saying some departments take longer than others to respond! Absolutely hopeless airline to stuff up the booking in the first place and even worse customer service to not even attempt to solve the problem at check in even when they could see the mistake THEY had made in their system, compounded by being be unable to investigate a very simple claim, and refund me 150 pounds in 15 months. - text: They downgraded me from business to premium economy. They took three months to get back to me and offered me 200 pounds or 400 AUD. The difference between business class and premium economy (which I never fly) is $3000 AUD and the difference between economy and business is $6500 AUD. They owe me at least 1500 pounds and to be very fair 3250 pounds. The downgrade was insulting and incredibly painful as I had a recent cancer operation and have a back injury which I have pointed out to them - I need to lie down. The wait for them to get around to me has been numbing. The insult of their offer has been the slap in the face to continue my degradation. The people I have dealt with at the airport have been down to earth, honest hard working people. The actual staff on the plane were warm and friendly - and helpful. The systems under which BA operates are some sort of medieval torture. - text: I flew from Istanbul to London in Business class. For more than half of the flight a child was watching an iPad very loud with no phones plugged in - it was three rows in front of me and disrupted my flight as I could hear it above my headphones. Staff thought this was fine and refused to tell the mom to turn it down. Why is this acceptable on a flight especially in business class? Has this airline turned into a zoo? Are staff given no training in customer service? Why is a child allowed to disrupt other passengers? When I told the staff she just laughed at me. BA customer service is a disgrace. I've not even mentioned the food but it was bad, really bad. - text: 'Mexico City Airport is a zoo, but taking the late departure on BA to LHR isn''t too bad. Club passengers can use the AA Admirals Lounge, which is surprisingly good and not too busy as it seems to cater to BA''s club passengers only at this time of day. Lovely staff, solid food & bar, really pleasant. We flew an older 787 with the old style club seats. Seated in the front cabin (just 3 rows of club) in the window and adjecant aisle seat is really good if you travel with your partner. Come to think of it, I will really miss this old style -once cutting edge- lay-out. There is no better way to fly when you are a couple. We were in that last row of the front cabin so both window and aisle seat had unobstructed access to the aisle. Still terrible you have to pay for these seats, but it obvioulsy works and we were happy getting these seats. Flying BA when the crew is good is amazing. Service was impecable on this flight. Just the right mix of humor, service and attention. Food seemed to be good as well, but hardly touched it. I am fine sleeping in these old club world seats although bedding could be better. On time departure, smooth flight and early arrival at Heathrow. We went outside for a smoke and returned to the terminal through fast track. Security at LHR has always been terrible, but today security staff was too busy chatting among themselves so all bags went through without ''secundary'' checks. We had a lovely shower at the ''spa'', what a fabulous facility. The South Lounge was crazy busy and it is just a design disaster. Who ever choose the bizarre combination of furniture: what a mess! Food on offer was solid and so are the drinks. Our home stretch to Amsterdam was pretty straight forward. Lousy welcome at the door but crew recovered well and made everyone feel special with excellent bar-cart service. I love the ''double''-servings of drinks. English tea is about the worst meal concepts in the world and I really don''t understand BA stuck to it through the years. No-one like the cucumber white bread things, but hey... On time landing in Amsterdam but the usual long taxi then clumsy jet bridge connection ended up with a 20 minute late arrival, why is it so hard to connect a jetbridge in Amsterdam? Flying club in BA is still wonderful. I Love it!' - text: We traveled to Lisbon for our dream vacation, a cruise to Portugal and Spain. Our friends did not EVER get their luggage. It was a two week cruise. Two weeks without a change of clothes or her CPAP machine. Contacting customer service was a nightmare. We never talked to a real person. Very little effort was put into getting them their bags. In one port we were on the ship and the bags were at the airport. The airlines did not deliver the bags nor did they tell our friends that they needed to go get them. The airline couldn’t be bothered to take the bags from the airport to the ship. BA says it is their policy to get you your bags within 72 hours. That is a joke! It’s been over two weeks and they still don’t have them. They are back home in the US and last they heard the bags were in Lisbon! If your have a choice, do not fly British Airways. Customer Service is non existent! pipeline_tag: text-classification inference: true base_model: sentence-transformers/paraphrase-mpnet-base-v2 model-index: - name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2 results: - task: type: text-classification name: Text Classification dataset: name: Unknown type: unknown split: test metrics: - type: accuracy value: 0.8333333333333334 name: Accuracy --- # 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 [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/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2) - **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:** 6 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 | |:------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 | | | 4 | | | 5 | | | 2 | | | 3 | | | 6 | | ## Evaluation ### Metrics | Label | Accuracy | |:--------|:---------| | **all** | 0.8333 | ## 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("I flew from Istanbul to London in Business class. For more than half of the flight a child was watching an iPad very loud with no phones plugged in - it was three rows in front of me and disrupted my flight as I could hear it above my headphones. Staff thought this was fine and refused to tell the mom to turn it down. Why is this acceptable on a flight especially in business class? Has this airline turned into a zoo? Are staff given no training in customer service? Why is a child allowed to disrupt other passengers? When I told the staff she just laughed at me. BA customer service is a disgrace. I've not even mentioned the food but it was bad, really bad.") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:---------|:----| | Word count | 23 | 144.6667 | 418 | | Label | Training Sample Count | |:------|:----------------------| | 1 | 7 | | 2 | 7 | | 3 | 7 | | 4 | 7 | | 5 | 7 | | 6 | 7 | ### Training Hyperparameters - batch_size: (8, 8) - num_epochs: (3, 3) - 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 - seed: 123 - eval_max_steps: -1 - load_best_model_at_end: False ### Training Results | Epoch | Step | Training Loss | Validation Loss | |:------:|:----:|:-------------:|:---------------:| | 0.0054 | 1 | 0.1708 | - | | 0.2717 | 50 | 0.0981 | - | | 0.5435 | 100 | 0.0739 | - | | 0.8152 | 150 | 0.0039 | - | | 1.0870 | 200 | 0.0005 | - | | 1.3587 | 250 | 0.0007 | - | | 1.6304 | 300 | 0.0002 | - | | 1.9022 | 350 | 0.0005 | - | | 2.1739 | 400 | 0.0004 | - | | 2.4457 | 450 | 0.0003 | - | | 2.7174 | 500 | 0.0005 | - | | 2.9891 | 550 | 0.0004 | - | ### Framework Versions - Python: 3.8.10 - SetFit: 1.0.3 - Sentence Transformers: 2.3.1 - Transformers: 4.37.2 - PyTorch: 2.2.0 - Datasets: 2.17.1 - Tokenizers: 0.15.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} } ```