Downloads · 30 days
69
29% of all-time downloads
sidbrahim/narrativesAnalogues-allMiniLM
narrativesAnalogues-allMiniLM is a sentence similarity model from sidbrahim. Use it when you need a score for how close two texts are. It is set up for sentence-transformers.
Downloads · 30 days
69
29% of all-time downloads
All-time downloads
241
Public
Parameters
22.7M
272 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors182 MB · 50%
From the Hugging Face model README
loss: 2.767585039138794
validation_pearson_cosine: 0.8085373520361815
validation_spearman_cosine: 0.6588712021140699
runtime: 24.5695
samples_per_second: 7.815
steps_per_second: 0.488
: 3.0
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the Hugging Face Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
'search_query: autotrain',
'search_query: auto train',
'search_query: i love autotrain',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)