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

Semantic Chunking Processor #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

urvishp80
Copy link
Contributor

You can set SEMANTIC_CHUNKING_PARAMS env variable with a path to a json file with some params.
Example params (default) (semantic_chunker_params.json):

{
            # Semantic chunking params (for SemanticChunker, from documentation)
            "breakpoint_threshold_type": "standard_deviation",
            "buffer_size": 4,
            "breakpoint_threshold_amount": 3,
            "sentence_split_regex": r'(?<=[\.\!\?\n])(\n?)\s+',
            # Openai models
            "oai_embedding_model": "text-embedding-3-small",  # Model for embedding
            "oai_gen_model": "gpt-4o-mini",  # Model used for generating titles
            # Other params
            "chunk_threshold": 6000,  # Chunk only if number of tokens larger than this
            "use_markdown_headers": True,  # Use markdown headers for splitting
            "max_chunk_size": 6000,  # Max number of tokens in a chunk
            "generate_titles": False,  # Use LLM to generate titles for a chunk
}

@urvishp80 urvishp80 requested a review from kouloumos December 24, 2024 13:41
@kouloumos kouloumos force-pushed the master branch 16 times, most recently from a4bd36f to 2112dad Compare January 9, 2025 11:00
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

Successfully merging this pull request may close these issues.

1 participant