The development of deep learning and the continuous progress of artificial intelligence have contributed to the rapid development of speech recognition. Among them, the end-to-end structure is the more important part of the whole speech recognition. This paper introduces two end-to-end speech recognition methods, the attention model and the CTC loss function, describes the practical application of deep learning in speech recognition and suggests improvements to the two models. Finally, the practical usefulness of speech recognition is demonstrated by analyzing the application of trigger word detection and sentiment analysis in artificial intelligence in teaching and learning.