graphragzen.text_embedding.embed.embed_graph_features

graphragzen.text_embedding.embed.embed_graph_features(graph, embedding_model, features_to_embed, entities_to_embed=['edge', 'node'], vector_db=None)[source]

Text embed features of entities from a graph.

Parameters:
  • graph (nx.Graph)

  • embedding_model (BaseEmbedder)

  • features_to_embed (List[str]) – Features of the entities the embed.

  • entities_to_embed (List[str], optional) – Which type of entities (node or edge) to look for

  • ['edge' (the features to embed. Defaults to)

  • 'node'].

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

Returns:

with keys ‘entity_name’, ‘entity_type’, ‘feature’, ‘uuid’, ‘vector’

Return type:

pd.DataFrame