Files
langchain/docs/extras/integrations/text_embedding/nlp_cloud.ipynb
T
Leonid Ganeline fdba711d28 docs integrations/embeddings consistency (#10302)
Updated `integrations/embeddings`: fixed titles; added links,
descriptions
Updated `integrations/providers`.
2023-09-07 19:53:33 -07:00

2.4 KiB

NLP Cloud

NLP Cloud is an artificial intelligence platform that allows you to use the most advanced AI engines, and even train your own engines with your own data.

The embeddings endpoint offers the following model:

  • paraphrase-multilingual-mpnet-base-v2: Paraphrase Multilingual MPNet Base V2 is a very fast model based on Sentence Transformers that is perfectly suited for embeddings extraction in more than 50 languages (see the full list here).
In [ ]:
! pip install nlpcloud
In [1]:
from langchain.embeddings import NLPCloudEmbeddings
In [2]:
import os

os.environ["NLPCLOUD_API_KEY"] = "xxx"
nlpcloud_embd = NLPCloudEmbeddings()
In [3]:
text = "This is a test document."
In [4]:
query_result = nlpcloud_embd.embed_query(text)
In [5]:
doc_result = nlpcloud_embd.embed_documents([text])