The teaching evaluation index system based on artificial intelligence not only evaluates and reflects the teaching situation of ideological and political theory courses in universities as a whole, but also provides specific feasible goals and direction guidance for the construction of ideological and political theory courses in universities. Based on data mining technology, this paper combines machine learning algorithms and dimensional analysis to study the ideological and political evaluation model of colleges and universities and builds an artificial intelligence teaching evaluation model based on actual needs. Moreover, this study transforms the model selection problem into a hybrid optimization algorithm optimization problem, and the algorithm attempts to find the optimal model from the model set. In addition, this study designs a control experiment to perform model performance analysis. The results of the study show that the performance of the model meets the expected goals and can be applied to practice.