Aleph Alpha | ü¶úÔ∏èüîó Langchain






Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsAleph AlphaAwaDBAzureOpenAIBaidu QianfanBedrockBGE on Hugging FaceClarifaiCohereDashScopeDeepInfraEDEN AIElasticsearchEmbaasERNIE Embedding-V1Fake EmbeddingsGoogle Vertex AI PaLMGPT4AllGradientHugging FaceInstructEmbeddingsJinaLlama-cppLLMRailsLocalAIMiniMaxModelScopeMosaicMLNLP CloudOllamaOpenAISageMakerSelf HostedSentence TransformersSpaCyTensorflowHubXorbits inference (Xinference)Vector storesRetrieversToolsAgents and toolkitsMemoryCallbacksChat loadersComponentsText embedding modelsAleph AlphaOn this pageAleph AlphaThere are two possible ways to use Aleph Alpha's semantic embeddings. If you have texts with a dissimilar structure (e.g. a Document and a Query) you would want to use asymmetric embeddings. Conversely, for texts with comparable structures, symmetric embeddings are the suggested approach.Asymmetric‚Äãfrom langchain.embeddings import AlephAlphaAsymmetricSemanticEmbeddingdocument = "This is a content of the document"query = "What is the content of the document?"embeddings = AlephAlphaAsymmetricSemanticEmbedding(normalize=True, compress_to_size=128)doc_result = embeddings.embed_documents([document])query_result = embeddings.embed_query(query)Symmetric‚Äãfrom langchain.embeddings import AlephAlphaSymmetricSemanticEmbeddingtext = "This is a test text"embeddings = AlephAlphaSymmetricSemanticEmbedding(normalize=True, compress_to_size=128)doc_result = embeddings.embed_documents([text])query_result = embeddings.embed_query(text)PreviousText embedding modelsNextAwaDBAsymmetricSymmetricCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
There are two possible ways to use Aleph Alpha's semantic embeddings. If you have texts with a dissimilar structure (e.g. a Document and a Query) you would want to use asymmetric embeddings. Conversely, for texts with comparable structures, symmetric embeddings are the suggested approach.
There are two possible ways to use Aleph Alpha's semantic embeddings. If you have texts with a dissimilar structure (e.g. a Document and a Query) you would want to use asymmetric embeddings. Conversely, for texts with comparable structures, symmetric embeddings are the suggested approach. ->: Aleph Alpha | ü¶úÔ∏èüîó Langchain






Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsAleph AlphaAwaDBAzureOpenAIBaidu QianfanBedrockBGE on Hugging FaceClarifaiCohereDashScopeDeepInfraEDEN AIElasticsearchEmbaasERNIE Embedding-V1Fake EmbeddingsGoogle Vertex AI PaLMGPT4AllGradientHugging FaceInstructEmbeddingsJinaLlama-cppLLMRailsLocalAIMiniMaxModelScopeMosaicMLNLP CloudOllamaOpenAISageMakerSelf HostedSentence TransformersSpaCyTensorflowHubXorbits inference (Xinference)Vector storesRetrieversToolsAgents and toolkitsMemoryCallbacksChat loadersComponentsText embedding modelsAleph AlphaOn this pageAleph AlphaThere are two possible ways to use Aleph Alpha's semantic embeddings. If you have texts with a dissimilar structure (e.g. a Document and a Query) you would want to use asymmetric embeddings. Conversely, for texts with comparable structures, symmetric embeddings are the suggested approach.Asymmetric‚Äãfrom langchain.embeddings import AlephAlphaAsymmetricSemanticEmbeddingdocument = "This is a content of the document"query = "What is the content of the document?"embeddings = AlephAlphaAsymmetricSemanticEmbedding(normalize=True, compress_to_size=128)doc_result = embeddings.embed_documents([document])query_result = embeddings.embed_query(query)Symmetric‚Äãfrom langchain.embeddings import AlephAlphaSymmetricSemanticEmbeddingtext = "This is a test text"embeddings = AlephAlphaSymmetricSemanticEmbedding(normalize=True, compress_to_size=128)doc_result = embeddings.embed_documents([text])query_result = embeddings.embed_query(text)PreviousText embedding modelsNextAwaDBAsymmetricSymmetricCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.