A foreign language writing automatic error correction method and system
By segmenting and word segmentation of foreign language text, combining pre-trained models to detect errors and generate error correction suggestions, the problems of inefficient and high cost of error correction in existing foreign language texts are solved, and efficient and accurate automatic error correction effect is achieved.
Patent Information
- Application Number
- CN202411259177.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-09-10
AI Technical Summary
The existing foreign language text error correction relies on manual inspection, which is inefficient, high cost and is prone to error correction inconsistency and missed inspection, affecting accuracy.
By segmenting and word segmentation of foreign language text, the pre-trained foreign language writing automatic error correction model is used to detect grammar and spelling errors, and generate error correction suggestions based on the writing intention prediction and content recommendation model to achieve automatic error correction.
It improves the accuracy and efficiency of error correction in foreign language texts, reduces manual intervention, provides more flexible and accurate error correction suggestions, and reduces costs.
Smart Images

Figure CN118780272B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of text processing, and in particular to a method and system for automatic error correction of foreign language writing. Background Art
[0002] In professional fields such as academic research, business communication, and technical document writing, the accuracy of foreign language text writing is crucial. Errors in foreign language texts may not only affect the communication of information, but also damage the professional image and even lead to misunderstandings or legal problems.
[0003] Existing foreign language text correction usually relies on manual checking to correct errors in foreign language texts, but this method has some limitations: (1) Manual text checking is a slow process that requires word-by-word review, which may lead to inefficiency in a fast-paced work environment; (2) Different proofreaders may have different understandings and judgments of the same text, which may lead to inconsistent correction results; (3) Hiring professional foreign language proofreaders may be costly; (4) Long hours of proofreading work can easily make proofreaders tired, thereby increasing the risk of missed detections and affecting the accuracy of correction. Summary of the invention
[0004] The technical problem to be solved by the present application is to provide a method and system for automatic error correction in foreign language writing, which realizes automatic error correction of sentence errors in foreign language writing.
[0005] In order to solve the above technical problems, the present application provides a foreign language writing automatic error correction method, comprising:
[0006] Acquire a foreign language text input by a user on a target interface, and segment the foreign language text to obtain a plurality of foreign language sentences;
[0007] Performing word segmentation processing on the plurality of foreign language sentences respectively to obtain a plurality of foreign language words and parts of speech corresponding to the plurality of foreign language words, and generating preprocessed foreign language sentences;
[0008] calling a pre-trained foreign language writing automatic error correction model, comparing the pre-processed foreign language sentence with a standard foreign language sentence, and when the pre-processed foreign language sentence and the standard foreign language sentence do not meet a consistency condition, performing a prediction process on the pre-processed foreign language sentence to obtain a writing intention corresponding to the pre-processed foreign language sentence;
[0009] Combining the writing intention and the preprocessed foreign language sentence to generate a foreign language sentence combination, inputting the foreign language sentence combination into a pre-built content recommendation model, and outputting a recommended foreign language sentence;
[0010] Based on the recommended foreign language sentences, a correction foreign language text is generated, and based on the target interface, the correction foreign language text is displayed to the user.
[0011] In a possible implementation, the plurality of foreign language sentences are respectively segmented to obtain a plurality of foreign language words and parts of speech corresponding to the plurality of foreign language words, and a preprocessed foreign language sentence is generated, specifically including:
[0012] Performing word segmentation processing on the plurality of foreign language sentences respectively to obtain a plurality of foreign language words corresponding to the plurality of foreign language sentences;
[0013] Using word2vec technology to perform word vector processing on the multiple foreign language words respectively, to obtain foreign language word vectors corresponding to the multiple foreign language words respectively;
[0014] Performing similarity matching processing on the foreign language vocabulary vector and the foreign language vocabulary configuration table to obtain a matching foreign language vocabulary vector corresponding to the foreign language vocabulary vector, and using the part of speech corresponding to the matching foreign language vocabulary vector as a label of the foreign language vocabulary corresponding to the foreign language vocabulary vector;
[0015] The plurality of foreign language words and the labels corresponding to the plurality of foreign language words are integrated to generate a preprocessed foreign language sentence.
[0016] In a possible implementation, similarity matching is performed on the foreign language vocabulary vector and the foreign language vocabulary configuration table to obtain a matching foreign language vocabulary vector corresponding to the foreign language vocabulary vector, and the part of speech corresponding to the matching foreign language vocabulary vector is used as a label of the foreign language vocabulary corresponding to the foreign language vocabulary vector, specifically including:
[0017] Obtaining standard vocabulary vectors corresponding to all foreign language words in the foreign language vocabulary configuration table, performing similarity matching between the vocabulary vectors and the standard vocabulary vectors, and obtaining matching foreign language vocabulary vectors corresponding to the vocabulary vectors;
[0018] The part of speech corresponding to the matching foreign language vocabulary vector is obtained based on the foreign language vocabulary configuration table, and the part of speech is used as a label of the foreign language vocabulary corresponding to the foreign language vocabulary vector to obtain labels corresponding to each of the multiple foreign language vocabulary.
[0019] In a possible implementation, calling a pre-trained foreign language writing automatic error correction model and comparing the pre-processed foreign language sentence with a standard foreign language sentence specifically includes:
[0020] Calling a pre-trained foreign language writing automatic error correction model to construct a grammatical parse tree corresponding to the pre-processed foreign language sentence, and constructing a standard grammatical parse tree corresponding to the standard foreign language sentence;
[0021] Based on the standard grammatical parse tree, determine whether the grammatical parse tree corresponding to the preprocessed foreign language sentence conforms to the grammatical rules; if so, determine that the preprocessed foreign language sentence and the standard foreign language sentence meet the consistency condition; otherwise, determine that the preprocessed foreign language sentence and the standard foreign language sentence do not meet the consistency condition.
[0022] In a possible implementation, performing predictive processing on the preprocessed foreign language sentence to obtain the writing intention corresponding to the preprocessed foreign language sentence specifically includes:
[0023] Performing semantic parsing on the preprocessed foreign language sentence to obtain a foreign language semantic parsing text corresponding to the preprocessed foreign language sentence, and performing feature extraction on the preprocessed foreign language sentence to obtain a sentence pattern feature corresponding to the preprocessed foreign language sentence;
[0024] Based on the sentence pattern features and the foreign language semantic analysis text, a writing intention corresponding to the preprocessed foreign language sentence is obtained.
[0025] In a possible implementation, the writing intention and the preprocessed foreign language sentence are combined to generate a foreign language sentence combination, the foreign language sentence combination is input into a pre-built content recommendation model, and a recommended foreign language sentence is output, specifically including:
[0026] Using the writing intention as a key name and the preprocessed foreign language sentence as a key value, performing concatenation processing on the key name and the key value to generate a foreign language sentence combination;
[0027] The foreign language sentence combination is input into a pre-built content recommendation model, so that the content recommendation model obtains a plurality of similar foreign language sentences from a standard foreign language sentence library based on the key value in the foreign language sentence combination, and screens the plurality of similar foreign language sentences based on the key name in the foreign language sentence combination, and outputs a recommended foreign language sentence.
[0028] In a possible implementation, generating a corrected foreign language text based on the recommended foreign language sentence specifically includes:
[0029] A target foreign language sentence corresponding to the recommended foreign language sentence in the foreign language text is obtained, the target foreign language sentence is updated to the recommended foreign language sentence, and the recommended foreign language sentence is subjected to differential processing to generate an error-corrected foreign language text.
[0030] The present application also provides a foreign language writing automatic error correction system, including: a foreign language text segmentation module, a word segmentation module, a writing intention prediction module, a recommended foreign language sentence output module and an error correction foreign language text generation module;
[0031] The foreign language text segmentation module is used to obtain the foreign language text input by the user on the target interface, and segment the foreign language text to obtain a plurality of foreign language sentences;
[0032] The word segmentation module is used to perform word segmentation processing on the multiple foreign language sentences respectively, obtain multiple foreign language words and the parts of speech corresponding to the multiple foreign language words, and generate preprocessed foreign language sentences;
[0033] The writing intention prediction module is used to call the pre-trained foreign language writing automatic error correction model, compare the pre-processed foreign language sentence with the standard foreign language sentence, and when the pre-processed foreign language sentence and the standard foreign language sentence do not meet the consistency condition, perform prediction processing on the pre-processed foreign language sentence to obtain the writing intention corresponding to the pre-processed foreign language sentence;
[0034] The recommended foreign language sentence output module is used to combine the writing intention and the preprocessed foreign language sentence to generate a foreign language sentence combination, input the foreign language sentence combination into a pre-built content recommendation model, and output a recommended foreign language sentence;
[0035] The error-correcting foreign language text generating module is used to generate an error-correcting foreign language text based on the recommended foreign language sentence, and to display the error-correcting foreign language text to the user based on the target interface.
[0036] In a possible implementation, the word segmentation module is used to perform word segmentation processing on the multiple foreign language sentences respectively, obtain multiple foreign language words and the parts of speech corresponding to the multiple foreign language words, and generate preprocessed foreign language sentences, specifically including:
[0037] Performing word segmentation processing on the plurality of foreign language sentences respectively to obtain a plurality of foreign language words corresponding to the plurality of foreign language sentences;
[0038] Using word2vec technology to perform word vector processing on the multiple foreign language words respectively, to obtain foreign language word vectors corresponding to the multiple foreign language words respectively;
[0039] Performing similarity matching processing on the foreign language vocabulary vector and the foreign language vocabulary configuration table to obtain a matching foreign language vocabulary vector corresponding to the foreign language vocabulary vector, and using the part of speech corresponding to the matching foreign language vocabulary vector as a label of the foreign language vocabulary corresponding to the foreign language vocabulary vector;
[0040] The plurality of foreign language words and the labels corresponding to the plurality of foreign language words are integrated to generate a preprocessed foreign language sentence.
[0041] In a possible implementation, the word segmentation module is used to perform similarity matching processing on the foreign language vocabulary vector and the foreign language vocabulary configuration table to obtain a matching foreign language vocabulary vector corresponding to the foreign language vocabulary vector, and use the part of speech corresponding to the matching foreign language vocabulary vector as a label of the foreign language vocabulary corresponding to the foreign language vocabulary vector, specifically including:
[0042] Obtaining standard vocabulary vectors corresponding to all foreign language words in the foreign language vocabulary configuration table, performing similarity matching between the vocabulary vectors and the standard vocabulary vectors, and obtaining matching foreign language vocabulary vectors corresponding to the vocabulary vectors;
[0043] The part of speech corresponding to the matching foreign language vocabulary vector is obtained based on the foreign language vocabulary configuration table, and the part of speech is used as a label of the foreign language vocabulary corresponding to the foreign language vocabulary vector to obtain labels corresponding to each of the multiple foreign language vocabulary.
[0044] In a possible implementation, the writing intention prediction module is used to call a pre-trained foreign language writing automatic error correction model and compare the pre-processed foreign language sentence with a standard foreign language sentence, specifically including:
[0045] Calling a pre-trained foreign language writing automatic error correction model to construct a grammatical parse tree corresponding to the pre-processed foreign language sentence, and constructing a standard grammatical parse tree corresponding to the standard foreign language sentence;
[0046] Based on the standard grammatical parse tree, determine whether the grammatical parse tree corresponding to the preprocessed foreign language sentence conforms to the grammatical rules; if so, determine that the preprocessed foreign language sentence and the standard foreign language sentence meet the consistency condition; otherwise, determine that the preprocessed foreign language sentence and the standard foreign language sentence do not meet the consistency condition.
[0047] In a possible implementation, the writing intention prediction module is used to perform prediction processing on the preprocessed foreign language sentence to obtain the writing intention corresponding to the preprocessed foreign language sentence, specifically including:
[0048] Performing semantic parsing on the preprocessed foreign language sentence to obtain a foreign language semantic parsing text corresponding to the preprocessed foreign language sentence, and performing feature extraction on the preprocessed foreign language sentence to obtain a sentence pattern feature corresponding to the preprocessed foreign language sentence;
[0049] Based on the sentence pattern features and the foreign language semantic analysis text, a writing intention corresponding to the preprocessed foreign language sentence is obtained.
[0050] In a possible implementation, the recommended foreign language sentence output module is used to combine the writing intention and the preprocessed foreign language sentence to generate a foreign language sentence combination, input the foreign language sentence combination into a pre-built content recommendation model, and output a recommended foreign language sentence, specifically including:
[0051] Using the writing intention as a key name and the preprocessed foreign language sentence as a key value, performing concatenation processing on the key name and the key value to generate a foreign language sentence combination;
[0052] The foreign language sentence combination is input into a pre-built content recommendation model, so that the content recommendation model obtains a plurality of similar foreign language sentences from a standard foreign language sentence library based on the key value in the foreign language sentence combination, and screens the plurality of similar foreign language sentences based on the key name in the foreign language sentence combination, and outputs a recommended foreign language sentence.
[0053] In a possible implementation, the error-correcting foreign language text generating module is used to generate the error-correcting foreign language text based on the recommended foreign language sentence, specifically including:
[0054] A target foreign language sentence corresponding to the recommended foreign language sentence in the foreign language text is obtained, the target foreign language sentence is updated to the recommended foreign language sentence, and the recommended foreign language sentence is subjected to differential processing to generate an error-corrected foreign language text.
[0055] The present application also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for automatic error correction of foreign language writing as described in any one of the above items is implemented.
[0056] The present application also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned methods for automatic error correction of foreign language writing.
[0057] The embodiment of the present application provides a method and system for automatic error correction of foreign language writing, which has the following beneficial effects compared with the prior art:
[0058] By dividing the foreign language text into multiple foreign language sentences, performing word segmentation and part-of-speech tagging, the structure and meaning of the foreign language text can be more accurately identified and understood, which helps to discover and correct grammatical and spelling errors and improve the accuracy and fluency of the foreign language text; subsequently, the pre-trained foreign language writing automatic error correction model can be used to automatically detect whether there are errors in the pre-processed foreign language sentences without human intervention, thereby improving the accuracy of error correction; when it is detected that the pre-processed foreign language sentence is inconsistent with the standard foreign language sentence, the pre-processed foreign language sentence and the writing intention are input into the content recommendation model, and relevant recommended foreign language sentences can be generated by inferring the user's writing intention; this helps to provide more appropriate suggestions or improvements based on the user's specific needs, thereby improving the accuracy and flexibility of error correction; finally, the generated corrected foreign language text is displayed to the user, so that the user can intuitively see the improvement suggestions for the text; this feedback mechanism can help users learn and improve their foreign language writing skills. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 It is a flowchart of an embodiment of a foreign language writing automatic error correction method provided by the present application;
[0060] Figure 2 It is a structural schematic diagram of an embodiment of a foreign language writing automatic error correction system provided by the present application;
[0061] Figure 3 It is a structural schematic diagram of a terminal device provided by the present invention. DETAILED DESCRIPTION
[0062] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0063] Example 1, see Figure 1 , Figure 1 : is a flow chart of an embodiment of a foreign language writing automatic error correction method provided by the present application, such as Figure 1 As shown, the method includes steps 101 to 105, which are specifically as follows:
[0064] Step 101: obtaining a foreign language text input by a user on a target interface, and segmenting the foreign language text to obtain a plurality of foreign language sentences.
[0065] In one embodiment, the foreign language writing automatic error correction method can be applied to intelligent terminal devices, including but not limited to smart phones, laptops, tablet computers, desktop computers, and physical servers and cloud servers connected to display units.
[0066] In one embodiment, the target interface is generated by front-end initialization and is used to display an input interaction interface of the foreign language writing automatic error correction method.
[0067] In one embodiment, by detecting a target area in a target interface, when a trigger operation is detected in the target area, a foreign language text input by a user in the target area is obtained.
[0068] Specifically, the target area includes but is not limited to the send button set in the target interface; the trigger operation includes but is not limited to operations such as mouse clicks or gesture touches; taking mouse clicks as an example, when it is detected that the mouse arrow hovers over the send button and a click event occurs on the mouse arrow, it is determined that a trigger event occurs in the target area.
[0069] In one embodiment, after obtaining the foreign language text input by the user in the target interface, the data format of the foreign language text is detected, wherein the data format includes but is not limited to text format and image format.
[0070] In one embodiment, when the data format of the foreign language text is a text format, a start segmentation tag is set at the first character of the foreign language text, and target character detection is performed on the foreign language text. When the target character is detected and there is a character after the target character, an end segmentation tag is set on the left side of the target character, and a start segmentation tag is set on the right side of the target character. When the target character is detected and there is no character after the target character, an end segmentation tag is set on the left side of the target character. Based on the start segmentation tag and the end segmentation tag on the right side of the start segmentation tag, the foreign language text is segmented to obtain multiple foreign language sentences.
[0071] Specifically, the target characters include but are not limited to terminators and semicolons.
[0072] Preferably, when the data format of the foreign language text is an image format, text recognition is performed on the foreign language text based on a pixel-level text recognition algorithm, so as to convert the foreign language text in image format into foreign language text in text format.
[0073] Step 102: performing word segmentation processing on the plurality of foreign language sentences respectively to obtain a plurality of foreign language words and the parts of speech corresponding to the plurality of foreign language words respectively, and generating preprocessed foreign language sentences.
[0074] In one embodiment, word segmentation is performed on the plurality of foreign language sentences respectively to obtain a plurality of foreign language words corresponding to the plurality of foreign language sentences.
[0075] Specifically, word segmentation processing is performed on the multiple foreign language sentences respectively based on a word segmentation tool, wherein the word segmentation tool includes but is not limited to NLTK, spaCy, Gensim, etc.
[0076] Specifically, before performing word segmentation processing, the multiple foreign language sentences are first subjected to text preprocessing, wherein the text preprocessing includes but is not limited to removing redundant spaces and special symbols, etc., and the preprocessed foreign language sentences are subjected to word segmentation processing based on a word segmentation tool to obtain multiple foreign language words corresponding to each of the multiple foreign language sentences.
[0077] In one embodiment, word2vec technology is used to perform word vector processing on the multiple foreign language words respectively to obtain foreign language word vectors corresponding to the multiple foreign language words.
[0078] Specifically, Word2vec technology uses deep learning to map each foreign language word into a K-dimensional real feature vector through training.
[0079] Specifically, a matrix decomposition model is constructed by Word2vec, the matrix decomposition model is trained, and each foreign word in the foreign word set obtained by integrating the multiple foreign words is input into the trained matrix decomposition model to obtain a K-dimensional word vector corresponding to each foreign word.
[0080] Among them, the training process of the matrix decomposition model first pre-processes the foreign language vocabulary set, including removing stop words and screening according to word frequency to exclude high-frequency and low-frequency words; then, construct a Huffman tree, which is a tree data structure based on word frequency, whose leaf nodes represent each foreign language word in the foreign language vocabulary set, and non-leaf nodes store parameter vectors, which are set to zero at initialization; then, assign a Huffman code to each foreign language word, which is generated based on the Huffman tree structure; the foreign language vocabulary vector corresponding to each foreign language word is randomly initialized before the model training starts; these foreign language vocabulary vectors are trained by using CBOW (Continuous Bag of Words) or Skip-gram model; during the training process, the model will continuously adjust the foreign language vocabulary vector and the parameter vector in the Huffman tree to minimize the prediction error. Finally, each foreign language word will be mapped to a K-dimensional foreign language vocabulary vector, which can reflect the semantic information of the foreign language word, and similar foreign language words are closer in the vector space.
[0081] In one embodiment, similarity matching is performed on the foreign language vocabulary vector and the foreign language vocabulary configuration table to obtain a matching foreign language vocabulary vector corresponding to the foreign language vocabulary vector, and the part of speech corresponding to the matching foreign language vocabulary vector is used as a label of the foreign language vocabulary corresponding to the foreign language vocabulary vector.
[0082] Specifically, the standard vocabulary vectors corresponding to all foreign language words in the foreign language vocabulary configuration table are obtained, and the vocabulary vectors are respectively matched with the standard vocabulary vectors for similarity to obtain the matching foreign language vocabulary vectors corresponding to the vocabulary vectors; the part of speech corresponding to the matching foreign language vocabulary vector is obtained based on the foreign language vocabulary configuration table, and the part of speech is used as the label of the foreign language vocabulary corresponding to the foreign language vocabulary vector to obtain the labels corresponding to the multiple foreign language words.
[0083] Specifically, when the vocabulary vector is matched with the standard vocabulary vector respectively for similarity, the distance between the vocabulary vector and each standard vocabulary vector in the foreign language vocabulary configuration table is calculated respectively, and the standard vocabulary vector corresponding to the minimum distance and the target foreign language vocabulary in the foreign language vocabulary configuration table corresponding to the standard vocabulary vector are obtained, and the target foreign language vocabulary is used as the matching foreign language vocabulary vector corresponding to the vocabulary vector.
[0084] Preferably, when the vocabulary vectors are matched with the standard vocabulary vectors respectively for similarity, the Word Embedding model in natural language processing technology can also be used to calculate the similarity between word vectors.
[0085] Specifically, the foreign language vocabulary configuration table also includes the parts of speech corresponding to all foreign language vocabulary. After determining the matching foreign language vocabulary vector corresponding to the vocabulary vector, the part of speech of the foreign language vocabulary corresponding to the matching foreign language vocabulary vector is used as the label of the foreign language vocabulary corresponding to the foreign language vocabulary vector.
[0086] Preferably, the parts of speech include but are not limited to nouns, adverbs, adjectives, verbs, word combinations, pronouns, numerals, quantifiers, prepositions, conjunctions, articles, auxiliary words, interjections and onomatopoeia.
[0087] In one embodiment, the plurality of foreign language words and the labels corresponding to the plurality of foreign language words are integrated to generate a preprocessed foreign language sentence.
[0088] Step 103: calling a pre-trained foreign language writing automatic error correction model, comparing the pre-processed foreign language sentence with a standard foreign language sentence, and when the pre-processed foreign language sentence and the standard foreign language sentence do not meet a consistency condition, performing a prediction process on the pre-processed foreign language sentence to obtain a writing intention corresponding to the pre-processed foreign language sentence.
[0089] In one embodiment, a pre-trained foreign language writing automatic error correction model is called to construct a grammatical parse tree corresponding to the pre-processed foreign language sentence, and to construct a standard grammatical parse tree corresponding to the standard foreign language sentence; based on the standard grammatical parse tree, it is determined whether the grammatical parse tree corresponding to the pre-processed foreign language sentence conforms to the grammatical rule; if so, it is determined that the pre-processed foreign language sentence and the standard foreign language sentence satisfy a consistency condition; otherwise, it is determined that the pre-processed foreign language sentence and the standard foreign language sentence do not satisfy the consistency condition.
[0090] Specifically, the standard foreign language sentences are standard foreign language sentences pre-stored in the foreign language writing automatic error correction model, wherein the number of the standard foreign language sentences is multiple.
[0091] Specifically, when constructing a grammatical parse tree, the part of speech corresponding to each foreign language vocabulary in the preprocessed foreign language sentence is obtained based on the foreign language writing automatic error correction model, and the dependency relationship between foreign language vocabulary is determined based on the part of speech of each foreign language vocabulary and the preset dependency syntactic annotation relationship, and according to the dependency relationship, each foreign language vocabulary in the preprocessed foreign language sentence is assembled to obtain a grammatical parse tree.
[0092] Specifically, the preset dependency syntax annotation relationships include subject-predicate relationship, verb-object relationship, intermezzo-object relationship, preposed object, auxiliary modifier, attributive-predicate relationship, adverbial-predicate structure, verb-complement structure, parallel relationship, preposition-object relationship, left-attachment relationship, right-attachment relationship, independent relationship and core relationship.
[0093] Specifically, according to the dependency relationship, each foreign language vocabulary in the preprocessed foreign language sentence is assembled to obtain a grammatical parse tree. Based on the dependency relationship, the main node words and branch node words of the grammatical parse tree are determined, and the grammatical parse tree is constructed based on the main node words and the branch node words.
[0094] Preferably, based on the dependency relationship, the first foreign language vocabulary corresponding to the subject, predicate and object in the preprocessed foreign language sentence is determined, and the first foreign language vocabulary corresponding to the subject, the predicate and the object is used as the trunk node word of the grammatical parse tree.
[0095] Preferably, dependency relationships corresponding to the first foreign language vocabulary corresponding to the subject, the predicate and the object are obtained respectively, a second foreign language vocabulary having a dependency relationship with the first foreign language vocabulary is determined, and the second foreign language vocabulary is used as a node word of the first foreign language vocabulary.
[0096] In one embodiment, the process of constructing the standard grammar parse tree corresponding to the standard foreign language sentence is the same as the process of constructing the grammar parse tree corresponding to the preprocessed foreign language sentence.
[0097] In one embodiment, by comparing the grammatical parse tree corresponding to the preprocessed foreign language sentence with the standard grammatical parse tree corresponding to each standard sentence, it is determined whether there is a standard grammatical parse tree corresponding to the standard foreign language sentence that is consistent with the grammatical parse tree corresponding to the preprocessed foreign language sentence. If so, it means that the preprocessed foreign language sentence complies with the grammatical rules, and it is determined that the preprocessed foreign language sentence and the standard foreign language sentence meet the consistency condition.
[0098] The following examples illustrate the construction of a grammar parse tree: a standard sentence: "The cat sits on the mat.", a preprocessed foreign language vocabulary sentence: "The cat on the mat sits.", where The cat is NP, sits is VB, and on the mat is PP.
[0099] Among them, the grammatical parse tree of the standard foreign language sentence is as follows:
[0100] ;
[0101] The grammatical parse tree of the preprocessed foreign language sentence is as follows:
[0102] ;
[0103] Comparing the two grammatical parse trees, although the vocabulary is the same, in the grammatical parse tree of the standard foreign language sentence, the verb "sits" correctly appears after the subject "The cat"; in the grammatical parse tree of the preprocessed foreign language sentence, the verb "sits" is incorrectly placed after the prepositional phrase "on the mat".
[0104] In one embodiment, when the preprocessed foreign language sentence is predictively processed to obtain the writing intention corresponding to the preprocessed foreign language sentence, the preprocessed foreign language sentence is semantically parsed to obtain the foreign language semantic parsed text corresponding to the preprocessed foreign language sentence, and feature extraction is performed on the preprocessed foreign language sentence to obtain the sentence pattern features corresponding to the preprocessed foreign language sentence; based on the sentence pattern features and the foreign language semantic parsed text, the writing intention corresponding to the preprocessed foreign language sentence is obtained.
[0105] Specifically, when the semantic analysis processing is performed on the preprocessed foreign language sentence, the preprocessed foreign language sentence is translated to obtain a Chinese sentence, and the Chinese sentence is used as the foreign language semantic analysis text corresponding to the preprocessed foreign language sentence.
[0106] Specifically, when performing feature extraction on the preprocessed foreign language sentence, the sentence structure corresponding to the preprocessed foreign language sentence is identified based on a natural language processing library, and based on the sentence structure, the sentence type corresponding to the preprocessed foreign language sentence is determined, and the sentence type is used as the sentence pattern feature corresponding to the preprocessed foreign language sentence.
[0107] Preferably, the sentence types include but are not limited to simple sentences, parallel sentences, compound sentences, compound parallel sentences, interrogative sentences, affirmative sentences, negative sentences, exclamatory sentences, imperative sentences, conditional sentences, subjunctive sentences, inverted sentences, passive sentences, elliptical sentences, appositive sentences and emphasized sentences.
[0108] Specifically, when the writing intention corresponding to the preprocessed foreign language sentence is obtained based on the sentence pattern features and the foreign language semantic analysis text, the sentence pattern features and the foreign language semantic analysis text are directly used as the writing intention corresponding to the preprocessed foreign language sentence.
[0109] Step 104: Combine the writing intention and the preprocessed foreign language sentence to generate a foreign language sentence combination, input the foreign language sentence combination into a pre-built content recommendation model, and output a recommended foreign language sentence.
[0110] In one embodiment, the writing intention is used as a key name, and the preprocessed foreign language sentence is used as a key value, and the key name and the key value are concatenated to generate a foreign language sentence combination.
[0111] Specifically, when the writing intention is used as the key name, the sentence features in the writing intention are also used as the first splicing characters, and the foreign language semantic analysis text is used as the second splicing characters. The first splicing characters and the second splicing characters are connected to obtain the key name of the writing intention.
[0112] In one embodiment, the foreign language sentence combination is input into a pre-built content recommendation model, so that the content recommendation model obtains a plurality of similar foreign language sentences from a standard foreign language sentence library based on the key value in the foreign language sentence combination, and screens the plurality of similar foreign language sentences based on the key name in the foreign language sentence combination, and outputs a recommended foreign language sentence.
[0113] Specifically, the content recommendation model is connected to the standard foreign language sentence library. When the content recommendation model receives the foreign language sentence combination, it obtains all standard foreign language sentences in the standard foreign language sentence library, and calculates the similarity between the key value in the foreign language sentence combination and all the standard foreign language sentences. When the similarity is not less than a preset similarity threshold, a plurality of similar foreign language sentences are determined.
[0114] Specifically, the similarity calculation formula is as follows:
[0115] ;
[0116] In the formula, is the similarity, is the probability distribution function of the foreign word k appearing in the preprocessed foreign language sentence, is the probability distribution function of the foreign word k appearing in the standard foreign language sentence, z is the total number of phrases in the preprocessed foreign language sentence, and Z is the total number of phrases in the standard foreign language sentence.
[0117] Specifically, when the multiple similar foreign language sentences are screened based on the key name in the foreign language sentence combination, the multiple similar foreign language sentences are screened once based on the first concatenated characters in the key name to obtain a first screened similar foreign language sentence set, and the first screened similar foreign language sentence set is screened twice based on the second concatenated characters in the key name to obtain a second screened similar foreign language sentence set; when the number of the second screened similar foreign language sentence sets is 1, the second screened similar foreign language sentence set is directly used as the recommended foreign language sentences; when the number of the second screened similar foreign language sentence sets is not 1, the similarity corresponding to each similar foreign language sentence in the second screened similar foreign language sentence set is obtained respectively, and the recommended foreign language sentence is determined based on the highest similarity value.
[0118] Specifically, based on the first concatenated character in the key name, when the multiple similar foreign language sentences are screened once, similar foreign language sentences having the same sentence pattern features as those corresponding to the preprocessed foreign language sentence are screened out from the multiple similar foreign language sentences and are used as the first screened similar foreign language sentence set.
[0119] Specifically, based on the second concatenated characters in the key name, when the first screened similar foreign language sentence set is screened for the second time, similar foreign language sentences that are identical to the foreign language semantic analysis text corresponding to the preprocessed foreign language sentence are screened out from the first screened similar foreign language sentence set and used as the second screened similar foreign language sentence set.
[0120] Step 105: Generate a corrected foreign language text based on the recommended foreign language sentence, and display the corrected foreign language text to the user based on the target interface.
[0121] In one embodiment, a target foreign language sentence corresponding to the recommended foreign language sentence in the foreign language text is obtained, the target foreign language sentence is updated to the recommended foreign language sentence, and the recommended foreign language sentence is differentiated to generate an error-corrected foreign language text.
[0122] Specifically, the recommended foreign language sentences are differentiated and processed, and when generating the corrected foreign language text, the recommended foreign language sentences are highlighted to obtain highlighted recommended foreign language sentences, and the preprocessed foreign language sentences are used as the original labels corresponding to the highlighted recommended foreign language sentences, and the highlighted recommended foreign language sentences and their corresponding original labels are integrated to generate the corrected foreign language text.
[0123] In one embodiment, after obtaining the corrected foreign language text, the corrected foreign language text is directly displayed to the user on the target interface, and when displaying the corrected foreign language text, the display instructions triggered by the user are detected in real time, wherein the display instructions include original foreign language text display instructions, corrected foreign language text display instructions, and dual foreign language text display instructions.
[0124] In one embodiment, when it is detected that the display instruction is an original foreign language text display instruction, the foreign language text input by the user is retrieved, and the error correction foreign language text displayed on the current target interface is converted into the foreign language text input by the user; when it is detected that the display instruction is an error correction foreign language text display instruction, the current target display interface is not adjusted; when it is detected that the display instruction is a dual foreign language text display instruction, the foreign language text input by the user is retrieved, and the error correction foreign language text and the foreign language text input by the user are simultaneously displayed on the current target interface.
[0125] Example 2, see Figure 2 , Figure 2 is a structural diagram of an embodiment of a foreign language writing automatic error correction system provided by the present application, such as Figure 2 As shown, the device includes a foreign language text segmentation module 201, a word segmentation module 202, a writing intention prediction module 203, a recommended foreign language sentence output module 204 and an error correction foreign language text generation module 205, which are specifically as follows:
[0126] The foreign language text segmentation module 201 is used to obtain a foreign language text input by a user in a target interface, and segment the foreign language text to obtain a plurality of foreign language sentences.
[0127] The word segmentation module 202 is used to perform word segmentation processing on the multiple foreign language sentences respectively, obtain multiple foreign language words and the parts of speech corresponding to the multiple foreign language words, and generate preprocessed foreign language sentences.
[0128] The writing intention prediction module 203 is used to call a pre-trained foreign language writing automatic error correction model, compare the pre-processed foreign language sentence with the standard foreign language sentence, and when the pre-processed foreign language sentence and the standard foreign language sentence do not meet the consistency condition, perform prediction processing on the pre-processed foreign language sentence to obtain the writing intention corresponding to the pre-processed foreign language sentence.
[0129] The recommended foreign language sentence output module 204 is used to combine the writing intention and the preprocessed foreign language sentence to generate a foreign language sentence combination, input the foreign language sentence combination into a pre-built content recommendation model, and output a recommended foreign language sentence.
[0130] The error-correcting foreign language text generating module 205 is used to generate an error-correcting foreign language text based on the recommended foreign language sentence, and to display the error-correcting foreign language text to the user based on the target interface.
[0131] In one embodiment, the word segmentation module 202 is used to perform word segmentation processing on the multiple foreign language sentences respectively, obtain multiple foreign language words, and the parts of speech corresponding to the multiple foreign language words, and generate preprocessed foreign language sentences, specifically including: performing word segmentation processing on the multiple foreign language sentences respectively, to obtain multiple foreign language words corresponding to the multiple foreign language sentences; using word2vec technology to perform word vector processing on the multiple foreign language words respectively, to obtain foreign language word vectors corresponding to the multiple foreign language words; performing similarity matching processing on the foreign language word vectors and the foreign language word configuration table, to obtain matching foreign language word vectors corresponding to the foreign language word vectors, and using the parts of speech corresponding to the matching foreign language word vectors as labels of the foreign language words corresponding to the foreign language word vectors; integrating the multiple foreign language words and the labels corresponding to the multiple foreign language words to generate preprocessed foreign language sentences.
[0132] In one embodiment, the word segmentation module 202 is used to perform similarity matching processing on the foreign language vocabulary vector and the foreign language vocabulary configuration table to obtain a matching foreign language vocabulary vector corresponding to the foreign language vocabulary vector, and use the part of speech corresponding to the matching foreign language vocabulary vector as a label of the foreign language vocabulary corresponding to the foreign language vocabulary vector, specifically including: obtaining the standard vocabulary vectors corresponding to all foreign language words in the foreign language vocabulary configuration table, performing similarity matching on the vocabulary vectors and the standard vocabulary vectors respectively, to obtain a matching foreign language vocabulary vector corresponding to the vocabulary vector; obtaining the part of speech corresponding to the matching foreign language vocabulary vector based on the foreign language vocabulary configuration table, and using the part of speech as a label of the foreign language vocabulary corresponding to the foreign language vocabulary vector, to obtain labels corresponding to each of the multiple foreign language words.
[0133] In one embodiment, the writing intention prediction module 203 is used to call a pre-trained foreign language writing automatic error correction model to compare the pre-processed foreign language sentence with a standard foreign language sentence, specifically including: calling a pre-trained foreign language writing automatic error correction model to construct a grammatical parse tree corresponding to the pre-processed foreign language sentence, and constructing a standard grammatical parse tree corresponding to the standard foreign language sentence; based on the standard grammatical parse tree, determining whether the grammatical parse tree corresponding to the pre-processed foreign language sentence conforms to the grammatical rule, if so, determining that the pre-processed foreign language sentence and the standard foreign language sentence meet the consistency condition, otherwise, determining that the pre-processed foreign language sentence and the standard foreign language sentence do not meet the consistency condition.
[0134] In one embodiment, the writing intention prediction module 203 is used to perform predictive processing on the preprocessed foreign language sentence to obtain the writing intention corresponding to the preprocessed foreign language sentence, specifically including: performing semantic analysis processing on the preprocessed foreign language sentence to obtain a foreign language semantic analysis text corresponding to the preprocessed foreign language sentence, and performing feature extraction on the preprocessed foreign language sentence to obtain a sentence pattern feature corresponding to the preprocessed foreign language sentence; based on the sentence pattern feature and the foreign language semantic analysis text, obtaining the writing intention corresponding to the preprocessed foreign language sentence.
[0135] In one embodiment, the recommended foreign language sentence output module 204 is used to combine the writing intention and the preprocessed foreign language sentence to generate a foreign language sentence combination, input the foreign language sentence combination into a pre-built content recommendation model, and output a recommended foreign language sentence, specifically comprising: taking the writing intention as a key name and the pre-processed foreign language sentence as a key value, concatenating the key name and the key value to generate a foreign language sentence combination; inputting the foreign language sentence combination into the pre-built content recommendation model so that the content recommendation model obtains a plurality of similar foreign language sentences from a standard foreign language sentence library based on the key value in the foreign language sentence combination, and screening the plurality of similar foreign language sentences based on the key name in the foreign language sentence combination to output a recommended foreign language sentence.
[0136] In one embodiment, the error-correcting foreign language text generation module 205 is used to generate an error-correcting foreign language text based on the recommended foreign language sentence, specifically including: obtaining a target foreign language sentence corresponding to the recommended foreign language sentence in the foreign language text, updating the target foreign language sentence to the recommended foreign language sentence, and performing differential processing on the recommended foreign language sentence to generate an error-correcting foreign language text.
[0137] The above-mentioned foreign language writing automatic error correction system can implement the foreign language writing automatic error correction method of the above-mentioned method embodiment. The options in the above-mentioned method embodiment are also applicable to this embodiment and will not be described in detail here.
[0138] Figure 3A schematic diagram of the structure of a terminal device. Figure 3 As shown, the terminal device 3 of this embodiment includes: at least one processor 301 ( Figure 3 Only one is shown in the figure) a processor, a memory 302, and a computer program 303 stored in the memory 302 and executable on at least one processor 301, and when the processor 301 executes the computer program 303, the steps in any of the above method embodiments are implemented.
[0139] The terminal device 3 may be a computing device such as a smart phone, a laptop, a tablet computer, and a desktop computer. The terminal device may include but is not limited to a processor 301 and a memory 302. Those skilled in the art will appreciate that Figure 3 It is only an example of the terminal device 3 and does not constitute a limitation on the terminal device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0140] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0141] In some embodiments, the memory 302 may be an internal storage unit of the terminal device 3, such as a hard disk or memory of the terminal device 3. In other embodiments, the memory 302 may also be an external storage device of the terminal device 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 3. Further, the memory 302 may also include both an internal storage unit and an external storage device of the terminal device 3. The memory 302 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of a computer program, etc. The memory 302 may also be used to temporarily store data that has been output or is to be output.
[0142] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0143] In several embodiments provided in the present application, it is understood that each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code includes one or more executable instructions for realizing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved.
[0144] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially or in other words, the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for a terminal device to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0145] In summary, the present application provides a method and system for automatic error correction in foreign language writing, which obtains multiple foreign language sentences by segmenting a foreign language text; performs word segmentation on the multiple foreign language sentences respectively to obtain multiple foreign language words and the parts of speech corresponding to the multiple foreign language words, and generates a preprocessed foreign language sentence; calls a foreign language writing automatic error correction model to compare the preprocessed foreign language sentence with a standard foreign language sentence, and when the preprocessed foreign language sentence and the standard foreign language sentence do not meet the consistency condition, performs prediction processing on the preprocessed foreign language sentence to obtain the writing intention; combines the writing intention and the preprocessed foreign language sentence, inputs the generated foreign language sentence combination into a content recommendation model, and outputs a recommended foreign language sentence; generates a corrected foreign language text based on the recommended foreign language sentence, and displays the corrected foreign language text to the user based on a target interface; compared with the prior art, the technical solution of the present application realizes automatic error correction of sentence errors in foreign language writing.
[0146] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and substitutions can be made without departing from the technical principles of the present application. These improvements and substitutions should also be regarded as the scope of protection of the present application.
Claims
1. A method for automatic error correction in foreign language writing, characterized in that: include: Acquire a foreign language text input by a user on a target interface, and segment the foreign language text to obtain a plurality of foreign language sentences; Performing word segmentation processing on the plurality of foreign language sentences respectively to obtain a plurality of foreign language words and parts of speech corresponding to the plurality of foreign language words, and generating preprocessed foreign language sentences; calling a pre-trained foreign language writing automatic error correction model, comparing the pre-processed foreign language sentence with a standard foreign language sentence, and when the pre-processed foreign language sentence and the standard foreign language sentence do not meet a consistency condition, performing a prediction process on the pre-processed foreign language sentence to obtain a writing intention corresponding to the pre-processed foreign language sentence; Combining the writing intention and the preprocessed foreign language sentence to generate a foreign language sentence combination, inputting the foreign language sentence combination into a pre-built content recommendation model, and outputting a recommended foreign language sentence; generating a correction foreign language text based on the recommended foreign language sentence, and displaying the correction foreign language text to the user based on the target interface; Calling a pre-trained foreign language writing automatic error correction model and comparing the pre-processed foreign language sentence with a standard foreign language sentence, specifically including: Calling a pre-trained foreign language writing automatic error correction model to construct a grammatical parse tree corresponding to the pre-processed foreign language sentence, and constructing a standard grammatical parse tree corresponding to the standard foreign language sentence; Based on the standard grammar parse tree, determine whether the grammar parse tree corresponding to the preprocessed foreign language sentence conforms to the grammar rule; if so, determine that the preprocessed foreign language sentence and the standard foreign language sentence meet the consistency condition; otherwise, determine that the preprocessed foreign language sentence and the standard foreign language sentence do not meet the consistency condition; Performing predictive processing on the preprocessed foreign language sentence to obtain a writing intention corresponding to the preprocessed foreign language sentence specifically includes: Performing semantic parsing on the preprocessed foreign language sentence to obtain a foreign language semantic parsing text corresponding to the preprocessed foreign language sentence, and performing feature extraction on the preprocessed foreign language sentence to obtain a sentence pattern feature corresponding to the preprocessed foreign language sentence; Based on the sentence pattern features and the foreign language semantic analysis text, obtaining the writing intention corresponding to the preprocessed foreign language sentence; Combining the writing intention and the preprocessed foreign language sentence to generate a foreign language sentence combination, inputting the foreign language sentence combination into a pre-built content recommendation model, and outputting a recommended foreign language sentence, specifically includes: Using the writing intention as a key name and the preprocessed foreign language sentence as a key value, performing concatenation processing on the key name and the key value to generate a foreign language sentence combination; The foreign language sentence combination is input into a pre-built content recommendation model, so that the content recommendation model obtains a plurality of similar foreign language sentences from a standard foreign language sentence library based on the key value in the foreign language sentence combination, and screens the plurality of similar foreign language sentences based on the key name in the foreign language sentence combination, and outputs a recommended foreign language sentence.
2. The method for automatic error correction of foreign language writing as claimed in claim 1, characterized in that: Performing word segmentation processing on the plurality of foreign language sentences respectively to obtain a plurality of foreign language words and parts of speech corresponding to the plurality of foreign language words, and generating preprocessed foreign language sentences, specifically includes: Performing word segmentation processing on the plurality of foreign language sentences respectively to obtain a plurality of foreign language words corresponding to the plurality of foreign language sentences; Using word2vec technology to perform word vector processing on the multiple foreign language words respectively, to obtain foreign language word vectors corresponding to the multiple foreign language words respectively; Performing similarity matching processing on the foreign language vocabulary vector and the foreign language vocabulary configuration table to obtain a matching foreign language vocabulary vector corresponding to the foreign language vocabulary vector, and using the part of speech corresponding to the matching foreign language vocabulary vector as a label of the foreign language vocabulary corresponding to the foreign language vocabulary vector; The plurality of foreign language words and the labels corresponding to the plurality of foreign language words are integrated to generate a preprocessed foreign language sentence.
3. A foreign language writing automatic error correction method as claimed in claim 2, characterized in that: Performing similarity matching processing on the foreign language vocabulary vector and the foreign language vocabulary configuration table to obtain a matching foreign language vocabulary vector corresponding to the foreign language vocabulary vector, and using the part of speech corresponding to the matching foreign language vocabulary vector as a label of the foreign language vocabulary corresponding to the foreign language vocabulary vector, specifically includes: Obtaining standard vocabulary vectors corresponding to all foreign language words in the foreign language vocabulary configuration table, performing similarity matching between the vocabulary vectors and the standard vocabulary vectors, and obtaining matching foreign language vocabulary vectors corresponding to the vocabulary vectors; The part of speech corresponding to the matching foreign language vocabulary vector is obtained based on the foreign language vocabulary configuration table, and the part of speech is used as a label of the foreign language vocabulary corresponding to the foreign language vocabulary vector to obtain labels corresponding to each of the multiple foreign language vocabulary.
4. The method for automatic error correction of foreign language writing as claimed in claim 1, characterized in that: Generating a corrected foreign language text based on the recommended foreign language sentence specifically includes: A target foreign language sentence corresponding to the recommended foreign language sentence in the foreign language text is obtained, the target foreign language sentence is updated to the recommended foreign language sentence, and the recommended foreign language sentence is subjected to differential processing to generate an error-corrected foreign language text.
5. A foreign language writing automatic error correction system, characterized in that: include: Foreign language text segmentation module, word segmentation module, writing intention prediction module, foreign language sentence recommendation output module and error correction foreign language text generation module; The foreign language text segmentation module is used to obtain the foreign language text input by the user on the target interface, and segment the foreign language text to obtain a plurality of foreign language sentences; The word segmentation module is used to perform word segmentation processing on the multiple foreign language sentences respectively, obtain multiple foreign language words and the parts of speech corresponding to the multiple foreign language words, and generate preprocessed foreign language sentences; The writing intention prediction module is used to call the pre-trained foreign language writing automatic error correction model, compare the pre-processed foreign language sentence with the standard foreign language sentence, and when the pre-processed foreign language sentence and the standard foreign language sentence do not meet the consistency condition, perform prediction processing on the pre-processed foreign language sentence to obtain the writing intention corresponding to the pre-processed foreign language sentence; The recommended foreign language sentence output module is used to combine the writing intention and the preprocessed foreign language sentence to generate a foreign language sentence combination, input the foreign language sentence combination into a pre-built content recommendation model, and output a recommended foreign language sentence; The error correction foreign language text generation module is used to generate an error correction foreign language text based on the recommended foreign language sentence, and to display the error correction foreign language text to the user based on the target interface; The writing intention prediction module is used to call the pre-trained foreign language writing automatic error correction model to compare the pre-processed foreign language sentence with the standard foreign language sentence, specifically including: calling the pre-trained foreign language writing automatic error correction model to construct a grammatical parse tree corresponding to the pre-processed foreign language sentence, and constructing a standard grammatical parse tree corresponding to the standard foreign language sentence; based on the standard grammatical parse tree, determining whether the grammatical parse tree corresponding to the pre-processed foreign language sentence conforms to the grammatical rule, if so, determining that the pre-processed foreign language sentence and the standard foreign language sentence meet the consistency condition, otherwise, determining that the pre-processed foreign language sentence and the standard foreign language sentence do not meet the consistency condition; The writing intention prediction module is used to perform prediction processing on the preprocessed foreign language sentence to obtain the writing intention corresponding to the preprocessed foreign language sentence, specifically comprising: performing semantic analysis processing on the preprocessed foreign language sentence to obtain the foreign language semantic analysis text corresponding to the preprocessed foreign language sentence, and performing feature extraction on the preprocessed foreign language sentence to obtain the sentence pattern features corresponding to the preprocessed foreign language sentence; based on the sentence pattern features and the foreign language semantic analysis text, obtaining the writing intention corresponding to the preprocessed foreign language sentence; The recommended foreign language sentence output module is used to combine the writing intention and the preprocessed foreign language sentence to generate a foreign language sentence combination, input the foreign language sentence combination into a pre-built content recommendation model, and output a recommended foreign language sentence, specifically comprising: taking the writing intention as a key name and the pre-processed foreign language sentence as a key value, concatenating the key name and the key value to generate a foreign language sentence combination; inputting the foreign language sentence combination into the pre-built content recommendation model, so that the content recommendation model obtains a plurality of similar foreign language sentences from a standard foreign language sentence library based on the key value in the foreign language sentence combination, and screening the plurality of similar foreign language sentences based on the key name in the foreign language sentence combination, and outputting a recommended foreign language sentence.
6. A foreign language writing automatic error correction system as claimed in claim 5, characterized in that: The word segmentation module is used to perform word segmentation processing on the multiple foreign language sentences respectively, obtain multiple foreign language words and the parts of speech corresponding to the multiple foreign language words, and generate preprocessed foreign language sentences, specifically including: Performing word segmentation processing on the plurality of foreign language sentences respectively to obtain a plurality of foreign language words corresponding to the plurality of foreign language sentences; Using word2vec technology to perform word vector processing on the multiple foreign language words respectively, to obtain foreign language word vectors corresponding to the multiple foreign language words respectively; Performing similarity matching processing on the foreign language vocabulary vector and the foreign language vocabulary configuration table to obtain a matching foreign language vocabulary vector corresponding to the foreign language vocabulary vector, and using the part of speech corresponding to the matching foreign language vocabulary vector as a label of the foreign language vocabulary corresponding to the foreign language vocabulary vector; The plurality of foreign language words and the labels corresponding to the plurality of foreign language words are integrated to generate a preprocessed foreign language sentence.
7. The automatic error correction system for foreign language writing as claimed in claim 6, characterized in that: The word segmentation module is used to perform similarity matching processing on the foreign language vocabulary vector and the foreign language vocabulary configuration table to obtain a matching foreign language vocabulary vector corresponding to the foreign language vocabulary vector, and use the part of speech corresponding to the matching foreign language vocabulary vector as a label of the foreign language vocabulary corresponding to the foreign language vocabulary vector, specifically including: Obtaining standard vocabulary vectors corresponding to all foreign language words in the foreign language vocabulary configuration table, performing similarity matching between the vocabulary vectors and the standard vocabulary vectors, and obtaining matching foreign language vocabulary vectors corresponding to the vocabulary vectors; The part of speech corresponding to the matching foreign language vocabulary vector is obtained based on the foreign language vocabulary configuration table, and the part of speech is used as a label of the foreign language vocabulary corresponding to the foreign language vocabulary vector to obtain labels corresponding to each of the multiple foreign language vocabulary.
