Skip to content

Instantly share code, notes, and snippets.

@Spartee
Created August 11, 2022 19:06
Show Gist options
  • Save Spartee/46ee2247f5b965d60b5ddafb6418a194 to your computer and use it in GitHub Desktop.
Save Spartee/46ee2247f5b965d60b5ddafb6418a194 to your computer and use it in GitHub Desktop.
Example of using sentence_transformers
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
sentences = [
"That is a very happy Person",
"That is a Happy Dog",
"Today is a sunny day"
]
embeddings = model.encode(sentences)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment