Calculate probability for each words in classes.