CoolFace
Modelpublic

thegenerativegeneration/stay_or_go_conversation_classifier_xs

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

SetFit with intfloat/e5-small-v2

This is a SetFit model that can be used for Text Classification. This SetFit model uses intfloat/e5-small-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 Type: SetFit
  • Sentence Transformer body: intfloat/e5-small-v2
  • Classification head: a LogisticRegression instance
  • Maximum Sequence Length: 512 tokens
  • Number of Classes: 2 classes <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Model Labels

LabelExamples
0<ul><li>'query: Oi Pedro, você viu o novo filme que estreou semana passada?'</li><li>'query: Também gostei muito. Quem sabe podemos assistir juntos na próxima vez.'</li><li>'query: Jeg har det godt, tak. Hvad med dig?'</li></ul>
1<ul><li>'query: Combinado! Vamos marcar um dia. Até mais!'</li><li>'query: Måske. Skal vi tale om det senere?'</li><li>'query: Absolument. On se voit ce soir pour fêter ça. À plus tard!'</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("setfit_model_id")
# Run inference
preds = model("query: 好的,那就先这样,李先生,再见。")

<!--

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 count26.267418
LabelTraining Sample Count
085
187

Training Hyperparameters

  • batch_size: (4, 1)
  • num_epochs: (1, 1)
  • max_steps: -1
  • sampling_strategy: undersampling
  • bodylearningrate: (1e-06, 1e-06)
  • headlearningrate: 8e-06
  • loss: CosineSimilarityLoss
  • distancemetric: cosinedistance
  • margin: 0.05
  • endtoend: False
  • use_amp: False
  • warmup_proportion: 0.1
  • seed: 42
  • run_name: intfloat/e5-small-v2
  • evalmaxsteps: -1
  • loadbestmodelatend: True

Training Results

EpochStepTraining LossValidation Loss
0.000310.3851-
0.0135500.3455-
0.02701000.33590.3522
0.04061500.3459-
0.05412000.36450.3221
0.06762500.3264-
0.08113000.29550.2759
0.09463500.2546-
0.10824000.22530.2373
0.12174500.2004-
0.13525000.35780.2318
0.14875500.2628-
0.16226000.26140.2222
0.17586500.2095-
0.18937000.23450.2196
0.20287500.1842-
0.21638000.19420.2326
0.22998500.218-
0.24349000.31340.2422
0.25699500.1639-
0.270410000.21380.23
0.283910500.3102-
0.297511000.13470.2348
0.311011500.1698-
0.324512000.24670.2547
0.338012500.1064-
0.351513000.17570.2383
0.365113500.1093-
0.378614000.28690.2393
0.392114500.2519-
0.405615000.23440.2323
0.419115500.2804-
0.432716000.10820.2403
0.446216500.2025-
0.459717000.22130.2547
0.473217500.1302-
0.486718000.15170.2345
0.500318500.2779-
0.513819000.19180.2339
0.527319500.1132-
0.540820000.20750.253
0.554420500.2488-
0.567921000.05790.2526
0.581421500.3789-
0.594922000.1670.2573
0.608422500.199-
0.622023000.08240.2258
0.635523500.1396-
0.649024000.36740.2527
0.662524500.2448-
0.676025000.16230.249
0.689625500.2198-
0.703126000.1180.2613
0.716626500.1511-
0.730127000.11620.2351
0.743627500.1393-
0.757228000.18450.2418
0.770728500.1821-
0.784229000.17620.254
0.797729500.0477-
0.811230000.19280.2633
0.824830500.1363-
0.838331000.08110.261
0.851831500.0734-
0.865332000.09170.2202
0.878932500.3027-
0.892433000.15280.2767
0.905933500.2234-
0.919434000.10480.2667
0.932934500.1865-
0.946535000.0510.2612
0.960035500.0218-
0.973536000.15240.243
0.987036500.1759-
  • The bold row denotes the saved checkpoint.

Framework Versions

  • Python: 3.10.11
  • SetFit: 1.0.3
  • Sentence Transformers: 2.7.0
  • Transformers: 4.39.0
  • PyTorch: 2.3.1
  • Datasets: 2.20.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. -->