mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-09 11:25:21 +03:00
Updated `integrations/embeddings`: fixed titles; added links, descriptions Updated `integrations/providers`.
3.4 KiB
3.4 KiB
In [ ]:
#!pip install spacyIn [ ]:
from langchain.embeddings.spacy_embeddings import SpacyEmbeddingsIn [ ]:
embedder = SpacyEmbeddings()In [ ]:
texts = [
"The quick brown fox jumps over the lazy dog.",
"Pack my box with five dozen liquor jugs.",
"How vexingly quick daft zebras jump!",
"Bright vixens jump; dozy fowl quack.",
]In [ ]:
embeddings = embedder.embed_documents(texts)
for i, embedding in enumerate(embeddings):
print(f"Embedding for document {i+1}: {embedding}")In [ ]:
query = "Quick foxes and lazy dogs."
query_embedding = embedder.embed_query(query)
print(f"Embedding for query: {query_embedding}")