In order to solve the problems of low accuracy, recall rate, and F1 value of traditional English grammar error detection methods, a new machine translation model is constructed and applied to English grammar error detection. In the encoder-decoder framework, the machine translation model is constructed through the steps of word vector generation, encoder language model construction, decoder language model construction, word alignment, output module, and so on. On this basis, the machine translation model is trained to detect English grammatical errors through dependency analysis and alternative word generation. Experimental results show that the accuracy, recall rate, and F1 value of the proposed method are higher than those of the experimental comparison method for detecting English grammatical errors such as articles, prepositions, nouns, verbs, and subject-verb agreement, indicating that the proposed method is of high practical value.