CoolFace
Modelpublic

aisuko/st-mpnet-v2-amazon-mi

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes7downloads
Model Card

SetFit with sentence-transformers/paraphrase-mpnet-base-v2

This is a SetFit model that can be used for Text Classification. This SetFit model uses sentence-transformers/paraphrase-mpnet-base-v2 as the Sentence Transformer embedding model. A LogisticRegression instance is used for classification.

The model has been trained using an efficient few-shot learning technique that involves:

  1. 1.Fine-tuning a Sentence Transformer with contrastive learning.
  2. 2.Training a classification head with features from the fine-tuned Sentence Transformer.

Model Details

Model Description

Model Sources

Model Labels

LabelExamples
alarm_query<ul><li>'do i have any alarms set for six am tomorrow'</li><li>'what is the wake up time for my alarm i have set for the flight this weekend'</li><li>'please tell me what alarms are on'</li></ul>
alarm_set<ul><li>'set an alarm for six thirty am'</li><li>'add an alarm for tomorrow morning at six am'</li><li>'wake me up at five am'</li></ul>
audiovolumemute<ul><li>'can you please stop speaking'</li><li>'turn off sound'</li><li>'shut down the sound'</li></ul>
calendar_query<ul><li>'how long will my lunch meeting be on tuesday'</li><li>'what time is my doctor appointment on march thirty first'</li><li>'what days do i have booked'</li></ul>
calendar_remove<ul><li>'clear everything off my calendar for the rest of the year'</li><li>'please clear my calendar'</li><li>'remove from my calendar meeting at nine am'</li></ul>
calendar_set<ul><li>'new event'</li><li>'remind me of the event in my calendar'</li><li>"mark april twenty as my brother's birthday"</li></ul>
cooking_recipe<ul><li>'tell me the recipe of'</li><li>'how is rice prepared'</li><li>'what ingredient can be used instead of saffron'</li></ul>
datetime_query<ul><li>'what is the time in canada now'</li><li>"what's the time in australia"</li><li>'display the local time of london at this moment'</li></ul>
email_query<ul><li>'do i have any unread emails'</li><li>'what about new mail'</li><li>'olly do i have any new emails'</li></ul>
email_sendemail<ul><li>'dictate email'</li><li>'reply an email to jason that i will not come tonight'</li><li>'please send an email to cassy who is there on my family and friend list'</li></ul>
general_quirky<ul><li>'where was will ferrell seen last night'</li><li>'do you think i should go to the theater today'</li><li>'what is the best chocolate chip cookies recipe'</li></ul>
iot_coffee<ul><li>'i need a drink'</li><li>'please activate my coffee pot for me'</li><li>'prepare a cup of coffee for me'</li></ul>
iothuelightchange<ul><li>'please make the lights natural'</li><li>'make the room light blue'</li><li>'hey olly chance the current light settings'</li></ul>
iothuelightoff<ul><li>'siri please turn the lights off in the bathroom'</li><li>'turn my bedroom lights off'</li><li>'no lights in the kitchen'</li></ul>
lists_createoradd<ul><li>'add business contacts to contact list'</li><li>'please create a new list for me'</li><li>"i want to make this week's shopping list"</li></ul>
lists_query<ul><li>'give me all available lists'</li><li>'give me the details on purchase order'</li><li>'find the list'</li></ul>
lists_remove<ul><li>'replace'</li><li>"delete my to do's for this week"</li><li>'get rid of tax list from nineteen ninety'</li></ul>
music_likeness<ul><li>'store opinion on song'</li><li>'are there any upcoming concerts by'</li><li>'enter song suggestion'</li></ul>
music_query<ul><li>'is the song by shakira'</li><li>'which film the music comes from what is the name of the music'</li><li>'which song is this one'</li></ul>
news_query<ul><li>'news articles on a particular subject'</li><li>'get me match highlights'</li><li>'show me the latest news from the guardian'</li></ul>
play_audiobook<ul><li>'continue the last chapter of the audio book i was listening to'</li><li>'open davinci code audiobook'</li><li>'resume the playback of a child called it'</li></ul>
play_game<ul><li>'bring up papa pear saga'</li><li>'play ping pong'</li><li>'play racing'</li></ul>
play_music<ul><li>'play mf doom anything'</li><li>'play only all music released between the year one thousand nine hundred and ninety and two thousand'</li><li>'nobody knows'</li></ul>
play_podcasts<ul><li>'play all order of the green hand from previous week'</li><li>'i want to see the next podcast available'</li><li>"search for podcasts that cover men's issues"</li></ul>
play_radio<ul><li>'can you turn on the radio'</li><li>'play country radio'</li><li>'tune to classic hits'</li></ul>
qa_currency<ul><li>'let me know about the exchange rate of rupee to dirham'</li><li>'how much is one dollar in pounds'</li><li>'what is the most current exchange rate in china'</li></ul>
qa_definition<ul><li>'define elaborate'</li><li>'look up the definition of blunder'</li><li>'give details of rock sand'</li></ul>
qa_factoid<ul><li>'where are the rocky mountains'</li><li>'what is the population of new york'</li><li>'where is new zealand located on a map'</li></ul>
recommendation_events<ul><li>'are there any fun events in la today'</li><li>"what's happening around me"</li><li>'are there any crafts fairs happening in this area'</li></ul>
recommendation_locations<ul><li>'what is the nearest pizza shop'</li><li>'please look up local restaurants that are open now'</li><li>'tell me what clothing stores are within five miles of me'</li></ul>
social_post<ul><li>"tweet at united airlines i'm angry you lost my bags"</li><li>'send a funny message to all of my friends'</li><li>'tweet my current location'</li></ul>
takeaway_query<ul><li>'could you please confirm if paradise does takeaway'</li><li>"i've canceled the order placed at mcd did it go through"</li><li>"please find out of charley's steakhouse delivers"</li></ul>
transport_query<ul><li>'directions please'</li><li>'what time does the train to place leave'</li><li>'look up the map to stores near me'</li></ul>
transport_ticket<ul><li>'find me a train ticket to boston'</li><li>'can you please book train tickets for two for this friday'</li><li>'order a train ticket to boston'</li></ul>
weather_query<ul><li>'will i need to shovel my driveway this morning'</li><li>'does the weather call for rain saturday'</li><li>'is there any rain in the forecast for the next week'</li></ul>

Evaluation

Metrics

LabelAccuracy
all0.7743

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("aisuko/st-mpnet-v2-amazon-mi")
# Run inference
preds = model("do i need a jacket")

<!--

Downstream Use

List how someone could finetune this model on their own dataset. -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Set Metrics

Training setMinMedianMax
Word count16.711419
LabelTraining Sample Count
alarm_query10
alarm_set10
audiovolumemute10
calendar_query10
calendar_remove10
calendar_set10
cooking_recipe10
datetime_query10
email_query10
email_sendemail10
general_quirky10
iot_coffee10
iothuelightchange10
iothuelightoff10
lists_createoradd10
lists_query10
lists_remove10
music_likeness10
music_query10
news_query10
play_audiobook10
play_game10
play_music10
play_podcasts10
play_radio10
qa_currency10
qa_definition10
qa_factoid10
recommendation_events10
recommendation_locations10
social_post10
takeaway_query10
transport_query10
transport_ticket10
weather_query10

Training Hyperparameters

  • —batch_size: (16, 16)
  • —num_epochs: (1, 1)
  • —max_steps: -1
  • —sampling_strategy: oversampling
  • —bodylearningrate: (2e-05, 1e-05)
  • —headlearningrate: 0.01
  • —loss: CosineSimilarityLoss
  • —distancemetric: cosinedistance
  • —margin: 0.25
  • —endtoend: False
  • —use_amp: False
  • —warmup_proportion: 0.1
  • —seed: 42
  • —evalmaxsteps: -1
  • —loadbestmodelatend: True

Training Results

EpochStepTraining LossValidation Loss
0.000110.1814-
0.0067500.1542-
0.01341000.0953-
0.02021500.0991-
0.02692000.0717-
0.03362500.0653-
0.04033000.0412-
0.04713500.0534-
0.05384000.013-
0.06054500.0567-
0.06725000.0235-
0.07395500.0086-
0.08076000.0086-
0.08746500.0786-
0.09417000.0092-
0.10087500.0081-
0.10768000.0196-
0.11438500.0138-
0.12109000.0081-
0.12779500.0295-
0.134410000.0074-
0.141210500.0025-
0.147911000.0036-
0.154611500.0021-
0.161312000.0168-
0.168112500.0024-
0.174813000.0039-
0.181513500.0155-
0.188214000.0057-
0.194914500.0027-
0.201715000.0018-
0.208415500.0012-
0.215116000.0032-
0.221816500.0017-
0.228617000.0012-
0.235317500.002-
0.242018000.0025-
0.248718500.0014-
0.255419000.0033-
0.262219500.0007-
0.268920000.0006-
0.275620500.001-
0.282321000.001-
0.289121500.0007-
0.295822000.0011-
0.302522500.0009-
0.309223000.0006-
0.315923500.001-
0.322724000.0005-
0.329424500.0012-
0.336125000.0005-
0.342825500.0007-
0.349626000.0018-
0.356326500.0008-
0.363027000.0009-
0.369727500.0007-
0.376428000.0013-
0.383228500.0004-
0.389929000.0005-
0.396629500.0005-
0.403330000.0006-
0.410130500.0005-
0.416831000.0004-
0.423531500.0007-
0.430232000.0009-
0.436932500.0007-
0.443733000.0007-
0.450433500.0004-
0.457134000.0004-
0.463834500.0009-
0.470635000.0006-
0.477335500.0006-
0.484036000.0005-
0.490736500.0005-
0.497437000.0003-
0.504237500.0004-
0.510938000.0004-
0.517638500.0005-
0.524339000.0007-
0.531139500.0005-
0.537840000.0006-
0.544540500.0004-
0.551241000.0006-
0.557941500.0005-
0.564742000.0004-
0.571442500.0003-
0.578143000.0003-
0.584843500.0005-
0.591644000.0002-
0.598344500.0006-
0.605045000.0004-
0.611745500.0005-
0.618446000.0003-
0.625246500.0005-
0.631947000.0007-
0.638647500.0003-
0.645348000.0004-
0.652148500.0004-
0.658849000.0004-
0.665549500.0003-
0.672250000.0003-
0.678950500.0004-
0.685751000.0003-
0.692451500.0005-
0.699152000.0002-
0.705852500.0004-
0.712653000.0003-
0.719353500.0007-
0.726054000.0002-
0.732754500.0002-
0.739455000.0005-
0.746255500.0003-
0.752956000.0003-
0.759656500.0003-
0.766357000.0004-
0.773157500.0004-
0.779858000.0004-
0.786558500.0003-
0.793259000.0003-
0.799959500.0004-
0.806760000.0004-
0.813460500.0004-
0.820161000.0003-
0.826861500.0002-
0.833662000.0005-
0.840362500.0003-
0.847063000.0003-
0.853763500.0002-
0.860464000.0003-
0.867264500.0004-
0.873965000.0002-
0.880665500.0003-
0.887366000.0003-
0.894166500.0002-
0.900867000.0002-
0.907567500.0002-
0.914268000.0002-
0.920968500.0003-
0.927769000.0002-
0.934469500.0002-
0.941170000.0002-
0.947870500.0002-
0.954671000.0002-
0.961371500.0003-
0.968072000.0002-
0.974772500.0003-
0.981473000.0002-
0.988273500.0003-
0.994974000.0003-
1.07438-0.0755
  • —The bold row denotes the saved checkpoint.

Framework Versions

  • —Python: 3.10.13
  • —SetFit: 1.0.3
  • —Sentence Transformers: 2.7.0
  • —Transformers: 4.39.3
  • —PyTorch: 2.1.2
  • —Datasets: 2.18.0
  • —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}
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->