RecursiveChunkerConfig#
- class scikitplot.corpus.RecursiveChunkerConfig(chunk_size=1000, chunk_overlap=0, separators=('\n\n', '\n', '. ', ' ', ''), strip_whitespace=True, min_length=1)[source]#
Configuration for
RecursiveChunker.- Parameters:
- chunk_sizeint, default=1000
Largest chunk anchor, in characters, not counting the whitespace around it.
- chunk_overlapint, default=0
Characters of the preceding text added as context (from a word start, never before the previous chunk’s start);
0adds none. Must be smaller thanchunk_size.- separatorstuple of str, default=(”nn”, “n”, “. “, “ “, “”)
Separators, coarsest first; must end with
""(characters). A list is accepted and stored as a tuple. The defaults assume"\n"line ends (readers normalise"\r\n"); add"\r\n\r\n"for text that keeps them. A hard-wrapped text is cut at line ends before sentence ends.- strip_whitespacebool, default=True
Narrow each chunk to exclude surrounding whitespace.
- min_lengthint, default=1
Drop a chunk with fewer characters than this, not counting the whitespace around it (so a whitespace-only chunk is always dropped).
- Parameters: