Wednesday, October 28, 2026 Today’s Paper
Log in Join free
Vol. I · No. 29 Texas Edition
Wednesday, Oct 28
Texas first. Then the world.
Always free Updated just now
Read. React. Discuss.
Tech

Show HN: Surprisal – a language identifier in ~250 lines of C. No ML,no training

By iushh 1 min read 8 views 0 comments

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

Hacker News (Newest) Original story · github.com
Read the full story

Discussion (0)

No comments yet. Start the conversation!