Skip to main content

Module semantic

Module semantic 

Source
Expand description

Semantic chunking strategy.

Chunks content based on semantic structure (headings, paragraphs, sections). Best for markdown, documentation, and prose text.

Structsยง

Section ๐Ÿ”’
A parsed section of the document.
SemanticChunker
Semantic chunker that splits at document structure boundaries.

Functionsยง

chunk_from_elements ๐Ÿ”’
Chunk from structured elements.
chunk_sections ๐Ÿ”’
Chunk sections into appropriately-sized chunks.
create_chunk ๐Ÿ”’
Create a chunk output.
is_underline_heading ๐Ÿ”’
Check if a line is an underline-style heading indicator.
parse_markdown_heading ๐Ÿ”’
Parse a markdown-style heading (# Heading).
parse_sections ๐Ÿ”’
Parse document into sections based on headings.
split_large_section ๐Ÿ”’
Split a large section into smaller chunks.