CoolFace
Modelpublic

Shankhdhar/classifier_woog_base_oos_combined

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes4downloads
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
product policy<ul><li>'Do you offer a gift wrapping service for sneakers?'</li><li>'What are the consequences if my account is suspended or terminated for any reason?'</li><li>'Do you share my personal information with third parties?'</li></ul>
general faq<ul><li>'Can you explain why Mashru silk is considered more comfortable to wear compared to pure silk sarees?'</li><li>'What are some tips for maximizing the antioxidant content when brewing green tea?'</li><li>'Can you recommend K-beauty products for hot and humid climates?'</li></ul>
product discoverability<ul><li>'Are there any sarees with Kadwa Weave technique?'</li><li>'cookie boxes with dividers'</li><li>'Are there any products for dry skin?'</li></ul>
Out of Scope<ul><li>'Is this website secure?'</li><li>'How do you handle intellectual property disputes?'</li><li>'Do you know how to play the piano?'</li></ul>
order tracking<ul><li>'I want to deliver candle supplies to Jaipur, how many days will it take to deliver?'</li><li>'I want to deliver bags to Pune, how many days will it take to deliver?'</li><li>'I need to change the delivery address for my recent order, how can I do that?'</li></ul>
product faq<ul><li>'Does this product help with dark spots?'</li><li>'3. Is this product currently in stock?'</li><li>'Is the product in stock?'</li></ul>

Evaluation

Metrics

LabelAccuracy
all0.8711

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 like to listen to classical music")

<!--

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 count410.6628
LabelTraining Sample Count
Out of Scope50
general faq50
order tracking50
product discoverability50
product faq50
product policy50

Training Hyperparameters

  • batch_size: (16, 16)
  • num_epochs: (2, 2)
  • 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.000210.2592-
0.0107500.2424-
0.02131000.1506-
0.03201500.222-
0.04272000.1227-
0.05332500.1801-
0.06403000.1111-
0.07473500.0346-
0.08534000.0313-
0.09604500.0048-
0.10675000.0023-
0.11735500.0018-
0.12806000.0133-
0.13876500.0008-
0.14937000.0006-
0.16007500.0005-
0.17068000.0008-
0.18138500.0007-
0.19209000.0006-
0.20269500.0006-
0.213310000.0003-
0.224010500.0026-
0.234611000.0004-
0.245311500.0004-
0.256012000.0004-
0.266612500.0005-
0.277313000.0005-
0.288013500.0003-
0.298614000.0001-
0.309314500.0001-
0.320015000.0002-
0.330615500.0002-
0.341316000.0002-
0.352016500.0001-
0.362617000.0004-
0.373317500.0002-
0.384018000.0005-
0.394618500.0002-
0.405319000.0002-
0.416019500.0001-
0.426620000.0001-
0.437320500.0001-
0.448021000.0001-
0.458621500.0001-
0.469322000.0002-
0.479922500.0048-
0.490623000.0001-
0.501323500.001-
0.511924000.0002-
0.522624500.0002-
0.533325000.0001-
0.543925500.0001-
0.554626000.0001-
0.565326500.0001-
0.575927000.0001-
0.586627500.0001-
0.597328000.0001-
0.607928500.0001-
0.618629000.0001-
0.629329500.0001-
0.639930000.0001-
0.650630500.0001-
0.661331000.0001-
0.671931500.0001-
0.682632000.0001-
0.693332500.0001-
0.703933000.0001-
0.714633500.0001-
0.725334000.0001-
0.735934500.0001-
0.746635000.0001-
0.757335500.0001-
0.767936000.0001-
0.778636500.0001-
0.789237000.0001-
0.799937500.0001-
0.810638000.0001-
0.821238500.0-
0.831939000.0001-
0.842639500.0001-
0.853240000.0001-
0.863940500.0001-
0.874641000.0001-
0.885241500.0-
0.895942000.0001-
0.906642500.0001-
0.917243000.0001-
0.927943500.0001-
0.938644000.0001-
0.949244500.0001-
0.959945000.0001-
0.970645500.0001-
0.981246000.0-
0.991946500.0001-
1.002647000.0-
1.013247500.0001-
1.023948000.0001-
1.034648500.0001-
1.045249000.0001-
1.055949500.0001-
1.066650000.0-
1.077250500.0-
1.087951000.0001-
1.098551500.0-
1.109252000.0-
1.119952500.0-
1.130553000.0001-
1.141253500.0001-
1.151954000.0-
1.162554500.0001-
1.173255000.0001-
1.183955500.0002-
1.194556000.0-
1.205256500.0-
1.215957000.0-
1.226557500.0-
1.237258000.0001-
1.247958500.0001-
1.258559000.0001-
1.269259500.0-
1.279960000.0-
1.290560500.0-
1.301261000.0001-
1.311961500.0-
1.322562000.0-
1.333262500.0-
1.343963000.0-
1.354563500.0-
1.365264000.0-
1.375964500.0-
1.386565000.0-
1.397265500.0-
1.407866000.0-
1.418566500.0-
1.429267000.0-
1.439867500.0-
1.450568000.0-
1.461268500.0-
1.471869000.0001-
1.482569500.0001-
1.493270000.0-
1.503870500.0-
1.514571000.0001-
1.525271500.0001-
1.535872000.0001-
1.546572500.0001-
1.557273000.0-
1.567873500.0-
1.578574000.0-
1.589274500.0001-
1.599875000.0-
1.610575500.0-
1.621276000.0-
1.631876500.0-
1.642577000.0-
1.653277500.0-
1.663878000.0-
1.674578500.0-
1.685279000.0-
1.695879500.0-
1.706580000.0-
1.717280500.0-
1.727881000.0-
1.738581500.0001-
1.749182000.0-
1.759882500.0-
1.770583000.0-
1.781183500.0001-
1.791884000.0-
1.802584500.0-
1.813185000.0-
1.823885500.0-
1.834586000.0001-
1.845186500.0-
1.855887000.0-
1.866587500.0001-
1.877188000.0-
1.887888500.0-
1.898589000.0-
1.909189500.0001-
1.919890000.0-
1.930590500.0-
1.941191000.0-
1.951891500.0-
1.962592000.0-
1.973192500.0-
1.983893000.0-
1.994593500.0-

Framework Versions

  • Python: 3.10.16
  • SetFit: 1.0.3
  • Sentence Transformers: 2.7.0
  • Transformers: 4.40.2
  • PyTorch: 2.2.2
  • Datasets: 2.19.1
  • Tokenizers: 0.19.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}
}

<!--

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