Repository navigation
Conversation
Contributor
|
@jianyx1 is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
Standalone performance fix found through a local benchmark of the splitter.
Proposed Changes
When chunking a long technical manual for retrieval,
MarkdownHeaderSplitterchecks each candidate heading against every code fence and recounts page breaks from the beginning of the source for every chunk. Walk the fences in source order and index page-break ends once. Chunk contents, header metadata, and page-number rules are preserved.How did you test it?
hatch run test:unit --no-cov -q test/components/preprocessors/test_markdown_header_splitter.pyyielded 111 passes. The project's unit selection deselected one integration case.Ruff and the applicable pre-commit checks passed.
Timed
MarkdownHeaderSplitter().run([Document(content=text)])on macOS with Python 3.13.15. The synthetic input repeats a heading, prose, a fenced shell example with a comment, and a form-feed page break. Each number is the median of three runs. The benchmark also checks chunk count, byte-exact reconstruction, and the last page number.Notes for the reviewer
Page-break end offsets preserve the behavior of a custom multi-character delimiter that straddles a chunk boundary. The added test covers that case.
Checklist
This PR was generated and locally validated with Codex at the account owner's request.