DanielTobi0's picture
Push model using huggingface_hub.
df01ed1 verified
---
tags:
- setfit
- sentence-transformers
- text-classification
- generated_from_setfit_trainer
widget:
- text: i feel if i completely hated things i d exercise my democratic right speak
my mind in what ever ways possible and try to enact a change
- text: i explain why i clung to a relationship with a boy who was in many ways immature
and uncommitted despite the excitement i should have been feeling for getting
accepted into the masters program at the university of virginia
- text: im updating my blog because i feel shitty
- text: i feel like i had a rather productive weekend and i cant always say that no
matter how much i get done
- text: i feel like my only role now would be to tear your sails with my pessimism
and discontent
metrics:
- accuracy
pipeline_tag: text-classification
library_name: setfit
inference: true
base_model: sentence-transformers/paraphrase-mpnet-base-v2
model-index:
- name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2
results:
- task:
type: text-classification
name: Text Classification
dataset:
name: Unknown
type: unknown
split: test
metrics:
- type: accuracy
value: 0.44
name: Accuracy
---
# SetFit with sentence-transformers/paraphrase-mpnet-base-v2
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-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.
The model has been trained using an efficient few-shot learning technique that involves:
1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
2. Training a classification head with features from the fine-tuned Sentence Transformer.
## Model Details
### Model Description
- **Model Type:** SetFit
- **Sentence Transformer body:** [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2)
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
- **Maximum Sequence Length:** 512 tokens
- **Number of Classes:** 6 classes
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
<!-- - **Language:** Unknown -->
<!-- - **License:** Unknown -->
### Model Sources
- **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
- **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
### Model Labels
| Label | Examples |
|:------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 2 | <ul><li>'i feel like i am abandoning him in a way but he is so supportive of the move'</li><li>'i reckon this is fair enough yes the queen is their monarch but they are so geographically removed from her and her presence that i appreciate that many australians may feel more loyal to their country and own communities than to the queen herself'</li><li>'i just think about all the day i chatted with my mom amp also feeling horny and masturbate myself'</li></ul> |
| 5 | <ul><li>'i missed about a month combined of classes and was pretty much bed ridden for months of the semester i feel really amazed that i was able to pass'</li><li>'i feel surprised because i didnt expect it'</li><li>'i read through the ol feefyefo space i feel amazed at how much i could blabber and how transparent i was with my life'</li></ul> |
| 4 | <ul><li>'when my relatives and i were in a car going slowly on a frozen road'</li><li>'i was feeling doubtful and sad about the relationship i have with this man'</li><li>'i feel bashful under his teasing scrutiny'</li></ul> |
| 1 | <ul><li>'i don t want to tell people how my first was with you and how you made me feel i don t want to think that you re the most gorgeous guy i ve ever seen and i love how other people disagree because i don t want them to see how truly wonderful you are to me'</li><li>'i met you i used to want to lock myself into a vault just to feel precious'</li><li>'i feel more content with what i have achieved and i know if i don t write today there ll still be a tomorrow'</li></ul> |
| 0 | <ul><li>'i feel like every day i grow stronger and become less needy of someone to fill that role'</li><li>'i know intellectually that it s not true but i feel entirely isolated'</li><li>'i didn t feel like doing much chris and i mostly just took too many pictures of unimportant stuff'</li></ul> |
| 3 | <ul><li>'i was yelling to the group in front and not getting an answer and getting increasingly concerned and feeling increasingly frustrated with those lagging behind despite repeated explanations and pleas from me regarding the need to catch up with the advance group'</li><li>'i was feeling annoyed suddenly'</li><li>'i didnt even have time to feel jealous i was so busy pinning her pictures and writing down a href http nanashi'</li></ul> |
## Evaluation
### Metrics
| Label | Accuracy |
|:--------|:---------|
| **all** | 0.44 |
## 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("DanielTobi0/setfit-emotion-categorization")
# Run inference
preds = model("im updating my blog because i feel shitty")
```
<!--
### 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 set | Min | Median | Max |
|:-------------|:----|:-------|:----|
| Word count | 5 | 22.25 | 58 |
| Label | Training Sample Count |
|:------|:----------------------|
| 0 | 8 |
| 1 | 8 |
| 2 | 8 |
| 3 | 8 |
| 4 | 8 |
| 5 | 8 |
### Training Hyperparameters
- batch_size: (16, 2)
- num_epochs: (1, 16)
- max_steps: -1
- sampling_strategy: oversampling
- 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.0083 | 1 | 0.2152 | - |
| 0.4167 | 50 | 0.1962 | - |
| 0.8333 | 100 | 0.063 | - |
### Framework Versions
- Python: 3.13.13
- SetFit: 1.1.3
- Sentence Transformers: 5.5.1
- Transformers: 4.57.6
- PyTorch: 2.12.0+cu130
- Datasets: 4.8.5
- Tokenizers: 0.22.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.*
-->