CoolFace
Modelpublic

JulioCesarRiveraSoto/text_classification_model

sourceHugging Faceupdated 11mo agoView on Hugging Face
0likes10downloads
README.md175 linesDownload Raw Back to root
1---2tags:3- setfit4- sentence-transformers5- text-classification6- generated_from_setfit_trainer7widget:8- text: This sentence is positive9- text: This sentence is positive10- text: This sentence is negative11- text: This sentence is positive12- text: This sentence is negative13metrics:14- accuracy15pipeline_tag: text-classification16library_name: setfit17inference: true18base_model: TaylorAI/bge-micro-v219---20 21# SetFit with TaylorAI/bge-micro-v222 23This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [TaylorAI/bge-micro-v2](https://huggingface.co/TaylorAI/bge-micro-v2) as the Sentence Transformer embedding model. A [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance is used for classification.24 25The model has been trained using an efficient few-shot learning technique that involves:26 271. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.282. Training a classification head with features from the fine-tuned Sentence Transformer.29 30## Model Details31 32### Model Description33- **Model Type:** SetFit34- **Sentence Transformer body:** [TaylorAI/bge-micro-v2](https://huggingface.co/TaylorAI/bge-micro-v2)35- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance36- **Maximum Sequence Length:** 512 tokens37- **Number of Classes:** 2 classes38<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->39<!-- - **Language:** Unknown -->40<!-- - **License:** Unknown -->41 42### Model Sources43 44- **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)45- **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)46- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)47 48### Model Labels49| Label | Examples                                                                                                              |50|:------|:----------------------------------------------------------------------------------------------------------------------|51| 0     | <ul><li>'This sentence is positive'</li><li>'This sentence is positive'</li><li>'This sentence is positive'</li></ul> |52| 1     | <ul><li>'This sentence is negative'</li><li>'This sentence is negative'</li><li>'This sentence is negative'</li></ul> |53 54## Uses55 56### Direct Use for Inference57 58First install the SetFit library:59 60```bash61pip install setfit62```63 64Then you can load this model and run inference.65 66```python67from setfit import SetFitModel68 69# Download from the 🤗 Hub70model = SetFitModel.from_pretrained("JulioCesarRiveraSoto/text_classification_model")71# Run inference72preds = model("This sentence is positive")73```74 75<!--76### Downstream Use77 78*List how someone could finetune this model on their own dataset.*79-->80 81<!--82### Out-of-Scope Use83 84*List how the model may foreseeably be misused and address what users ought not to do with the model.*85-->86 87<!--88## Bias, Risks and Limitations89 90*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*91-->92 93<!--94### Recommendations95 96*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*97-->98 99## Training Details100 101### Training Set Metrics102| Training set | Min | Median | Max |103|:-------------|:----|:-------|:----|104| Word count   | 4   | 4.0    | 4   |105 106| Label | Training Sample Count |107|:------|:----------------------|108| 0     | 8                     |109| 1     | 8                     |110 111### Training Hyperparameters112- batch_size: (16, 2)113- num_epochs: (1, 16)114- max_steps: -1115- sampling_strategy: oversampling116- body_learning_rate: (2e-05, 1e-05)117- head_learning_rate: 0.01118- loss: CosineSimilarityLoss119- distance_metric: cosine_distance120- margin: 0.25121- end_to_end: False122- use_amp: False123- warmup_proportion: 0.1124- l2_weight: 0.01125- seed: 42126- eval_max_steps: -1127- load_best_model_at_end: False128 129### Training Results130| Epoch  | Step | Training Loss | Validation Loss |131|:------:|:----:|:-------------:|:---------------:|132| 0.1111 | 1    | 0.1494        | -               |133 134### Framework Versions135- Python: 3.12.12136- SetFit: 1.1.3137- Sentence Transformers: 5.1.1138- Transformers: 4.57.1139- PyTorch: 2.8.0+cu126140- Datasets: 4.2.0141- Tokenizers: 0.22.1142 143## Citation144 145### BibTeX146```bibtex147@article{https://doi.org/10.48550/arxiv.2209.11055,148    doi = {10.48550/ARXIV.2209.11055},149    url = {https://arxiv.org/abs/2209.11055},150    author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},151    keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},152    title = {Efficient Few-Shot Learning Without Prompts},153    publisher = {arXiv},154    year = {2022},155    copyright = {Creative Commons Attribution 4.0 International}156}157```158 159<!--160## Glossary161 162*Clearly define terms in order to be accessible across audiences.*163-->164 165<!--166## Model Card Authors167 168*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*169-->170 171<!--172## Model Card Contact173 174*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*175-->