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
[Bug]: NodeParser
Previous and Next Node Relationships Cross Document Boundaries
#13095
Comments
Hey there, @alineberry! 👋 I'm Dosu, a bot here to lend a hand with bugs, answer your questions, or help you dive into contributing while we wait for a human maintainer to swing by. Excited to assist you today! I'll take a closer look at the issue you've reported and get back to you shortly with some insights. Stay tuned! |
Yea good catch. Feel free to propose a PR :) |
Will do! |
Great! If you need any guidance or have questions as you work on your PR, feel free to reach out. Happy coding!
|
PR #13109 opened |
Bug Description
NodeParser.get_nodes_from_documents
assigns previous and next relationships to nodes without considering whether a given node is at the beginning and/or end of the source document; in which case, a node can have a previous and/or next relationship to a node from another source document.The way it's written assumes that the documents being passed into
NodeParser.get_nodes_from_documents
are related and are in some meaningful order, which does not seem to be the intuitive use case.Code source
Proposed Solution:
Check that previous and next nodes share the same source node before creating the relationship. I would like to implement the change myself if that's ok.
Version
0.10.31
Steps to Reproduce
This basic example demonstrates the issue.
Output:
Note that the node and the nodes' next node do not share the same source node.
Relevant Logs/Tracbacks
No response
The text was updated successfully, but these errors were encountered: