The consciousness and behavior of students in the Ideological and Political Education curriculum generate massive amounts of data information, how to allow educators to quickly obtain information from the massive amount of text data is very important to improve the energy efficiency of classroom education. SVM technology is employed in this paper for data mining and text classification. Firstly, using the web crawler method, the text of messages related to the Ideological and Political Science course posted by students on social networks is collected. The short text was preprocessed before performing sentiment analysis, which mainly included interaction information filtering, word segmentation, and lexical labeling. Then, the SVM model suitable for students’ ideology analysis is constructed, using the Gauss radial basis kernel function to accurately depict the distribution structure of the data, and the L1-SVM model with more stable computational performance is also proposed. The extension method of the classification algorithm in the real number domain is summarized at the end. This algorithm’s accuracy is 78%, and its F1 value is 80%, which is higher than the other three algorithms. DAG-SVM and recall are both optimized to a lesser extent. Overall, the classification efficiency of the algorithm in this paper has been improved. The positive effect of this paper’s algorithm on improving the effectiveness of Ideological and Political Education can be seen in the significant increase in the learning interest of the experimental class.