# Research and Implementation of English Grammar Check and Error Correction Based on Deep Learning

Authors: Xiuhua Wang; Weixuan Zhong
Journal: Scientific Programming
 (2022)

---

## Abstract

English as a universal language in the world will get more and more attention, but English is not our mother tongue, and there exist differences in culture and thinking. English grammar is the most difficult problem to solve. There are many English learners, and the number of English teachers is limited, and it is inevitable to use Internet technology to solve the problem of lack of resources. The article uses deep learning technology to propose an ASS grammar detection model, which can quickly and efficiently detect grammatical errors. The research results show the following. (1) This study selects data from the GEC evaluation task and analyzes the four modules of article, noun, verb, and preposition through algorithms under different models. The results indicate the accuracy of the four modules. The recall rate has been improved to a certain extent, the accuracy rate of nouns is the highest, which can reach 63.99%, the accuracy rate of prepositions is improved to a lesser extent, and the inspection accuracy rate after improvement is 12.79%. (2) In the experiment to verify the effectiveness of the ASS grammar detection model, compared with the detection effect of the ordinary model, the accuracy of the ASS comprehensive inspection has been greatly improved. The comprehensive accuracy of the ordinary detection model is 28.01%, and the ASS model’s comprehensive accuracy rate of the inspection was 82.82%, and the accuracy rate was increased by 54.81%. The result shows that the performance of the ASS inspection model has been improved by leaps and bounds compared with the traditional model. (3) After transforming and upgrading the ASS model, the three models and other models obtained were run on the test set and the mixed test set, respectively. The results show that the accuracy, precision, recall, and F1 score of ASS model are the highest in the test set, which are 98.71%, 98.83%, 98.64%, and 98.73%, respectively, the Bayesian network check model has the lowest accuracy rate of 51.74%, and the ROC curve value and AUC value of the ASS model are both the largest. The accuracy of the ASS model on the mixed test set is also the highest, reaching 98.01%. The JaSt model on the mixed test set has a significant downward trend, with the accuracy rate dropping from 92.16% to 56.68%. It can be concluded that the ASS model can accurately and efficiently monitor grammatical errors.


---

## Body

## 1. Introduction

With the increasing update of computers and the Internet, tens of thousands of users tend to write and communicate in English in their daily work. For users whose native language is not English, writing in English is a major obstacle for them. Grammar checking technology originated from the application of natural language understanding. Clément et al. [1] proposed an open grammar checking system under the deep learning model to analyze and train the grammar in depth. The standard of grammar directly affects the fluency of sentences. The grammar checking system introduced in this article can efficiently check out grammatical errors in sentences and automatically generate correct sentences to replace the wrong ones. Xu [2] improved the algorithm and accuracy of grammar checking and designed and developed a grammar checking system. Sankaravelayuthan [3] proposed an MS-Word tool to check spelling errors in text. Because a word is composed of many English letters, after we enter the English word, there will inevitably be input errors. The tools proposed in the article will help us solve these problems and will automatically check the spelling errors in the article. Jacobs and Rodgers [4] discussed the use of French computer grammar checker as a learning and teaching resource. They conducted an experiment in which students use a screen checker or other methods to check for grammatical errors in English articles. Lüthy et al. [5] studied the method of segmenting offline cursive handwritten text lines into individual words. Prins [6] found some of the most common mistakes made by Taiwanese students in writing and provided some strategies that teachers use in ESL classrooms. Keong [7] wrote an expert system for English grammar teaching for personal computer users. The system uses a parser to implement a grammatical checking tool, and the system can check for grammatical errors in the text. You can also create files to store grammatical errors and corresponding information from the text. Kann [8] realized the writing method of long text in computer and determined the writing process through the relevant model. Xie [9] implemented the rules of grammar checking according to the principles of practicality and validity. The article simplifies the analysis of the algorithm and expands the coverage of errors. Grammar error checking is a very important task in correcting the text. For people with poor English, writing in English is a relatively difficult task. If English is not good, you cannot use the grammar in English correctly, thus increasing the demand for grammar checking software. The purpose of the literature [10] is to examine the existing literature, highlight current issues, and propose potential directions for future research. The article observes and analyzes the error analysis program, summarizes the error experience, and finds the correct program. The development of computer technology helps enrich the content of English education and provides more convenience for English learning. Pan and Zhou [11] realized personalized inspection and diagnosis of college students’ English grammar. Amrhein [12] discussed the importance of correct use of conjunctions and semicolons in the preparation of policy tables to avoid misunderstanding of the intended meaning. Shepheard [13] introduced a method of self-study English grammar, through which you can formulate grammar rules for yourself. Using this learning method can help us learn and understand grammar without the guidance of a teacher. The system will list students’ common grammatical errors, and students can conduct intensive training based on the grammatical errors listed by the system. Mondal and Mondal [14] introduced a proprietary software application. The program can provide many services, including helping us detect grammatical errors in English articles and automatically generate correct sentences. Richards et al. [15] introduced a two-level general English course for Italian middle school students. The course mainly emphasizes the communication methods of accuracy and fluency. The course includes three parts: communication check, grammar check, and study check. The above research methods are based on artificial intelligence or modern technology applied to English grammar detection and verification. However, the detection efficiency of grammar is low, the error rate is high, and the prediction efficiency is not ideal. In this paper, an ASS grammar detection model is proposed by using deep learning technology, which can detect grammar errors quickly and efficiently.


## 2. Research and Realization of English Grammar Check

### 2.1. The Significance of Grammar Checking Research

Due to the great flexibility and uncertainty of natural language itself, English is a typical representative of many vocabulary, complex grammar, and extensive usage scenarios, which increases the difficulty of computer automatic error detection and correction. Another important reason that affects the development of grammatical error correction is the lack of relevant corpus. It is very difficult to construct a corpus marked with grammatical errors. The current mainstream research methods of grammatical error correction are all based on statistical machine learning, which requires a large amount of corpus for model training and testing [16]. However, with the attention of universities and research institutions on this issue, the problem of lack of corpus has been greatly improved, laying a solid foundation for further research. Therefore, this article will study deep learning technology and use it to solve the problem of English grammar error correction. Based on the proposed error correction algorithm, the algorithm model experiment and verification are carried out, and considering the application of the algorithm, a grammatical error correction system similar to Google translation is constructed, providing a simple and convenient way for English learners to use. The combination of theory and practice has a certain promotion effect on solving the problem of English grammar error correction and improving the grammar level of English learners. The classification of common grammatical errors is shown in Table 1.Table 1
Classification of grammatical errors [17].
TypeContentVtVerb tenseVmVerb modalityV0Missing verbV formVerb formSVASubject-verb agreementArt or DetArticleNnNoun (singular and plural)NposWord possessivePformPronoun formPrefPronoun reference


### 2.2. The Overall Framework Design of English Grammar Check

According to the results of the functional analysis of business requirements, the architecture of the grammar error correction system model [18] is shown in Figure 1.Figure 1
Framework diagram of grammatical error correction model.The core module of grammar error correction mainly includes three functional modules: data processing, model training, and model error correction, and model error correction is the core function of the whole algorithm [19]. The main function of data processing is to preprocess the original corpus data, to store the processed corpus data in a structured way, and to learn the module and get the standard dataset. Model training is to train the data in the corpus, save the trained features in the database, and apply them in the later test and matching [20]. Model error correction is to use the error correction model stored in the training library to match the input sentence grammar and output the correct sentence. The error correction service model can accept the error correction request from the user in real time, analyze it through the error correction model of the corpus, and return the correct content to the user.


### 2.3. Implementation of Syntax Error Correction

Firstly, learning is carried out according to the characteristics of grammar error correction, and an English error correction application submitted by a user is received. First determine whether the submitted parameters are valid and then enter the next step to split the sentence. Then, the error correction model trained before is used for grammar error correction. When the error correction of the last sentence is completed, the error correction sentences returned to the segmentation are merged. If the sentence is simple, the error correction model can be used directly without sentence segmentation. Feedback suggestion means that when the user is not satisfied with the grammatical error correction given by the system or there is a better way to modify it, the modification suggestion is fed back to the system. As mentioned above, we will filter the modification suggestions submitted by users, so the previous feedback suggestion filtering model will be used in the feedback suggestion function. Similar to grammatical error correction, we also carry out the design of feedback suggestions from two aspects. One is the feedback filtering interface itself, and its work flowchart is given; the other is the call flow between modules, which is explained using sequence diagrams. First, we introduce the feedback filtering interface. According to the syntax error correction process, first determine whether the request parameters are legal; if not, directly end [21]. The probabilities of the error correction statement and the original system modification statement are calculated, respectively, for the error correction model.


## 2.1. The Significance of Grammar Checking Research

Due to the great flexibility and uncertainty of natural language itself, English is a typical representative of many vocabulary, complex grammar, and extensive usage scenarios, which increases the difficulty of computer automatic error detection and correction. Another important reason that affects the development of grammatical error correction is the lack of relevant corpus. It is very difficult to construct a corpus marked with grammatical errors. The current mainstream research methods of grammatical error correction are all based on statistical machine learning, which requires a large amount of corpus for model training and testing [16]. However, with the attention of universities and research institutions on this issue, the problem of lack of corpus has been greatly improved, laying a solid foundation for further research. Therefore, this article will study deep learning technology and use it to solve the problem of English grammar error correction. Based on the proposed error correction algorithm, the algorithm model experiment and verification are carried out, and considering the application of the algorithm, a grammatical error correction system similar to Google translation is constructed, providing a simple and convenient way for English learners to use. The combination of theory and practice has a certain promotion effect on solving the problem of English grammar error correction and improving the grammar level of English learners. The classification of common grammatical errors is shown in Table 1.Table 1
Classification of grammatical errors [17].
TypeContentVtVerb tenseVmVerb modalityV0Missing verbV formVerb formSVASubject-verb agreementArt or DetArticleNnNoun (singular and plural)NposWord possessivePformPronoun formPrefPronoun reference


## 2.2. The Overall Framework Design of English Grammar Check

According to the results of the functional analysis of business requirements, the architecture of the grammar error correction system model [18] is shown in Figure 1.Figure 1
Framework diagram of grammatical error correction model.The core module of grammar error correction mainly includes three functional modules: data processing, model training, and model error correction, and model error correction is the core function of the whole algorithm [19]. The main function of data processing is to preprocess the original corpus data, to store the processed corpus data in a structured way, and to learn the module and get the standard dataset. Model training is to train the data in the corpus, save the trained features in the database, and apply them in the later test and matching [20]. Model error correction is to use the error correction model stored in the training library to match the input sentence grammar and output the correct sentence. The error correction service model can accept the error correction request from the user in real time, analyze it through the error correction model of the corpus, and return the correct content to the user.


## 2.3. Implementation of Syntax Error Correction

Firstly, learning is carried out according to the characteristics of grammar error correction, and an English error correction application submitted by a user is received. First determine whether the submitted parameters are valid and then enter the next step to split the sentence. Then, the error correction model trained before is used for grammar error correction. When the error correction of the last sentence is completed, the error correction sentences returned to the segmentation are merged. If the sentence is simple, the error correction model can be used directly without sentence segmentation. Feedback suggestion means that when the user is not satisfied with the grammatical error correction given by the system or there is a better way to modify it, the modification suggestion is fed back to the system. As mentioned above, we will filter the modification suggestions submitted by users, so the previous feedback suggestion filtering model will be used in the feedback suggestion function. Similar to grammatical error correction, we also carry out the design of feedback suggestions from two aspects. One is the feedback filtering interface itself, and its work flowchart is given; the other is the call flow between modules, which is explained using sequence diagrams. First, we introduce the feedback filtering interface. According to the syntax error correction process, first determine whether the request parameters are legal; if not, directly end [21]. The probabilities of the error correction statement and the original system modification statement are calculated, respectively, for the error correction model.


## 3. Error Correction Model

### 3.1. Deep Learning Technology

The seq2seq model is composed of an encoder and is a cyclic neural network; in the encoding stage, a semantic vector is generated according to the input sequencex1,x2,… and conversion rule f [22], and the calculation formula is(1)ht=fht−1,xt.Summarize the semantic vector:(2)C=qh1,h2,h3,…,ht.Decoding:(3)yt=arg maxPyt=∏t=1Tpyt|y1,y2,…,yt−1,C.The calculation formula of the hiding algorithm:(4)ht′=fht−1′,yt−1,C.


### 3.2. Evaluation Criteria for English Grammar Error Correction

The most commonly used evaluation algorithm for grammatical error correction isMax MatchM2. The principle of the algorithm Max Match is introduced below [23]; correction rate P:(5)P=∑i=1ngi∩ei∑i=1nei.Correction rateR:(6)R=∑i=1ngi∩ei∑i=1nei.The key evaluation index inMax Match is F0.5, and the formula is defined as follows:(7)F0.5=1+0.52∗R∗PR+0.52∗P.


#### 3.2.1. Syntax Error Correction Model

In the Soft Attention Mechanism, the weightaij is determined by the (i−1)th hidden state si−1 and each hidden state variable in the input [24]. The calculation formula is as follows:(8)aij=expeij∑k=1Txexpeik,eij=asi−1,hj.LN is calculated by inputting the entire layer of neurons in RNN [25]:(9)μ=1H∑i=1Hxi,σ=1H∑i=1Hxi−μ2.Anti-filtering algorithm:(10)pωi|ω1,…,ωi−1=pωi|ωi−n−1,…,ωi−1.Whenn = 2, bigram is(11)pωi|ω1,…,ωm=∏i=1mpωi|ωi−1.Whenn = 3, bigram is(12)pωi|ω1,…,ωm=∏i=1mpωi−2ωi−1.Estimate the value ofpωi|ωi−2ωi−1, and the formula is(13)pωi|ωi−2ωi−1=cωi−2ωi−1ωicωi−2ωi−1.According to the N-gram grammar model introduced above, we can get(14)PS=Pω1,ω2,…,ωm.Confusion:(15)PPS=Pω1,ω2,…,ωm1/m=m1Pω1,ω2,…,ωm.According to the chain method, it can be written as(16)PPS=m∏i=1mpωi|ωi−n−1,…,ωi−1.


#### 3.2.2. ASS Model Design

The objective function of a single-layer neural network is(17)vecp≈tanh∑i=1nΩPΩciWcode,i⋅vecci+b,Wcode,i=ηlWcodel+ηrWcoder.The coefficientsηl and ηr are(18)ηl=Ωp−iΩp−1,ηr=i−1Ωp−1.The matrix parameters of the only child node are(19)Wcode,i=12Wcodel+12Wcoder.Square of Euclidean distance:(20)d=vecp−tanh∑i=1nliWcode,i⋅vecci+b22.The error function of training samplexi and its corresponding negative example xci is(21)Jdi,dci=max0,Δ+di−dci.The final training objective function is(22)minWcodel12N∑i=1NJdi,dci+λ2MWcodelF2+WcoderF2.


## 3.1. Deep Learning Technology

The seq2seq model is composed of an encoder and is a cyclic neural network; in the encoding stage, a semantic vector is generated according to the input sequencex1,x2,… and conversion rule f [22], and the calculation formula is(1)ht=fht−1,xt.Summarize the semantic vector:(2)C=qh1,h2,h3,…,ht.Decoding:(3)yt=arg maxPyt=∏t=1Tpyt|y1,y2,…,yt−1,C.The calculation formula of the hiding algorithm:(4)ht′=fht−1′,yt−1,C.


## 3.2. Evaluation Criteria for English Grammar Error Correction

The most commonly used evaluation algorithm for grammatical error correction isMax MatchM2. The principle of the algorithm Max Match is introduced below [23]; correction rate P:(5)P=∑i=1ngi∩ei∑i=1nei.Correction rateR:(6)R=∑i=1ngi∩ei∑i=1nei.The key evaluation index inMax Match is F0.5, and the formula is defined as follows:(7)F0.5=1+0.52∗R∗PR+0.52∗P.


### 3.2.1. Syntax Error Correction Model

In the Soft Attention Mechanism, the weightaij is determined by the (i−1)th hidden state si−1 and each hidden state variable in the input [24]. The calculation formula is as follows:(8)aij=expeij∑k=1Txexpeik,eij=asi−1,hj.LN is calculated by inputting the entire layer of neurons in RNN [25]:(9)μ=1H∑i=1Hxi,σ=1H∑i=1Hxi−μ2.Anti-filtering algorithm:(10)pωi|ω1,…,ωi−1=pωi|ωi−n−1,…,ωi−1.Whenn = 2, bigram is(11)pωi|ω1,…,ωm=∏i=1mpωi|ωi−1.Whenn = 3, bigram is(12)pωi|ω1,…,ωm=∏i=1mpωi−2ωi−1.Estimate the value ofpωi|ωi−2ωi−1, and the formula is(13)pωi|ωi−2ωi−1=cωi−2ωi−1ωicωi−2ωi−1.According to the N-gram grammar model introduced above, we can get(14)PS=Pω1,ω2,…,ωm.Confusion:(15)PPS=Pω1,ω2,…,ωm1/m=m1Pω1,ω2,…,ωm.According to the chain method, it can be written as(16)PPS=m∏i=1mpωi|ωi−n−1,…,ωi−1.


### 3.2.2. ASS Model Design

The objective function of a single-layer neural network is(17)vecp≈tanh∑i=1nΩPΩciWcode,i⋅vecci+b,Wcode,i=ηlWcodel+ηrWcoder.The coefficientsηl and ηr are(18)ηl=Ωp−iΩp−1,ηr=i−1Ωp−1.The matrix parameters of the only child node are(19)Wcode,i=12Wcodel+12Wcoder.Square of Euclidean distance:(20)d=vecp−tanh∑i=1nliWcode,i⋅vecci+b22.The error function of training samplexi and its corresponding negative example xci is(21)Jdi,dci=max0,Δ+di−dci.The final training objective function is(22)minWcodel12N∑i=1NJdi,dci+λ2MWcodelF2+WcoderF2.


## 3.2.1. Syntax Error Correction Model

In the Soft Attention Mechanism, the weightaij is determined by the (i−1)th hidden state si−1 and each hidden state variable in the input [24]. The calculation formula is as follows:(8)aij=expeij∑k=1Txexpeik,eij=asi−1,hj.LN is calculated by inputting the entire layer of neurons in RNN [25]:(9)μ=1H∑i=1Hxi,σ=1H∑i=1Hxi−μ2.Anti-filtering algorithm:(10)pωi|ω1,…,ωi−1=pωi|ωi−n−1,…,ωi−1.Whenn = 2, bigram is(11)pωi|ω1,…,ωm=∏i=1mpωi|ωi−1.Whenn = 3, bigram is(12)pωi|ω1,…,ωm=∏i=1mpωi−2ωi−1.Estimate the value ofpωi|ωi−2ωi−1, and the formula is(13)pωi|ωi−2ωi−1=cωi−2ωi−1ωicωi−2ωi−1.According to the N-gram grammar model introduced above, we can get(14)PS=Pω1,ω2,…,ωm.Confusion:(15)PPS=Pω1,ω2,…,ωm1/m=m1Pω1,ω2,…,ωm.According to the chain method, it can be written as(16)PPS=m∏i=1mpωi|ωi−n−1,…,ωi−1.


## 3.2.2. ASS Model Design

The objective function of a single-layer neural network is(17)vecp≈tanh∑i=1nΩPΩciWcode,i⋅vecci+b,Wcode,i=ηlWcodel+ηrWcoder.The coefficientsηl and ηr are(18)ηl=Ωp−iΩp−1,ηr=i−1Ωp−1.The matrix parameters of the only child node are(19)Wcode,i=12Wcodel+12Wcoder.Square of Euclidean distance:(20)d=vecp−tanh∑i=1nliWcode,i⋅vecci+b22.The error function of training samplexi and its corresponding negative example xci is(21)Jdi,dci=max0,Δ+di−dci.The final training objective function is(22)minWcodel12N∑i=1NJdi,dci+λ2MWcodelF2+WcoderF2.


## 4. Simulation Experiment

### 4.1. Data Analysis

In order to effectively analyze the data, we select the data in the GEC evaluation task and analyze the algorithms of the four modules of article, noun, verb, and preposition under different models. The experiment compares the results by setting whether to use the law library, and in order to enhance for the persuasiveness of the experiment, we have added a comparative experiment with the common algorithm. The statistical results of various error types in the training data and test data are shown in Table2 and Figure 2.Table 2
Data statistics of evaluation tasks.
Type of errorTraining set numberTraining set percentageTest set numberTest set percentageArticle66514.869019.9Preposition2405.33129.0Noun3778.439611.4Subject-verb agreement1453.21223.5Verb form1523.41243.6Five types58235.1164447.4All types6511003470100.0Figure 2
Statistical graph of experimental results.The five types include errors in articles, errors in prepositions, errors in names, grammatical errors in subject-verb agreement, and errors in verb forms, while the all types include errors in verb tenses, missing verbs, verb forms, subject-verb agreement, articles, singular and plural nouns, possessive words, and pronoun forms. Table2 shows an experimental analysis of five common types of grammatical errors.


#### 4.1.1. Article Inspection Module

The accuracy and recall rate of adding the rule library to the article check module have been significantly improved, indicating that the automatic extraction of the rule library is effective for the entire inspection and correction process as shown in Figure3 and Table 3. At the same time, the fallback algorithm is improved. After the limited back-off algorithm, the accuracy rate has also been greatly improved, and the correction process is more accurate, thereby increasing the final F1 value.Figure 3
Statistics of article inspection results.Table 3
Comparison of article check module results.
ModelAccuracy rate (%)Recall rate (%)F1 value (%)Corpus + fallback algorithm17.7938.7020.71Rules + corpus + fallback algorithm23.2545.8831.44Rules + corpus + limited fallback algorithm43.4927.1233.45


#### 4.1.2. Noun Check Module

In the noun checking module of Table4, after using the model algorithm, the accuracy and recall rate have been greatly improved, and the accuracy rate is up to 63.99% because nouns account for the highest proportion of sentences. When using the grammar check module, you can correct more noun errors, thereby increasing the F1 value of the noun check module.Table 4
Comparison of noun check module results.
ModelAccuracy rate (%)Recall rate (%)F1 value (%)Corpus + fallback algorithm63.9930.0540.90Corpus + limited fallback algorithm4.0651.2645.3


#### 4.1.3. Verb Check Module

#### 4.1.4. Preposition Checking Module

As shown in the data in Tables5 and 6, in the grammar detection module, the accuracy and recall rate of verbs and prepositions have been improved, but the accuracy of prepositions has been improved to a lesser extent. The improved inspection accuracy rate is 12.79%. After using the fallback algorithm, the model’s judgment on grammar detection is stricter. The accuracy measure is the ratio of the number of correct samples to the number of all samples in the test set. The larger the index value is, the more accurate the recommendation result is. The F1 measurement index can effectively balance the precision and recall by biasing the objects with small values. The larger the index value is, the more accurate the recommendation result is. The improved recall of the verb and preposition checking modules of Table 5 and Table 6 illustrates that the results of the verb and preposition checking modules are more precise.Table 5
Comparison of verb check module results.
ModelAccuracy rate (%)Recall rate (%)F1 value (%)Corpus + fallback algorithm12.7922.3616.27Corpus + limited fallback algorithm19.3722.3620.27Table 6
Comparison of results of preposition checking module.
ModelAccuracy rate (%)Recall rate (%)F1 value (%)Corpus + fallback algorithm8.0125.3212.17Corpus + limited fallback algorithm13.4618.8315.70


### 4.2. Comparison of Test Results

We compared the inspection effect of the ASS model with the inspection effect of the ordinary model; the inspection effect of the grammar inspection module under the ordinary algorithm is shown in Table7, and the comprehensive grammar inspection result of the ASS model is shown in Table 8.Table 7
Common model detection effect.
Accuracy rate (%)Recall rate (%)F1 value (%)Verb error detection21.6721.2130.41Subject-verb consistency error detection29.3933.8431.46Noun singular and plural error detection31.3230.6130.96Article error detection27.1218.2621.83Preposition error detection27.6236.5831.47Overall error detection28.0137.1931.96Table 8
ASS comprehensive inspection results.
Accuracy rate (%)Recall rate (%)F1 valueVerb error detection30.1220.1234.21%Subject-verb consistency error detection40.0021.3331.71%Noun singular and plural error detection45.5128.7735.50%Article error detection67.3942.8452.38Preposition error detection72.1337.8749.66%Overall error detection82.8225.5739.07%From the data in Figures4 and 5, we can conclude that the accuracy of the ASS comprehensive inspection has been greatly improved compared with the inspection effect of the ordinary model. The comprehensive accuracy of the ordinary inspection model is 28.01%, and the ASS model inspection is better. The overall accuracy rate is 82.82%, the accuracy rate is increased by 54.81%, and the overall recall rate of the ASS model is also increasing, indicating that the performance of the ASS inspection model has been improved by leaps and bounds, and the efficiency of grammar detection and the correctness of grammar detection have been improved.Figure 4
Statistics of general inspection results.Figure 5
Statistics of ASS inspection results.


### 4.3. Model Performance Testing

We run each model on the test set and the mixed test set and record the experimental data. In the process of using the ASS model to detect grammar, the grammar needs to be converted into a mathematical representation that the model can handle, as shown in Figure6.Figure 6
The influence of the number of fully connected layers on the model.According to the data in Table9 and Figure 7, we can conclude that the accuracy of the ASS model is the highest among several models, reaching 99.71%, indicating that the performance of ASS detection is the highest, and the accuracy of the Bayesian network is the lowest, which is 51.74%, indicating that the detection efficiency of the Bayesian network model is not good enough.Table 9
Performance of each model on the test set.
ModelAccuracy rate (%)Precision rate (%)Recall rate (%)F1 score (%)RBF core support vector machine85.0093.0676.1383.75Bayesian network51.7451.2997.8367.30Decision tree89.1288.8389.8789.35JaSt92.1696.7192.5394.57ASS-T97.9798.1097.8998.00ASS-G96.5298.2694.8396.52ASS-TG99.7198.8397.7498.82Figure 7
ROC curve on the test set.ASS-T is a test of the data model and the overall syntax, starting with the creation of a new window or table. For each participating object, list the different domains and syntaxes. With the help of field definitions and basic techniques, ASS-G analyzes test data, overall syntax tests, partitions, and boundary values. The ASS-TG data model is the detailed syntax test. For the strictly syntactically controlled parts, you need to perform more detailed tests.According to the data in Table10 and Figure 8, it is concluded that the accuracy rate of the ASS-G model is as high as 98.01%. The JaSt model’s various indicators on the mixed test set have a significant downward trend, and the accuracy rate has dropped from 92.16% to 56.68%, because that syntax information in the test set is obfuscated, and the excellence of the ASS model is also reflected in the ROC curve.Table 10
Performance of each model on the mixed test set.
ModelAccuracy rate (%)Precision rate (%)Recall rate (%)F1 score (%)RBF core support vector machine47.5180.777.4513.63Bayesian network57.7056.3790.7569.55Decision tree54.4961.2549.6354.83JaSt56.6871.4924.7536.77ASS-T92.7195.0391.7093.33ASS-G98.0198.6797.7398.20ASS-TG96.7298.5495.5397.01Figure 8
ROC curve on the mixed test set.


## 4.1. Data Analysis

In order to effectively analyze the data, we select the data in the GEC evaluation task and analyze the algorithms of the four modules of article, noun, verb, and preposition under different models. The experiment compares the results by setting whether to use the law library, and in order to enhance for the persuasiveness of the experiment, we have added a comparative experiment with the common algorithm. The statistical results of various error types in the training data and test data are shown in Table2 and Figure 2.Table 2
Data statistics of evaluation tasks.
Type of errorTraining set numberTraining set percentageTest set numberTest set percentageArticle66514.869019.9Preposition2405.33129.0Noun3778.439611.4Subject-verb agreement1453.21223.5Verb form1523.41243.6Five types58235.1164447.4All types6511003470100.0Figure 2
Statistical graph of experimental results.The five types include errors in articles, errors in prepositions, errors in names, grammatical errors in subject-verb agreement, and errors in verb forms, while the all types include errors in verb tenses, missing verbs, verb forms, subject-verb agreement, articles, singular and plural nouns, possessive words, and pronoun forms. Table2 shows an experimental analysis of five common types of grammatical errors.


### 4.1.1. Article Inspection Module

The accuracy and recall rate of adding the rule library to the article check module have been significantly improved, indicating that the automatic extraction of the rule library is effective for the entire inspection and correction process as shown in Figure3 and Table 3. At the same time, the fallback algorithm is improved. After the limited back-off algorithm, the accuracy rate has also been greatly improved, and the correction process is more accurate, thereby increasing the final F1 value.Figure 3
Statistics of article inspection results.Table 3
Comparison of article check module results.
ModelAccuracy rate (%)Recall rate (%)F1 value (%)Corpus + fallback algorithm17.7938.7020.71Rules + corpus + fallback algorithm23.2545.8831.44Rules + corpus + limited fallback algorithm43.4927.1233.45


### 4.1.2. Noun Check Module

In the noun checking module of Table4, after using the model algorithm, the accuracy and recall rate have been greatly improved, and the accuracy rate is up to 63.99% because nouns account for the highest proportion of sentences. When using the grammar check module, you can correct more noun errors, thereby increasing the F1 value of the noun check module.Table 4
Comparison of noun check module results.
ModelAccuracy rate (%)Recall rate (%)F1 value (%)Corpus + fallback algorithm63.9930.0540.90Corpus + limited fallback algorithm4.0651.2645.3


### 4.1.3. Verb Check Module

### 4.1.4. Preposition Checking Module

As shown in the data in Tables5 and 6, in the grammar detection module, the accuracy and recall rate of verbs and prepositions have been improved, but the accuracy of prepositions has been improved to a lesser extent. The improved inspection accuracy rate is 12.79%. After using the fallback algorithm, the model’s judgment on grammar detection is stricter. The accuracy measure is the ratio of the number of correct samples to the number of all samples in the test set. The larger the index value is, the more accurate the recommendation result is. The F1 measurement index can effectively balance the precision and recall by biasing the objects with small values. The larger the index value is, the more accurate the recommendation result is. The improved recall of the verb and preposition checking modules of Table 5 and Table 6 illustrates that the results of the verb and preposition checking modules are more precise.Table 5
Comparison of verb check module results.
ModelAccuracy rate (%)Recall rate (%)F1 value (%)Corpus + fallback algorithm12.7922.3616.27Corpus + limited fallback algorithm19.3722.3620.27Table 6
Comparison of results of preposition checking module.
ModelAccuracy rate (%)Recall rate (%)F1 value (%)Corpus + fallback algorithm8.0125.3212.17Corpus + limited fallback algorithm13.4618.8315.70


## 4.1.1. Article Inspection Module

The accuracy and recall rate of adding the rule library to the article check module have been significantly improved, indicating that the automatic extraction of the rule library is effective for the entire inspection and correction process as shown in Figure3 and Table 3. At the same time, the fallback algorithm is improved. After the limited back-off algorithm, the accuracy rate has also been greatly improved, and the correction process is more accurate, thereby increasing the final F1 value.Figure 3
Statistics of article inspection results.Table 3
Comparison of article check module results.
ModelAccuracy rate (%)Recall rate (%)F1 value (%)Corpus + fallback algorithm17.7938.7020.71Rules + corpus + fallback algorithm23.2545.8831.44Rules + corpus + limited fallback algorithm43.4927.1233.45


## 4.1.2. Noun Check Module

In the noun checking module of Table4, after using the model algorithm, the accuracy and recall rate have been greatly improved, and the accuracy rate is up to 63.99% because nouns account for the highest proportion of sentences. When using the grammar check module, you can correct more noun errors, thereby increasing the F1 value of the noun check module.Table 4
Comparison of noun check module results.
ModelAccuracy rate (%)Recall rate (%)F1 value (%)Corpus + fallback algorithm63.9930.0540.90Corpus + limited fallback algorithm4.0651.2645.3


## 4.1.3. Verb Check Module

## 4.1.4. Preposition Checking Module

As shown in the data in Tables5 and 6, in the grammar detection module, the accuracy and recall rate of verbs and prepositions have been improved, but the accuracy of prepositions has been improved to a lesser extent. The improved inspection accuracy rate is 12.79%. After using the fallback algorithm, the model’s judgment on grammar detection is stricter. The accuracy measure is the ratio of the number of correct samples to the number of all samples in the test set. The larger the index value is, the more accurate the recommendation result is. The F1 measurement index can effectively balance the precision and recall by biasing the objects with small values. The larger the index value is, the more accurate the recommendation result is. The improved recall of the verb and preposition checking modules of Table 5 and Table 6 illustrates that the results of the verb and preposition checking modules are more precise.Table 5
Comparison of verb check module results.
ModelAccuracy rate (%)Recall rate (%)F1 value (%)Corpus + fallback algorithm12.7922.3616.27Corpus + limited fallback algorithm19.3722.3620.27Table 6
Comparison of results of preposition checking module.
ModelAccuracy rate (%)Recall rate (%)F1 value (%)Corpus + fallback algorithm8.0125.3212.17Corpus + limited fallback algorithm13.4618.8315.70


## 4.2. Comparison of Test Results

We compared the inspection effect of the ASS model with the inspection effect of the ordinary model; the inspection effect of the grammar inspection module under the ordinary algorithm is shown in Table7, and the comprehensive grammar inspection result of the ASS model is shown in Table 8.Table 7
Common model detection effect.
Accuracy rate (%)Recall rate (%)F1 value (%)Verb error detection21.6721.2130.41Subject-verb consistency error detection29.3933.8431.46Noun singular and plural error detection31.3230.6130.96Article error detection27.1218.2621.83Preposition error detection27.6236.5831.47Overall error detection28.0137.1931.96Table 8
ASS comprehensive inspection results.
Accuracy rate (%)Recall rate (%)F1 valueVerb error detection30.1220.1234.21%Subject-verb consistency error detection40.0021.3331.71%Noun singular and plural error detection45.5128.7735.50%Article error detection67.3942.8452.38Preposition error detection72.1337.8749.66%Overall error detection82.8225.5739.07%From the data in Figures4 and 5, we can conclude that the accuracy of the ASS comprehensive inspection has been greatly improved compared with the inspection effect of the ordinary model. The comprehensive accuracy of the ordinary inspection model is 28.01%, and the ASS model inspection is better. The overall accuracy rate is 82.82%, the accuracy rate is increased by 54.81%, and the overall recall rate of the ASS model is also increasing, indicating that the performance of the ASS inspection model has been improved by leaps and bounds, and the efficiency of grammar detection and the correctness of grammar detection have been improved.Figure 4
Statistics of general inspection results.Figure 5
Statistics of ASS inspection results.


## 4.3. Model Performance Testing

We run each model on the test set and the mixed test set and record the experimental data. In the process of using the ASS model to detect grammar, the grammar needs to be converted into a mathematical representation that the model can handle, as shown in Figure6.Figure 6
The influence of the number of fully connected layers on the model.According to the data in Table9 and Figure 7, we can conclude that the accuracy of the ASS model is the highest among several models, reaching 99.71%, indicating that the performance of ASS detection is the highest, and the accuracy of the Bayesian network is the lowest, which is 51.74%, indicating that the detection efficiency of the Bayesian network model is not good enough.Table 9
Performance of each model on the test set.
ModelAccuracy rate (%)Precision rate (%)Recall rate (%)F1 score (%)RBF core support vector machine85.0093.0676.1383.75Bayesian network51.7451.2997.8367.30Decision tree89.1288.8389.8789.35JaSt92.1696.7192.5394.57ASS-T97.9798.1097.8998.00ASS-G96.5298.2694.8396.52ASS-TG99.7198.8397.7498.82Figure 7
ROC curve on the test set.ASS-T is a test of the data model and the overall syntax, starting with the creation of a new window or table. For each participating object, list the different domains and syntaxes. With the help of field definitions and basic techniques, ASS-G analyzes test data, overall syntax tests, partitions, and boundary values. The ASS-TG data model is the detailed syntax test. For the strictly syntactically controlled parts, you need to perform more detailed tests.According to the data in Table10 and Figure 8, it is concluded that the accuracy rate of the ASS-G model is as high as 98.01%. The JaSt model’s various indicators on the mixed test set have a significant downward trend, and the accuracy rate has dropped from 92.16% to 56.68%, because that syntax information in the test set is obfuscated, and the excellence of the ASS model is also reflected in the ROC curve.Table 10
Performance of each model on the mixed test set.
ModelAccuracy rate (%)Precision rate (%)Recall rate (%)F1 score (%)RBF core support vector machine47.5180.777.4513.63Bayesian network57.7056.3790.7569.55Decision tree54.4961.2549.6354.83JaSt56.6871.4924.7536.77ASS-T92.7195.0391.7093.33ASS-G98.0198.6797.7398.20ASS-TG96.7298.5495.5397.01Figure 8
ROC curve on the mixed test set.


## 5. Conclusion

At present, there are more and more English learners, and the English grammar module is also a very important part of the English learning process. However, due to the particularity of English teaching, the auxiliary teaching of English grammar detection is particularly important, although the current grammar-assisted teaching has been combined with computers. Technology and network technology have greatly reduced the error rate, but there are still some problems with poor user experience. There is still a lot of room for improvement in English assisted teaching. Therefore, it should combine the current problems to improve constantly and propose a more intelligent and accurate grammar detection model to make English teaching easier and more efficient.



---

*Source: 4082082-2022-01-18.xml*