v1.0.3
✨ Highlights
- The new Chonkie
Visualizeris here! You can now view your chunks, understand chunk quality and debug your chunker with visual feedback~ Use theprintmethod to print rich text on your terminal or use thesavemethod to save a highlightedhtmlon your device! It's very simple to use, just pass in your chunks~
from chonkie import Visualizer
viz = Visualizer()
# Print the chunks on the terminal with .print or directly call the Visualizer object too
viz.print(chunks)
# Save the HTML file
viz.save("chonkie.html", chunks)
- Chonkie now adds support for
Recipeswhich allow you to use multilingual chunking out of the box, as well as document specific chunking methods. Initial support starts with:en,hi,zh,jpandko, while document typemarkdownis supported too. Use it via thefrom_recipeclass method with any chunker that takes delimiters orRecursiveRules.
from chonkie import RecursiveChunker
# Initialize the recursive chunker to chunk Markdown
chunker = RecursiveChunker.from_recipe("markdown", lang="en")
# Initialize the recursive chunker to chunk Hindi texts
chunker = RecursiveChunker.from_recipe(lang="hi")- Additional fixes for performance enhancements in
RecursiveChunker,SentenceChunker, andWordTokenizer
What's Changed
- Fix: Refactor
SentenceChunkerto remove estimate + feedback by @chonknick in #23 - Fix:
RecursiveRules.from_dict()showingKey error: 'levels' does not existbecause of.pop()by @chonknick in #24 - Fix: Remove
.findfor indexing in theRecursiveChunkerfor better efficiency by @Pratik960 in #26 - Feat: Add Initial support for
Recipesand multilingual CHONKs! by @chonknick in #27 - Fix:
RecursiveChunkerwhitespace splitting is not reconstructable (missing spaces) + (#26, #27) by @chonknick in #28 - Update version to 1.0.3a1 in pyproject.toml and init.py for Chonkie by @chonknick in #29
- Fix:
WordTokenizer.count_tokensshould use.tokenizeinstead of.encodeby @chonknick in #36 - Add Chonkie Vizard — easy chunk visualization with
Visualizerby @chonknick in #39 - Feat: Add Chonkie Vizard to main!
Visualizerclass for easy chunk visualizations by @chonknick in #40 - Fix: Add
chonkie.utilsmodule to package list inpyproject.tomlby @chonknick in #41 - Fix:
chonkie.clouddoes not containchunkerserror + bump up version tov1.0.3by @chonknick in #43
New Contributors
- @Pratik960 made their first contribution in #26
Full Changelog: v1.0.2...v1.0.3