Nowadays, with the development of media technology, people receive more and more information. Among them, the most important is the text classification technology. This paper aims to improve text classification methods using Convolutional Neural Networks(CNNs) and natural language processing techniques. The technical requirements and application scenarios of text classification are combined with Machine Learning to optimize classification, and for the application of Natural Language Processing in text classification, and a text classification algorithm is proposed, and the accuracy rate of TPM algorithm in different data sets is above 95%.