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

Refactor Document Chunker to always use docling #430

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

khaledsulayman
Copy link
Member

@khaledsulayman khaledsulayman commented Dec 5, 2024

The old DocumentChunker was a factory class that called the text-splitter on markdowns and docling on PDFs. In reality, we want to call docling and then use the text-splitter on all document types. This change refactors the DocumentChunker class to always call docling (as long as the provided documents are supported filetypes).

Resolves: #334

@mergify mergify bot added testing Relates to testing ci-failure labels Dec 5, 2024
@aakankshaduggal aakankshaduggal requested a review from a team December 6, 2024 17:41



# class DocumentChunker:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep this commented out or would it make more sense to delete it? It'll always be in git history if we need to find it again

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, forgot to remove these

Might set this PR to draft until I'm able to get tests to pass and then do one final linting cleanup

self.server_ctx_size = server_ctx_size
self.chunk_word_count = chunk_word_count
self.output_dir = output_dir
if len(document_paths) == 0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an FYI, in Python you can do if not document_path and it will perform both if document_path is None or len(document_paths) == 0

@khaledsulayman khaledsulayman marked this pull request as draft December 6, 2024 20:25
@mergify mergify bot added ci-failure and removed ci-failure labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-failure testing Relates to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chunking Refactor: Always use Context-Aware Chunker
2 participants