langchain.embeddings.nlpcloud.NLPCloudEmbeddings¶
- class langchain.embeddings.nlpcloud.NLPCloudEmbeddings(model_name: str = 'paraphrase-multilingual-mpnet-base-v2', gpu: bool = False, *, client: Any = None)[source]¶
Bases:
BaseModel,EmbeddingsNLP Cloud embedding models.
To use, you should have the nlpcloud python package installed
Example
from langchain.embeddings import NLPCloudEmbeddings embeddings = NLPCloudEmbeddings()
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- param gpu: bool [Required]¶
- param model_name: str [Required]¶
- embed_documents(texts: List[str]) List[List[float]][source]¶
Embed a list of documents using NLP Cloud.
- Parameters
texts – The list of texts to embed.
- Returns
List of embeddings, one for each text.