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

Markdown AdapterStep for chunking by heading #26

Open
olirice opened this issue Jul 11, 2023 · 3 comments
Open

Markdown AdapterStep for chunking by heading #26

olirice opened this issue Jul 11, 2023 · 3 comments
Assignees

Comments

@olirice
Copy link
Collaborator

olirice commented Jul 11, 2023

Context

Markdown is a common format for documents ingested into vector systems and has more exploitable structure than simple text.

This task is to create an vecs.adapters.base.AdapterStep that handles chunking markdown by heading.

Ideally it would also accept parameters for

  • The maximum number of words in each chunk

e.g.

from vecs.adapters import MarkdownChunker

MarkdownChunker(
  max_tokens=512
)
@olirice olirice self-assigned this Jul 11, 2023
@jbritain
Copy link
Contributor

Will give this a go if wanted

@jbritain
Copy link
Contributor

jbritain commented Jul 24, 2023

According to the Markdown Guide

Markdown applications don’t agree on how to handle a missing space between the number signs (#) and the heading name. For compatibility, always put a space between the number signs and the heading name.

Should we count headings without this space as valid?

###like this

@olirice
Copy link
Collaborator Author

olirice commented Jul 25, 2023

My vote would be to require the space

you could reference https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/markdown_header_metadata for ideas

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

2 participants