Text feature is an important category attribute of text. Feature extraction directly affects the accuracy of text classification. An improved feature weighting algorithm is proposed in this paper. The chi-square statistical method is applied to calculate feature weight, which improves the accuracy of extracting feature words of categories. The IDF calculation method is improved from the category concentration of keywords. This paper uses the TF-IDF before and after the improvement to extract feature and classify the same text data individually. The results show that the classification effect of the improved method is better than the traditional method.