Sentence Similarity
sentence-transformers
Safetensors
English
bert
sparse-encoder
sparse
splade
Generated from Trainer
loss:SpladeLoss
loss:SparseMultipleNegativesRankingLoss
loss:FlopsLoss
Eval Results (legacy)
text-embeddings-inference
Instructions to use NeuML/pubmedbert-base-splade with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use NeuML/pubmedbert-base-splade with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("NeuML/pubmedbert-base-splade") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
config_sentence_transformers.json : sentence_similarity_fn_name
#2
by nadshe - opened
Is there are reason the default similarity name is "cosine" and not "dot"? Was this model not trained with the dot function for scoring?
{
"model_type": "SparseEncoder",
"__version__": {
"sentence_transformers": "5.0.0",
"transformers": "4.52.4",
"pytorch": "2.6.0+cu124"
},
"prompts": {
"query": "",
"document": ""
},
"default_prompt_name": null,
"similarity_fn_name": "cosine"
}
Hello. It's designed to work with cosine similarity (or dot similarity with normalized vectors).