ESM3 function tokenizer

Neither step here is a trained network. TF-IDF just reweights annotations by rarity; hashing just checks which side of a few fixed lines a point falls on. Nothing is learned, yet proteins doing similar things still end up close together.

Six toy proteins, each tagged with InterPro annotations from a shared vocabulary of 8 terms. Pick one to see its annotations reweighted by rarity — idf = log₂(N / df), where df is how many of the 6 proteins carry that term. Common terms shrink toward zero; rare ones dominate.

selected protein other proteins
drag the orange point — watch when the bucket number changes