HierarchicalChunkingConfiguration¶
Structure Class¶
HierarchicalChunkingConfiguration
dataclass
¶
Settings for hierarchical document chunking for a data source. Hierarchical chunking splits documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.
You configure the number of tokens to overlap, or repeat across adjacent chunks. For example, if you set overlap tokens to 60, the last 60 tokens in the first chunk are also included at the beginning of the second chunk. For each layer, you must also configure the maximum number of tokens in a chunk.
Attributes¶
level_configurations
instance-attribute
¶
level_configurations: list[HierarchicalChunkingLevelConfiguration]
Token settings for each layer.
overlap_tokens
instance-attribute
¶
overlap_tokens: int
The number of tokens to repeat across chunks in the same layer.