Input: training set , selected feature number
Output: top features in
()   For each category
() Compute the total term frequency of all terms in category
()   End For
()   For each term
() Compute the total document frequency of a term in all categories
() For each category
()  Compute the term frequency of a term in category
()  Compute the document frequency of a term in category
() End For
() End For
() For each term
() For each category
()  Compute the significance of a term in category
() End For
() End For
() For each term
() Compute the value of
() End For
() Rank all terms descendingly based on
() Selest top terms as features
Pseudocode 1