graphragzen.text_embedding.embedding_models.NomicTextEmbedder

class graphragzen.text_embedding.embedding_models.NomicTextEmbedder[source]

Attributes

vector_size

Methods

embed(text[, task, show_progress_bar])

Text embed strings for a specific task.

__init__(huggingface_URI='nomic-ai/nomic-embed-text-v1.5')[source]

Initialize the nomic text embedder.

note: Either or both model_storage_path or huggingface_URI must be set. When both are set model_storage_path takes precedence.

Parameters:
  • model_storage_path (str, optional) – Path to the model on the local filesystem

  • huggingface_URI (str, optional) – Huggingface URI of the model. Defaults to HF URI “nomic-ai/nomic-embed-text-v1.5”.

embed(text, task='embed_document', show_progress_bar=False)[source]

Text embed strings for a specific task.

Parameters:
  • text (Union[str, List[str]]) – String(s) to embed

  • task (str, optional) – Should be any of the following, the nomic embedder will create vector appropriate to the task: [“embed_document”, “embed_query”, “clustering”, “classification”]. Defaults to “embed_document”.

  • show_progress_bar (bool, optional) – If True shows a progress bar. Defaults to False.

Returns:

np.array

Return type:

ndarray

vector_size: float = 768