graphragzen.text_embedding.embed.embed_dataframe

graphragzen.text_embedding.embed.embed_dataframe(dataframe, embedding_model, vector_db=None, columns_to_embed=[])[source]

Embed specific columns of a database, and add each embedding to the vector DB

Parameters:
  • dataframe (pd.DataFrame)

  • embedding_model (BaseEmbedder)

  • vector_db_client (VectorDatabase, optional) – If provided, will add the embedding to the vector database.

  • columns_to_embed (List[str], optional) – Which columns to embed. If not provided embeds all columns of that contain strings or Null. Defaults to [].

  • vector_db (VectorDatabase | None)

Returns:

With vector columns added as f”{original_column}_vector”

Return type:

pd.DataFrame