Categorizing text with n-gram (python)