Unigram model with validation