In order to improve the efficiency of sentiment analysis of students in ideological and political classrooms, under the guidance of artificial intelligence ideas, this paper combines data mining and machine learning algorithms to improve and propose a method for quantifying the semantic ambiguity of sentiment words. Moreover, this paper designs different quantitative calculation methods of sentiment polarity intensity, and constructs video image sentiment recognition, text sentiment recognition, and speech sentiment recognition functional modules to obtain a combined sentiment recognition model. In addition, this article studies student emotions in ideological and political classrooms from the perspective of multimodal transfer learning, and optimizes the deep representation of images and texts and their corresponding deep networks through single-depth discriminative correlation analysis. Finally, this paper designs experiments to verify the model effect from two perspectives of single factor sentiment analysis and multi-factor sentiment analysis. The research results show that comprehensive analysis of multiple factors can effectively improve the effect of sentiment analysis of students in ideological and political classrooms, and enhance the effect of ideological and political classroom teaching.