News for hackers. Stuff that matters.
Re:Elegant n-gram generation in Python by syllogism on Monday August 18, 2014 @01:05PM (#8193478)
I didn't think of character n-grams, that's a case where yeah, you do want larger n. Same with bioinformatics.

But as far as word ngrams goes, I've been doing NLP research for over ten years, and you almost never want 4 or 5 grams, let alone ngrams of greater length. The data's simply too sparse to be useful. So, it's really a matter of generating bigrams and generating trigrams, which I think it's reasonable to have separate functions for.

There are no comments on this comment yet.