This paper starts from the unsupervised learning algorithm and introduces it into the field of English teaching to analyze English grammatical structure in depth. The similarity of English texts is calculated using dependent syntactic analysis, and the English grammar structure analysis model (HHMM) based on unsupervised learning is constructed through the methods of plain Bayes, Hidden Markov Model, and Hierarchical Markov Model. The model of automated classification and sharing of English grammar teaching resources is constructed, and the automatic scoring module of online examination of the system is designed using graph attention network. The performance and usability of the HHMM grammar structure analysis model and the automated English grammar teaching system are evaluated respectively. The analysis indexes of this paper’s HHMM grammar structure analysis model in all experimental datasets are optimal results, and its grammar analysis performance far exceeds that of other models. The overall score for the usability of the automated grammar teaching system in this paper is 4.21. The scores of the four first-level indicators are all over 4 or more. The range of scores in the secondary metrics is [4.02,4.31]. The range of scores in tertiary indicators is [3.97,4.54], and only two tertiary indicators are below 4. It can be seen that the automated grammar teaching system in this paper has obtained good evaluation results among the student population.