documents_to_networkx#

langchain_community.graph_vectorstores.networkx.documents_to_networkx(
documents: Iterable[Document],
*,
tag_nodes: bool = True,
) nx.DiGraph[source]#

Return the networkx directed graph corresponding to the documents.

Parameters:
  • documents (Iterable[Document]) – The documents to convenrt to networkx.

  • tag_nodes (bool) – If True, each tag will be rendered as a node, with edges to/from the corresponding documents. If False, edges will be between documents, with a label corresponding to the tag(s) connecting them.

Return type:

nx.DiGraph