CoolFace
Modelpublic

super-cinnamon/fewshot-followup-multi-e5

sourceHugging Faceupdated 11mo agoView on Hugging Face
3likes16downloads
Model Card

SetFit with intfloat/multilingual-e5-small

This is a SetFit model that can be used for Text Classification. This SetFit model uses intfloat/multilingual-e5-small 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/multilingual-e5-small
  • 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
independent<ul><li>'Comment rédiger un contrat de travail ?'</li><li>'Quels sont les impôts et taxes applicables aux entreprises ?'</li><li>'Comment peut-on contester un licenciement abusif ?'</li></ul>
follow_up<ul><li>'Quelles sont les conséquences de cette loi ?'</li><li>"Comment cette loi s'inscrit-elle dans le cadre plus large du droit algérien ?"</li><li>"Comment puis-je obtenir plus d'informations sur ce sujet ?"</li></ul>

Evaluation

Metrics

LabelAccuracy
all1.0

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("super-cinnamon/fewshot-followup-multi-e5")
# Run inference
preds = model("Comment se déroule une procédure de divorce ?")

<!--

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 count19.618416
LabelTraining Sample Count
independent43
follow_up33

Training Hyperparameters

  • batch_size: (8, 8)
  • num_epochs: (10, 10)
  • 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: False

Training Results

EpochStepTraining LossValidation Loss
0.002710.3915-
0.1326500.3193-
0.26531000.2252-
0.39791500.1141-
0.53052000.0197-
0.66312500.0019-
0.79583000.0021-
0.92843500.0002-
1.06104000.0008-
1.19364500.0005-
1.32635000.0002-
1.45895500.0002-
1.59156000.0007-
1.72416500.0001-
1.85687000.0003-
1.98947500.0002-
2.12208000.0001-
2.25468500.0002-
2.38739000.0-
2.51999500.0003-
2.652510000.0001-
2.785110500.0001-
2.917811000.0001-
3.050411500.0001-
3.183012000.0001-
3.315612500.0001-
3.448313000.0001-
3.580913500.0001-
3.713514000.0-
3.846214500.0-
3.978815000.0-
4.111415500.0-
4.244016000.0001-
4.376716500.0001-
4.509317000.0001-
4.641917500.0001-
4.774518000.0-
4.907218500.0001-
5.039819000.0-
5.172419500.0001-
5.305020000.0-
5.437720500.0001-
5.570321000.0-
5.702921500.0-
5.835522000.0-
5.968222500.0001-
6.100823000.0001-
6.233423500.0-
6.366024000.0001-
6.498724500.0-
6.631325000.0-
6.763925500.0-
6.896626000.0-
7.029226500.0-
7.161827000.0-
7.294427500.0-
7.427128000.0001-
7.559728500.0-
7.692329000.0-
7.824929500.0-
7.957630000.0-
8.090230500.0-
8.222831000.0-
8.355431500.0-
8.488132000.0001-
8.620732500.0-
8.753333000.0-
8.885933500.0-
9.018634000.0001-
9.151234500.0-
9.283835000.0-
9.416435500.0001-
9.549136000.0-
9.681736500.0001-
9.814337000.0-
9.946937500.0001-

Framework Versions

  • Python: 3.10.12
  • SetFit: 1.0.1
  • Sentence Transformers: 2.2.2
  • Transformers: 4.35.2
  • PyTorch: 2.1.0+cu118
  • Datasets: 2.15.0
  • Tokenizers: 0.15.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. -->