Feature Extraction
sentence-transformers
PyTorch
English
distilbert
splade
sparse-encoder
sparse
text-embeddings-inference
Run this model with HF Jobs
Run naver/splade-v3-distilbert 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/naver/splade-v3-distilbert. 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/naver/splade-v3-distilbert 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 naver/splade-v3-distilbert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use naver/splade-v3-distilbert with sentence-transformers:
from sentence_transformers import SparseEncoder model = SparseEncoder("naver/splade-v3-distilbert") queries = ["Which planet is known as the Red Planet?"] documents = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", ] query_embeddings = model.encode_query(queries) document_embeddings = model.encode_document(documents) similarities = model.similarity(query_embeddings, document_embeddings) print(similarities) - Notebooks
- Google Colab
- Kaggle
Commit ·
9c499e1
1
Parent(s): 0f2ad0e
Add support for Sentence Transformer
Browse filesFiles changed (5)
- 1_SpladePooling/config.jsonAdded+5
- README.md+60
- config_sentence_transformers.jsonAdded+14
- modules.jsonAdded+14
- sentence_bert_config.jsonAdded+4
12345{ "pooling_strategy": "max", "activation_function": "relu", "word_embedding_dimension": null}3 unmodified lines4567899 unmodified lines1920212223243 unmodified lines- entags:- splade---## SPLADE-v3-DistilBERT9 unmodified lines| --- | --- | --- || `naver/splade-v3-distilbert` | 38.7 | 50.0 |## CitationIf you use our checkpoint, please cite our work:3 unmodified lines45678910111213149 unmodified lines242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283843 unmodified lines- entags:- splade- sentence-transformers- sparse-encoder- sparsepipeline_tag: feature-extractionlibrary_name: sentence-transformers---## SPLADE-v3-DistilBERT9 unmodified lines| --- | --- | --- || `naver/splade-v3-distilbert` | 38.7 | 50.0 |## Model DetailsThis is a [SPLADE Sparse Encoder](https://www.sbert.net/docs/sparse_encoder/usage/usage.html) model. It maps sentences & paragraphs to a 30522-dimensional sparse vector space and can be used for semantic search and sparse retrieval.### Model Description- **Model Type:** SPLADE Sparse Encoder- **Base model:** [distilbert/distilbert-base-uncased](https://huggingface.co/distilbert/distilbert-base-uncased)- **Maximum Sequence Length:** 512 tokens (256 for evaluation reproduction)- **Output Dimensionality:** 30522 dimensions- **Similarity Function:** Dot Product### Full Model Architecture```SparseEncoder((0): MLMTransformer({'max_seq_length': 512, 'do_lower_case': False}) with MLMTransformer model: BertForMaskedLM(1): SpladePooling({'pooling_strategy': 'max', 'activation_function': 'relu', 'word_embedding_dimension': 30522}))```## Usage### Direct Usage (Sentence Transformers)First install the Sentence Transformers library:```bashpip install -U sentence-transformers```Then you can load this model and run inference.```pythonfrom sentence_transformers import SparseEncoder# Download from the 🤗 Hubmodel = SparseEncoder("naver/splade-v3-distilbert")# Run inferencequeries = ["what causes aging fast"]documents = ["UV-A light, specifically, is what mainly causes tanning, skin aging, and cataracts, UV-B causes sunburn, skin aging and skin cancer, and UV-C is the strongest, and therefore most effective at killing microorganisms. Again â\x80\x93 single words and multiple bullets.","Answers from Ronald Petersen, M.D. Yes, Alzheimer's disease usually worsens slowly. But its speed of progression varies, depending on a person's genetic makeup, environmental factors, age at diagnosis and other medical conditions. Still, anyone diagnosed with Alzheimer's whose symptoms seem to be progressing quickly â\x80\x94 or who experiences a sudden decline â\x80\x94 should see his or her doctor.","Bell's palsy and Extreme tiredness and Extreme fatigue (2 causes) Bell's palsy and Extreme tiredness and Hepatitis (2 causes) Bell's palsy and Extreme tiredness and Liver pain (2 causes) Bell's palsy and Extreme tiredness and Lymph node swelling in children (2 causes)",]query_embeddings = model.encode_query(queries)document_embeddings = model.encode_document(documents)print(query_embeddings.shape, document_embeddings.shape)# [1, 30522] [3, 30522]# Get the similarity scores for the embeddingssimilarities = model.similarity(query_embeddings, document_embeddings)print(similarities)# tensor([[14.4726, 9.4432, 5.6896]])```## CitationIf you use our checkpoint, please cite our work:
1234567891011121314{ "model_type": "SparseEncoder", "__version__": { "sentence_transformers": "5.0.0", "transformers": "4.50.3", "pytorch": "2.6.0+cu124" }, "prompts": { "query": "", "document": "" }, "default_prompt_name": null, "similarity_fn_name": "dot"}1234567891011121314[ { "idx": 0, "name": "0", "path": "", "type": "sentence_transformers.sparse_encoder.models.MLMTransformer" }, { "idx": 1, "name": "1", "path": "1_SpladePooling", "type": "sentence_transformers.sparse_encoder.models.SpladePooling" }]1234{ "max_seq_length": 512, "do_lower_case": false}1_SpladePooling/config.jsonAdded+5
README.md+60
config_sentence_transformers.jsonAdded+14
modules.jsonAdded+14
sentence_bert_config.jsonAdded+4