Team Ai
Modelpublic

rohithbojja/intent-classification-small

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

SetFit with BAAI/bge-small-en-v1.5

This is a SetFit model trained on the rbojja/zero-shot-intent-classification dataset that can be used for Text Classification. This SetFit model uses BAAI/bge-small-en-v1.5 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
7<ul><li>'Oh my, this is great!'</li><li>'Oh, this is fantastic!'</li><li>'Hmm, I’m so delighted!'</li></ul>
3<ul><li>"Oh, absolutely, that's it!"</li><li>"Oh, absolutely, that's it!"</li><li>"Yep, that's exactly what I meant."</li></ul>
15<ul><li>'Really, no way?'</li><li>'Oh, that’s quite something!'</li><li>'Oh, that’s quite something!'</li></ul>
8<ul><li>"Gotcha... oh, that's clear!"</li><li>'Hmm, I see... perfect!'</li><li>'Oh, I see... clear!'</li></ul>
12<ul><li>'Uhh, fine.'</li><li>'Oh, clear.'</li><li>'Uhh, noted.'</li></ul>
9<ul><li>'Uhh, take care!'</li><li>'Hmm, see you!'</li><li>'Uhh, see you!'</li></ul>
17<ul><li>'"Umm, this could be a decent plan."'</li><li>'"I think this might be the solution."'</li><li>'"Maybe this will work out, I suppose."'</li></ul>
0<ul><li>"Why can't you just work?!"</li><li>'Seriously, this is a joke!'</li><li>'Ugh, this is so frustrating!'</li></ul>
6<ul><li>'"Oh, what if I\'m a dream?"'</li><li>'"Oh, do you speak dolphin?"'</li><li>'"Uhh, do you have a wish?"'</li></ul>
11<ul><li>"Uh-huh, that's a valid point."</li><li>'Like, I get it.'</li><li>'Right, I understand.'</li></ul>
16<ul><li>'Thank you!'</li><li>'"Hmmm, thanks, you\'re great!"'</li><li>'"Oh, fantastic, thanks a lot!"'</li></ul>
4<ul><li>"Sorry, I'm not sure."</li><li>"Well, I'm lost."</li><li>"Hmm, I'm not sure."</li></ul>
10<ul><li>'Oh, hi!'</li><li>"Hello! What's new?"</li><li>"Hi! How's life?"</li></ul>
13<ul><li>'Oh, gotcha.'</li><li>'Hmmm, okay.'</li><li>'Alright, thanks.'</li></ul>
2<ul><li>'What’s the context behind that?'</li><li>'Could you simplify that for me?'</li><li>'Can you explain that concept?'</li></ul>
1<ul><li>'"Oh, I didn’t mean to."'</li><li>'"Oops, sorry for the oversight."'</li><li>'"Oops, I’m really sorry."'</li></ul>
5<ul><li>'Oh, this is not what I wanted.'</li><li>'Oh no, this is not right.'</li><li>'Seriously, this is a failure.'</li></ul>
14<ul><li>'Uhh, superb choice!'</li><li>'Uhh, amazing decision!'</li><li>'Oh, superb performance!'</li></ul>

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("rbojja/intent-classification-small")
# Run inference
preds = model("Uhh, clear.")

<!--

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 count24.22249
LabelTraining Sample Count
040
140
237
340
441
538
642
738
835
939
1042
1141
1242
1344
1438
1543
1647
1737

Training Hyperparameters

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

Training Results

EpochStepTraining LossValidation Loss
0.000610.149-
0.0276500.1836-
0.05521000.1408-
0.08291500.0978-
0.11052000.0805-
0.13812500.0684-
0.16573000.0594-
0.19343500.051-
0.22104000.0383-
0.24864500.0379-
0.27625000.035-
0.30395500.0334-
0.33156000.0306-
0.35916500.0266-
0.38677000.0264-
0.41447500.018-
0.44208000.0193-
0.46968500.0166-
0.49729000.0165-
0.52499500.016-
0.552510000.0177-
0.580110500.0202-
0.607711000.0133-
0.635411500.014-
0.663012000.013-
0.690612500.0161-
0.718213000.0119-
0.745913500.0132-
0.773514000.0131-
0.801114500.0123-
0.828715000.0115-
0.856415500.0111-
0.884016000.011-
0.911616500.01-
0.939217000.0098-
0.966917500.0142-
0.994518000.0132-

Framework Versions

  • —Python: 3.11.11
  • —SetFit: 1.1.1
  • —Sentence Transformers: 3.3.1
  • —Transformers: 4.47.1
  • —PyTorch: 2.5.1+cu121
  • —Datasets: 3.2.0
  • —Tokenizers: 0.21.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}
}

<!--

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. -->