Skip to content

Instantly share code, notes, and snippets.

@Spartee
Created August 11, 2022 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Spartee/831e37e56a56040767a5148a9352a7e7 to your computer and use it in GitHub Desktop.
Save Spartee/831e37e56a56040767a5148a9352a7e7 to your computer and use it in GitHub Desktop.
Creating the query vector using sentence transformers
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
# create the vector embedding for the query
query_embedding = model.encode("That is a happy person")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment