mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-09 11:25:21 +03:00
3.4 KiB
3.4 KiB
In [1]:
from langchain.embeddings import AlephAlphaAsymmetricSemanticEmbeddingIn [2]:
document = "This is a content of the document"
query = "What is the content of the document?"In [3]:
embeddings = AlephAlphaAsymmetricSemanticEmbedding(normalize=True, compress_to_size=128)In [4]:
doc_result = embeddings.embed_documents([document])In [5]:
query_result = embeddings.embed_query(query)In [6]:
from langchain.embeddings import AlephAlphaSymmetricSemanticEmbeddingIn [7]:
text = "This is a test text"In [8]:
embeddings = AlephAlphaSymmetricSemanticEmbedding(normalize=True, compress_to_size=128)In [9]:
doc_result = embeddings.embed_documents([text])In [10]:
query_result = embeddings.embed_query(text)In [ ]: