Since, chi-square method gives feature ranking for the class variable and not for individual classes, we compute word rankings for individual classes using tf − idf scores of words.
for a term t and a class c, we compute the term frequency of t by counting its number of occurrences in the instances (sentences) belonging to c and multiply the term frequency with the inverse document frequency of t (calculated from the entire corpus) to get the tf − idf score of t for c. Using this method, we calculated tf − idf scores for all the words and ranked them according to their scores for the two classes.