https://maxhalford.github.io/blog/text-classification-zstd/

This is a cool blog post about using compression.zstd in Python as a surprisingly effective (and fast!) simple text classifier.

Text classification with Python 3.14's zstd module

Python 3.14 introduced the compression.zstd module. It is a standard library implementation of Facebook’s Zstandard (Zstd) compression algorithm. It was developed a decade ago by Yann Collet, who holds a blog devoted to compression algorithms. I am not a compression expert, but Zstd caught my eye because it supports incremental compression. You can feed it data to compress in chunks, and it will maintain an internal state. It’s particularly well suited for compressing small data. It’s perfect for the classify text via compression trick, which I described in a previous blog post 5 years ago.

Max Halford