Text Classification
setfit
Safetensors
sentence-transformers
bert
generated_from_setfit_trainer
text-embeddings-inference
Instructions to use mahitha-t/text_classification_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- setfit
How to use mahitha-t/text_classification_model with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("mahitha-t/text_classification_model") preds = model.predict(["i loved the spiderman movie!", "pineapple on pizza is the worst"]) print(preds) - sentence-transformers
How to use mahitha-t/text_classification_model with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("mahitha-t/text_classification_model") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Push model using huggingface_hub.
Browse filesFiles changed (3)
- README.md+50-5
- model.safetensors+1-1
- model_head.pkl+1-1
3 unmodified lines45678910111213141516171819204 unmodified lines252627282930317 unmodified lines39404142434412 unmodified lines5758596061626322 unmodified lines8687888990913 unmodified lines- sentence-transformers- text-classification- generated_from_setfit_trainerwidget: []metrics:- accuracypipeline_tag: text-classificationlibrary_name: setfitinference: true---# SetFitThis is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. 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:4 unmodified lines### Model Description- **Model Type:** SetFit<!-- - **Sentence Transformer:** [Unknown](https://huggingface.co/unknown) -->- **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:** 2 classes7 unmodified lines- **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)## Uses### Direct Use for Inference12 unmodified lines# Download from the 🤗 Hubmodel = SetFitModel.from_pretrained("mahitha-t/text_classification_model")# Run inferencepreds = model("I loved the spiderman movie!")```<!--22 unmodified lines## Training Details### Framework Versions- Python: 3.11.13- SetFit: 1.1.23 unmodified lines45678910111213141516171819202122232425264 unmodified lines313233343536377 unmodified lines45464748495051525354555612 unmodified lines6970717273747522 unmodified lines98991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351363 unmodified lines- sentence-transformers- text-classification- generated_from_setfit_trainerwidget:- text: This sentence is positive- text: This sentence is positive- text: This sentence is negative- text: This sentence is positive- text: This sentence is negativemetrics:- accuracypipeline_tag: text-classificationlibrary_name: setfitinference: truebase_model: TaylorAI/bge-micro-v2---# SetFit with TaylorAI/bge-micro-v2This 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.The model has been trained using an efficient few-shot learning technique that involves:4 unmodified lines### Model Description- **Model Type:** SetFit- **Sentence Transformer body:** [TaylorAI/bge-micro-v2](https://huggingface.co/TaylorAI/bge-micro-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:** 2 classes7 unmodified lines- **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 ||:------|:----------------------------------------------------------------------------------------------------------------------|| 0 | <ul><li>'This sentence is positive'</li><li>'This sentence is positive'</li><li>'This sentence is positive'</li></ul> || 1 | <ul><li>'This sentence is negative'</li><li>'This sentence is negative'</li><li>'This sentence is negative'</li></ul> |## Uses### Direct Use for Inference12 unmodified lines# Download from the 🤗 Hubmodel = SetFitModel.from_pretrained("mahitha-t/text_classification_model")# Run inferencepreds = model("This sentence is positive")```<!--22 unmodified lines## Training Details### Training Set Metrics| Training set | Min | Median | Max ||:-------------|:----|:-------|:----|| Word count | 4 | 4.0 | 4 || Label | Training Sample Count ||:------|:----------------------|| 0 | 8 || 1 | 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.1111 | 1 | 0.1561 | - |### Framework Versions- Python: 3.11.13- SetFit: 1.1.2
123version https://git-lfs.github.com/spec/v1oid sha256:92a95a693f2200c471a1932587089130f4b8dff5fb65750692e95890410151cfsize 69565312123version https://git-lfs.github.com/spec/v1oid sha256:18c5894dcbec50c5371dfcdbb55bfbd2a35e84842458cadc4f3a65b4c262eca3size 69565312
123version https://git-lfs.github.com/spec/v1oid sha256:6baec4859141d68412e257dd125d5bce359fd2927ec7d76ef28b7999aa634768size 3935123version https://git-lfs.github.com/spec/v1oid sha256:0348b82a079794b8bfae5d936e9db047b21d45ce0a80c81cac7990af255f4d5bsize 3935
README.md+50-5
model.safetensors+1-1
model_head.pkl+1-1