节点解析器

Node parsers.

class llama_index.node_parser.NodeParser

Base interface for node parser.

abstract get_nodes_from_documents(documents: Sequence[Document]) List[Node]

Parse documents into nodes.

参数

documents (Sequence[Document]) -- documents to parse

class llama_index.node_parser.SimpleNodeParser(text_splitter: Optional[TextSplitter] = None, include_extra_info: bool = True, include_prev_next_rel: bool = True, callback_manager: Optional[CallbackManager] = None)

Simple node parser.

Splits a document into Nodes using a TextSplitter.

参数
  • text_splitter (Optional[TextSplitter]) -- text splitter

  • include_extra_info (bool) -- whether to include extra info in nodes

  • include_prev_next_rel (bool) -- whether to include prev/next relationships

get_nodes_from_documents(documents: Sequence[Document]) List[Node]

Parse document into nodes.

参数
  • documents (Sequence[Document]) -- documents to parse

  • include_extra_info (bool) -- whether to include extra info in nodes