NLP云
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.
LangChain 的嵌入(embeddings)端点提供了以下模型:
paraphrase-multilingual-mpnet-base-v2: Paraphrase Multilingual MPNet Base V2 是一个基于 Sentence Transformers 的非常快速的模型,非常适合在 50 多种语言中提取嵌入(请参阅此处的完整列表)。
%pip install --upgrade --quiet nlpcloud
from langchain_community.embeddings import NLPCloudEmbeddings
API 参考:NLPCloudEmbeddings
import os
os.environ["NLPCLOUD_API_KEY"] = "xxx"
nlpcloud_embd = NLPCloudEmbeddings()
text = "This is a test document."
query_result = nlpcloud_embd.embed_query(text)
doc_result = nlpcloud_embd.embed_documents([text])