Live data from Hacker News

Show HN: Chonky – a neural approach for text semantic chunking

github.com

1–10 of 38 posts

Show HN: Chonky – a neural approach for text semantic chunking

#1
TLDR: I’ve made a transformer model and a wrapper library that segments text into meaningful semantic chunks.

The current text splitting approaches rely on heuristics (although one can use neural embedder to group semantically related sentences).

I propose a fully neural approach to semantic chunking.

I took the base distilbert model and trained it on a bookcorpus to split concatenated text paragraphs into original paragraphs. Basically it’s a token classification task. Model fine-tuning took day and a half on a 2x1080ti.

The library could be used as a text splitter module in a RAG system or for splitting transcripts for example.

The usage pattern that I see is the following: strip all the markup tags to produce pure text and feed this text into the model.

The problem is that although in theory this should improve overall RAG pipeline performance I didn’t manage to measure it properly. Other limitations: the model only supports English for now and the output text is downcased.

Please give it a try. I'll appreciate a feedback.

The Python library: https://github.com/mirth/chonky

The transformer model: https://huggingface.co/mirth/chonky_distilbert_base_uncased_...

Show HN: Chonky – a neural approach for text semantic chunking
github.com

Re: Show HN: Chonky – a neural approach for text semantic chunking

#7

I feel you could improve your README.md considerably just by showing the actual output of the little snippet you show.

Came here to write exactly that. The author includes a large sentence in the sample, so it should show us the output.

Re: Show HN: Chonky – a neural approach for text semantic chunking

#9
post #2

Did you evaluate it on a RAG benchmark?

No I didn't it yet. I would be grateful if you could advise me such a benchmark.

Not sure, havent done so myself but I think you can use MTEB maybe. Or otherwise a llm benchmark on large inputs (and compare your chunking with naive chunking)

Re: Show HN: Chonky – a neural approach for text semantic chunking

#10
You might want to take a look at https://github.com/segment-any-text/wtpsplit

It uses a similar approach but the focus is on sentence/paragraph segmentation generally and not specifically focused on RAG. It also has some benchmarks. Might be a good source of inspiration for where to take chonky next.

Post reply on HN