πŸ” Search
Sign in to post
Show HN: Surprisal – a language identifier in ~250 lines of C. No ML,no traininghttps://github.com/ahhyoushh/zip-surprisal

I made a text/language identifier today, in a single C file, with no ML. It classifies a text by checking which reference text a hand-rolled greedy LZ77 compressor finds least surprising. Each class is just a file of reference data. For a query, it sums the bits the compressed output would cost against each reference, and the cheapest one wins. It never writes a compressed file. I got this idea after watching 3b1b's compression is intelligence series for the 3rd time, so i had to make sure i understand it finally. I have my intro to C exam tomorrow, so feedback on the C is welcome. Comments U…

β†—

0trust.social media

Loading your media...

Pick a GIF β€” Giphy

Loading GIFs...