Document Sections: Better rendering of chunks for long documents

I just implemented a customised version of the semantic chunking from this video. I wrote it in TS and it works pretty well.

Had to customise a few different things to get it to work well, including writing a custom retriever to make sure retrieval worked with semantic chunks.

I kept my semantic chunk format to be composed of the ‘sentences’ and I actually to retrieval against all my sentences, but then score all my semantic chunks based on sentence scoring for the query. IE I just have an algorithm for ranking my semantic chunks for each query.

But otherwise everything in the video is pretty close to what I did.

2 Likes