cipherself an hour ago

12 (13?) years ago I had also written a Naïve Bayes classifier in Perl https://github.com/cipherself/NaiveBayes_perl

IIRC, next thing on my TODO list was to add vectorization. Also (like OP) it uses log probabilities to avoid floating-point underflow.

leetrout an hour ago

Could you put a license on it so we know how it can be used?