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 URL: https://news.ycombinator.com/item?id=50073732
Points: 1
# Comments: 0



