Run this model with HF Jobs
Run bachbouch/setfit-ethos-multilabel-example on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/bachbouch/setfit-ethos-multilabel-example. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/bachbouch/setfit-ethos-multilabel-example on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use bachbouch/setfit-ethos-multilabel-example with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use bachbouch/setfit-ethos-multilabel-example with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("bachbouch/setfit-ethos-multilabel-example") 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] - setfit
How to use bachbouch/setfit-ethos-multilabel-example with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("bachbouch/setfit-ethos-multilabel-example") preds = model.predict(["i loved the spiderman movie!", "pineapple on pizza is the worst"]) print(preds) - Notebooks
- Google Colab
- Kaggle
Sam Bouguerra commited on
Commit ·
8e843d4
1
Parent(s): 5cfed47
Add SetFit model
Browse filesFiles changed (13)
- 1_Pooling/config.jsonAdded+7
- README.mdAdded+49
- config.jsonAdded+28
- config_sentence_transformers.jsonAdded+7
- merges.txtAdded
- model_head.pklAdded+3
- modules.jsonAdded+20
- pytorch_model.binAdded+3
- sentence_bert_config.jsonAdded+4
- special_tokens_map.jsonAdded+15
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+15
- vocab.jsonAdded
1234567{ "word_embedding_dimension": 1024, "pooling_mode_cls_token": false, "pooling_mode_mean_tokens": true, "pooling_mode_max_tokens": false, "pooling_mode_mean_sqrt_len_tokens": false}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849---license: apache-2.0tags:- setfit- sentence-transformers- text-classificationpipeline_tag: text-classification---
# samYahoo/setfit-ethos-multilabel-example
This is a [SetFit model](https://github.com/huggingface/setfit) that can be used for text 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.
## Usage
To use this model for inference, first install the SetFit library:
```bashpython -m pip install setfit```
You can then run inference as follows:
```pythonfrom setfit import SetFitModel
# Download from Hub and run inferencemodel = SetFitModel.from_pretrained("samYahoo/setfit-ethos-multilabel-example")# Run inferencepreds = model(["i loved the spiderman movie!", "pineapple on pizza is the worst 🤮"])```
## BibTeX entry and citation info
```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}}```12345678910111213141516171819202122232425262728{ "_name_or_path": "/root/.cache/torch/sentence_transformers/sentence-transformers_all-roberta-large-v1/", "architectures": [ "RobertaModel" ], "attention_probs_dropout_prob": 0.1, "bos_token_id": 0, "classifier_dropout": null, "eos_token_id": 2, "gradient_checkpointing": false, "hidden_act": "gelu", "hidden_dropout_prob": 0.1, "hidden_size": 1024, "initializer_range": 0.02, "intermediate_size": 4096, "layer_norm_eps": 1e-05, "max_position_embeddings": 514, "model_type": "roberta", "num_attention_heads": 16, "num_hidden_layers": 24, "pad_token_id": 1, "position_embedding_type": "absolute", "torch_dtype": "float32", "transformers_version": "4.28.1", "type_vocab_size": 1, "use_cache": true, "vocab_size": 50265}1234567{ "__version__": { "sentence_transformers": "2.0.0", "transformers": "4.6.1", "pytorch": "1.8.1" }}123version https://git-lfs.github.com/spec/v1oid sha256:db1aeaba425f9cefabc4375efd78d2a8a1db0914acd740e6ac48fde87a90ee49size 4001234567891011121314151617181920[ { "idx": 0, "name": "0", "path": "", "type": "sentence_transformers.models.Transformer" }, { "idx": 1, "name": "1", "path": "1_Pooling", "type": "sentence_transformers.models.Pooling" }, { "idx": 2, "name": "2", "path": "2_Normalize", "type": "sentence_transformers.models.Normalize" }]123version https://git-lfs.github.com/spec/v1oid sha256:25e640479b20b52632ef3b42f99e79ef4704fc9c4d1f02a9524d99795c3a12e3size 14215697731234{ "max_seq_length": 256, "do_lower_case": false}123456789101112131415{ "bos_token": "<s>", "cls_token": "<s>", "eos_token": "</s>", "mask_token": { "content": "<mask>", "lstrip": true, "normalized": false, "rstrip": false, "single_word": false }, "pad_token": "<pad>", "sep_token": "</s>", "unk_token": "<unk>"}123456789101112131415{ "add_prefix_space": false, "bos_token": "<s>", "clean_up_tokenization_spaces": true, "cls_token": "<s>", "eos_token": "</s>", "errors": "replace", "mask_token": "<mask>", "model_max_length": 512, "pad_token": "<pad>", "sep_token": "</s>", "tokenizer_class": "RobertaTokenizer", "trim_offsets": true, "unk_token": "<unk>"}1_Pooling/config.jsonAdded+7
README.mdAdded+49
config.jsonAdded+28
config_sentence_transformers.jsonAdded+7
merges.txtAdded
model_head.pklAdded+3
modules.jsonAdded+20
pytorch_model.binAdded+3
sentence_bert_config.jsonAdded+4
special_tokens_map.jsonAdded+15
tokenizer.jsonAdded
tokenizer_config.jsonAdded+15
vocab.jsonAdded