DeepsetNvidiaDocumentEmbedder
Embed documents using embedding models by NVIDIA Triton.
Basic Information
- Type: 
deepset_cloud_custom_nodes.embedders.nvidia.document_embedder.DeepsetNvidiaDocumentEmbedder - Components it most often connects with:
- PreProcessors: 
DeepsetNvidiaDocumentEmbeddercan receive documents to embed from a PreProcessor, likeDocumentSplitter. - DocumentWriter: 
DeepsetNvidiaDocumentEmbeddercan send embedded documents toDocumentWriterthat writes them into the document store. 
 - PreProcessors: 
 
Inputs
| Name | Type | Description | 
|---|---|---|
documents | List of Document objects | The documents to embed. | 
Outputs
| Name | Type | Description | 
|---|---|---|
documents | List of Document objects | Documents with their embeddings added to the metadata. | 
meta | Dictionary | Metadata regarding the usage statistics. | 
Overview
NvidiaDocumentEmbedder uses NVIDTIA Triton models to embed a list of documents. It then adds the computed embeddings to the document's embedding metadata field.
This component runs on optimized hardware in deepset AI Platform, which means it doesn't work if you export it to a local Python file. If you're planning to export, use SentenceTransformersDocumentEmbedder instead.
Embedding Models in Query Pipelines and IndexesThe embedding model you use to embed documents in your index must be the same as the embedding model you use to embed the query in your pipeline.
This means the embedders for your indexes and pipelines must match. For example, if you use
CohereDocumentEmbedderto embed your documents, you should useCohereTextEmbedderwith the same model to embed your queries.
Usage Example
This is an example of a DeepsetNvidiaDocumentEmbedder used in an index. It receives a list of documents from DocumentSplitter and then sends the embedded documents to DocumentWriter:
Here's the YAML configuration:
components:
  DocumentSplitter:
    type: haystack.components.preprocessors.document_splitter.DocumentSplitter
    init_parameters:
      split_by: word
      split_length: 200
      split_overlap: 0
      split_threshold: 0
      splitting_function: null
  DeepsetNvidiaDocumentEmbedder:
    type: deepset_cloud_custom_nodes.embedders.nvidia.document_embedder.DeepsetNvidiaDocumentEmbedder
    init_parameters:
      model: intfloat/multilingual-e5-base
      prefix: ''
      suffix: ''
      batch_size: 32
      meta_fields_to_embed: null
      embedding_separator: \n
      truncate: null
      normalize_embeddings: true
      timeout: null
      backend_kwargs: null
  DocumentWriter:
    type: haystack.components.writers.document_writer.DocumentWriter
    init_parameters:
      document_store:
        type: haystack_integrations.document_stores.opensearch.document_store.OpenSearchDocumentStore
        init_parameters:
          embedding_dim: 1024
          similarity: cosine
      policy: NONE
connections:
  - sender: DocumentSplitter.documents
    receiver: DeepsetNvidiaDocumentEmbedder.documents
  - sender: DeepsetNvidiaDocumentEmbedder.documents
    receiver: DocumentWriter.documents
max_runs_per_component: 100
metadata: {}
Init Parameters
Parameter  | Type  | Possible values  | Description  | 
|---|---|---|---|
  | DeepsetNVIDIAEmbeddingModels  | Default:   | The model to use for calculating embeddings. Can be a specific model path like   | 
  | String  | Default:   | A string to add at the beginning of each document text, useful for instructions required by some embedding models.  | 
  | String  | Default:   | A string to add at the end of each document text.  | 
  | Integer  | Default:   | The number of documents to embed at once.  | 
  | List of strings  | Default:   | A list of metadata fields to embed along with the document text.  | 
  | String  | Default:   | The separator used to concatenate the metadata fields to the document text.  | 
  | EmbeddingTruncateMode  | 
  | Specifies how to truncate inputs longer than the maximum token length. Possible options are:   | 
  | Boolean  | 
  | Whether to normalize the embeddings by dividing the embedding by its L2 norm.  | 
  | Float  | Default:   | Timeout for request calls in seconds.  | 
  | Dictionary  | Default:   | Keyword arguments to further customize the model behavior.  | 
Run Method Parameters
These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.
Parameter  | Type  | Description  | 
|---|---|---|
  | List of   | The documents to embed.  | 
Updated about 2 months ago