Views
No views yet
1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("ayoubkirouane/Mpnet-base-ALL-NLI")
5# Run inference
6sentences = [
7 'a baby smiling',
8 'The boy is smiling',
9 'The girl is standing.',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 768]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities.shape)
18# [3, 3]