Run this model with HF Jobs
Run Shankhdhar/ecommerce_query_classifier 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/Shankhdhar/ecommerce_query_classifier. 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/Shankhdhar/ecommerce_query_classifier 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 Shankhdhar/ecommerce_query_classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Shankhdhar/ecommerce_query_classifier with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Shankhdhar/ecommerce_query_classifier") 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 Shankhdhar/ecommerce_query_classifier with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("Shankhdhar/ecommerce_query_classifier") preds = model.predict(["i loved the spiderman movie!", "pineapple on pizza is the worst"]) print(preds) - Notebooks
- Google Colab
- Kaggle
Commit ·
a746d5a
1
Parent(s): 551782c
Add SetFit model
Browse filesFiles changed (12)
- 1_Pooling/config.jsonAdded+7
- README.mdAdded+49
- config.jsonAdded+26
- config_sentence_transformers.jsonAdded+7
- model.safetensorsAdded+3
- model_head.pklAdded+3
- modules.jsonAdded+20
- sentence_bert_config.jsonAdded+4
- special_tokens_map.jsonAdded+7
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+62
- vocab.txtAdded
1234567{ "word_embedding_dimension": 768, "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---
# /var/folders/kb/366lqkyd3lgbq2mm2m_r0cx00000gn/T/tmprmo96kxm/Shankhdhar/ecommerce_query_classifier
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("/var/folders/kb/366lqkyd3lgbq2mm2m_r0cx00000gn/T/tmprmo96kxm/Shankhdhar/ecommerce_query_classifier")# 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}}```1234567891011121314151617181920212223242526{ "_name_or_path": "/Users/anantshankhdhar/.cache/torch/sentence_transformers/thenlper_gte-base/", "architectures": [ "BertModel" ], "attention_probs_dropout_prob": 0.1, "classifier_dropout": null, "gradient_checkpointing": false, "hidden_act": "gelu", "hidden_dropout_prob": 0.1, "hidden_size": 768, "initializer_range": 0.02, "intermediate_size": 3072, "layer_norm_eps": 1e-12, "max_position_embeddings": 512, "model_type": "bert", "num_attention_heads": 12, "num_hidden_layers": 12, "pad_token_id": 0, "position_embedding_type": "absolute", "torch_dtype": "float32", "transformers_version": "4.35.2", "type_vocab_size": 2, "use_cache": true, "vocab_size": 30522}1234567{ "__version__": { "sentence_transformers": "2.2.2", "transformers": "4.35.2", "pytorch": "2.1.1" }}123version https://git-lfs.github.com/spec/v1oid sha256:fd63c3ec1ebd1d9ce98bea924a592d98feb9e4f4fc60e9cd0ab2644fb2309e3csize 437951328123version https://git-lfs.github.com/spec/v1oid sha256:8819567dff5e39129e4a9b4bc61fe0da7347f1c54ce7493d19b4d6991ef2aec6size 316471234567891011121314151617181920[ { "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" }]1234{ "max_seq_length": 512, "do_lower_case": false}1234567{ "cls_token": "[CLS]", "mask_token": "[MASK]", "pad_token": "[PAD]", "sep_token": "[SEP]", "unk_token": "[UNK]"}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162{ "added_tokens_decoder": { "0": { "content": "[PAD]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "100": { "content": "[UNK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "101": { "content": "[CLS]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "102": { "content": "[SEP]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "103": { "content": "[MASK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "clean_up_tokenization_spaces": true, "cls_token": "[CLS]", "do_lower_case": true, "mask_token": "[MASK]", "max_length": 128, "model_max_length": 512, "pad_to_multiple_of": null, "pad_token": "[PAD]", "pad_token_type_id": 0, "padding_side": "right", "sep_token": "[SEP]", "stride": 0, "strip_accents": null, "tokenize_chinese_chars": true, "tokenizer_class": "BertTokenizer", "truncation_side": "right", "truncation_strategy": "longest_first", "unk_token": "[UNK]"}1_Pooling/config.jsonAdded+7
README.mdAdded+49
config.jsonAdded+26
config_sentence_transformers.jsonAdded+7
model.safetensorsAdded+3
model_head.pklAdded+3
modules.jsonAdded+20
sentence_bert_config.jsonAdded+4
special_tokens_map.jsonAdded+7
tokenizer.jsonAdded
tokenizer_config.jsonAdded+62
vocab.txtAdded