With the widespread popularity of artificial intelligence, many unrelated knowledge are gradually linked together. The output-oriented method used in this study was used in foreign language teaching when it was proposed. In the context of artificial intelligence, this research applies the output-oriented method to ideological and political teaching, and the core of the research is to prove the feasibility of the output-oriented method in ideological and political teaching. Before the start of the research, we investigate and analyze the research results of some scholars related to this research, find out the deficiencies of these research results, and find some content suitable for this research. Corresponding innovations are made on its basis to obtain the results of this study. In the process of research, this paper gives a detailed description of artificial intelligence, output-oriented method, ideological and political teaching, and feasibility analysis, and focuses on the introduction of artificial intelligence neural network algorithms. Finally, the feasibility of the output-oriented method in ideological and political teaching is proved through the actual application of the output-oriented method. The experimental data shows the high, medium and low of the experimental group. The average scores of the pre-test were 63.79, 53.69 and 40.83 respectively, and the average scores of the post-test were 70.82, 60.85 and 52.17 respectively.