Input Classifier

This is a SetFit model that can be used for Text Classification. This SetFit model uses jaimevera1107/all-MiniLM-L6-v2-similarity-es 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. Fine-tuning a Sentence Transformer with contrastive learning.
  2. Training a classification head with features from the fine-tuned Sentence Transformer.

Model Details

Model Description

Model Sources

Model Labels

Label Examples
request
  • 'lencería necesaria'
  • 'material necesario para hoy'
  • 'terminé la habitación 234'
conversation
  • 'buena noche'
  • 'Qué pasa, tío, ¿todo bien?'
  • 'Buenas, ¿cómo va la cosa?!'
help
  • 'ayuda por favor'
  • 'Ayuda que no sé que puedo hacer'
  • 'Hola, que puedo hacer'
censorship
  • 'Eres un completo inútil, no sirves para nada'
  • 'Siempre diciendo estupideces, mejor cállate'
  • 'Tu sola existencia es una vergüenza'

Uses

Direct Use for Inference

First install the SetFit library:

pip install setfit

Then you can load this model and run inference.

from setfit import SetFitModel

# Download from the 🤗 Hub
model = SetFitModel.from_pretrained("monentiadev/es-input-classifier")
# Run inference
preds = model("Hola")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 1 5.0723 38
Label Training Sample Count
censorship 407
conversation 137
help 274
request 552

Training Hyperparameters

  • batch_size: (128, 128)
  • num_epochs: (3, 3)
  • max_steps: -1
  • sampling_strategy: oversampling
  • num_iterations: 20
  • body_learning_rate: (2e-05, 1e-05)
  • head_learning_rate: 0.01
  • loss: CosineSimilarityLoss
  • distance_metric: cosine_distance
  • margin: 0.25
  • end_to_end: False
  • use_amp: False
  • warmup_proportion: 0.1
  • l2_weight: 0.01
  • seed: 42
  • eval_max_steps: -1
  • load_best_model_at_end: False

Training Results

Epoch Step Training Loss Validation Loss
0.0023 1 0.3161 -
0.1166 50 0.2857 -
0.2331 100 0.2158 -
0.3497 150 0.1581 -
0.4662 200 0.0878 -
0.5828 250 0.0299 -
0.6993 300 0.0124 -
0.8159 350 0.0083 -
0.9324 400 0.006 -
1.0490 450 0.0038 -
1.1655 500 0.0027 -
1.2821 550 0.0027 -
1.3986 600 0.0017 -
1.5152 650 0.0016 -
1.6317 700 0.0013 -
1.7483 750 0.0012 -
1.8648 800 0.0012 -
1.9814 850 0.001 -
2.0979 900 0.001 -
2.2145 950 0.0011 -
2.3310 1000 0.0009 -
2.4476 1050 0.0008 -
2.5641 1100 0.0009 -
2.6807 1150 0.0008 -
2.7972 1200 0.0008 -
2.9138 1250 0.0007 -

Framework Versions

  • Python: 3.10.0
  • SetFit: 1.1.2
  • Sentence Transformers: 5.0.0
  • Transformers: 4.53.1
  • PyTorch: 2.7.1+cu126
  • Datasets: 2.19.2
  • Tokenizers: 0.21.2
Downloads last month
23
Safetensors
Model size
22.7M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for monentiadev/es-input-classifier

Finetuned
(1)
this model