Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of ref_doc_id of Node parsed #126

Open
Joshua-Yu opened this issue Apr 2, 2024 · 0 comments
Open

Usage of ref_doc_id of Node parsed #126

Joshua-Yu opened this issue Apr 2, 2024 · 0 comments

Comments

@Joshua-Yu
Copy link

Hi there,

I was trying to figure out which node belongs to which document so I used ref_doc_id of node, but it didn't seem to refer to the document. Below is my code:

from llama_index.core.node_parser import MarkdownElementNodeParser

node_parser = MarkdownElementNodeParser(llm=llm, num_workers=8)
nodes = node_parser.get_nodes_from_documents(documents)

base_nodes, objects = node_parser.get_nodes_and_objects(nodes)

for node in base_nodes:
    print(f"ref_doc:{node.ref_doc_id}")
    ... ... 

Any suggestion?

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant