----------------------
To get all the nodes from a document in LlamaIndex, you can use the
NodeParser
class. Here's an example using the
SimpleNodeParser
:
from llama_index.node_parser import SimpleNodeParser
parser = SimpleNodeParser()
nodes = parser.get_nodes_from_documents(documents)
In this example,
documents
is a list of
Document
objects. The
get_nodes_from_documents
method will parse these documents into
Node
objects, which represent "chunks" of the source documents.
Source:
LlamaIndex Usage Pattern - Parse the Documents into Nodes (
https://gpt-index.readthedocs.io/en/latest/guides/primer/usage_pattern.html#2-parse-the-documents-into-nodes)
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------