-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve text splitter for non-English documents (#1326)
* Add tests to verify that tokens in each section can never be above 500 tokens * Improve the test so we parametrize it for each PDF instead of failing on the first one. * Add arabic book * Formatting fixes * Verbose assertion messages with the file name * Implement a recursive splitter when sections are too large. * 5 percent overlap with recursive splitter * Resolve some of the PR feedback * Make the tests set to the max tokens per section of the text splitter instead of hardcoded values * Find a better split position in the central third of the text * Correct the boundary check and fix the position to come after the full stops * Remove some silly line breaks * Update import * reformatting * Make the overlap percent and section size defaults module level constants * Reformatted PDFs using the online PDF parser for better accessibility * Add an RTL test * Add a korean test file about a mouse that goes to the big city. Add a test for table overlapping. * Add a snapshot of the content sections from the test data PDFs * Fix my formatting * Sort the keys first --------- Co-authored-by: Pamela Fox <[email protected]>
- Loading branch information
1 parent
afbe70c
commit b04fc66
Showing
10 changed files
with
834 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ coverage | |
playwright | ||
pytest-cov | ||
pytest-playwright | ||
pytest-snapshot | ||
pre-commit | ||
locust | ||
pip-tools | ||
|
This file contains 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
Oops, something went wrong.