Composition correction method, apparatus and device, and readable storage medium

By combining spelling and grammatical error correction in the composition correction method, detailed error correction results and analysis are provided, which solves the problem that existing technology cannot correct grammatical errors and helps users improve their writing skills.

CN118798178APending Publication Date: 2024-10-18IFLYTEK CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310493101.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-04-11
Filing Date
2023-04-28
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing automatic essay correction technology can only correct simple spelling errors and cannot correct grammatical errors. As a result, users cannot learn how to correct grammatical errors, which limits the improvement of writing ability.

Method used

This paper proposes a composition correction method, including word correction and grammatical error correction. It generates error correction results and provides analysis to help users understand the reasons for error correction and improve their writing ability.

Benefits of technology

By correcting typos and grammatical errors, users can learn how to correct typos and grammatical errors, effectively improve their writing skills, and achieve in-depth improvement of their writing skills.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118798178A_ABST
    Figure CN118798178A_ABST
Patent Text Reader

Abstract

The invention discloses a composition correction method, device and equipment and a readable storage medium. In the scheme, the written character correction is performed on the to-be-corrected composition to generate the written character correction result of the to-be-corrected composition, the written character discrimination result is generated based on the written character correction result of the to-be-corrected composition, and the language disease correction is performed on the to-be-corrected composition to generate the language disease correction result of the to-be-corrected composition. As each written character error correction result of the to-be-corrected composition comprises wrongly written characters in the to-be-corrected composition and correct characters corresponding to the wrongly written characters, the written character discrimination result can indicate the difference between the wrongly written characters and the corresponding correct characters in the corresponding written character error correction result; each language disease error correction result of the to-be-corrected composition comprises the sentence with the language disease in the to-be-corrected composition and the correct sentence corresponding to the sentence with the language disease, and a user can learn how to modify the written character, can deeply understand the written character modification reason and can learn how to modify the language disease, so that the user experience is improved. According to the scheme, the writing ability of the user can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims the priority of a domestic patent application filed with the China Patent Office on April 11, 2023, with application number "202310406595.X", and invention name "Composition Correction Method, Device, Equipment and Readable Storage Medium", all contents of which are incorporated by reference in this application. Technical Field

[0002] The present application relates to the field of artificial intelligence technology, and more specifically, to a composition marking method, device, equipment and readable storage medium. Background Art

[0003] Writing is an indispensable practical skill in people's daily life and study. It is also a basic and important ability that students should possess in school education. Therefore, essay correction (such as Chinese essay correction, etc.) is particularly important for improving people's writing ability.

[0004] With the development of artificial intelligence technology, artificial intelligence has gradually penetrated into the field of education and applied in educational scenarios such as teaching and assessment, promoting the education industry to achieve a leapfrog transformation from the traditional education model to intelligent education. Intelligent education products (such as learning machines, applications, etc.) have also sprung up like mushrooms after rain, increasing year by year, and the effect has improved year by year. The technology of automatically correcting essays through artificial intelligence technology has also emerged. However, the current technology of automatically correcting essays through artificial intelligence technology can only perform simple spelling corrections. For some grammatical errors, it can only point out but cannot correct them, making it impossible for users to learn how to correct grammatical errors, resulting in limited improvement in users' writing ability.

[0005] Therefore, how to provide a composition correction method to help users effectively improve their writing skills has become a technical problem that needs to be urgently solved by technical personnel in this field. Summary of the invention

[0006] In view of the above problems, this application proposes a composition correction method, device, equipment and readable storage medium. The specific scheme is as follows:

[0007] A composition correction method, the method comprising:

[0008] Get the user's essay to be corrected;

[0009] Performing wrong character correction on the composition to be corrected, and generating wrong character correction results for the composition to be corrected; each wrong character correction result of the composition to be corrected includes the wrong character in the composition to be corrected, and the correct character corresponding to the wrong character;

[0010] Based on the wrong character correction result of the composition to be corrected, generating wrong character identification results, each wrong character identification result is used to indicate the difference between the wrong character and the corresponding correct character in the corresponding wrong character correction result;

[0011] The composition to be corrected is corrected for grammatical errors to generate grammatical error correction results for the composition to be corrected; each grammatical error correction result of the composition to be corrected includes a sentence with grammatical errors in the composition to be corrected and a correct sentence corresponding to the sentence with grammatical errors.

[0012] Optionally, each of the misspelling analysis results includes at least one of the meaning, word grouping example and sentence construction example of the wrong character in the corresponding misspelling correction result, and at least one of the meaning, word grouping example and sentence construction example of the correct character corresponding to the wrong character.

[0013] Optionally, generating a result of character error analysis based on the character error correction result of the composition to be corrected includes:

[0014] For each wrong-word correction result in the composition to be corrected, obtaining a sentence corresponding to the wrong-word correction result and a context of the sentence corresponding to the wrong-word correction result;

[0015] Obtaining a first text description, where the first text description is used to indicate the analysis of the wrong characters in the wrong character correction result and the correct characters corresponding to the wrong characters;

[0016] The sentence corresponding to the misspelling correction result, the context of the sentence corresponding to the misspelling correction result, and the first text description are input into a misspelling analysis model, and the misspelling analysis model outputs the misspelling analysis result corresponding to the misspelling correction result; the misspelling analysis model is trained using the sentence corresponding to the training misspelling correction result, the context of the sentence corresponding to the training misspelling correction result, and the first text description corresponding to the training misspelling correction result as training samples, and using the misspelling analysis result corresponding to the training misspelling correction result as sample labels.

[0017] Optionally, the step of correcting the grammatical errors of the composition to be corrected and generating a grammatical error correction result of the composition to be corrected includes:

[0018] For each sentence in the composition to be corrected, correct the sentence for grammatical errors and generate a grammatical error correction result for the sentence;

[0019] Determine a target sentence from the composition to be corrected, wherein the target sentence is a sentence in the composition to be corrected that meets a preset condition;

[0020] The error correction result of the target sentence in the composition to be corrected is determined as the error correction result of the composition to be corrected.

[0021] Optionally, determining a target sentence from the composition to be corrected includes:

[0022] If a sentence in the composition to be corrected satisfies at least one of the following conditions, the sentence is determined to be a target sentence:

[0023] Condition 1: There is a presupposition error in the sentence;

[0024] Condition 2: There is pinyin in the sentence;

[0025] Condition three: the number of clauses in the sentence is inconsistent with the number of clauses in the corresponding error correction result.

[0026] Optionally, performing grammatical error correction on the sentence to generate a grammatical error correction result of the sentence includes:

[0027] Obtaining a second text description, where the second text description is used to indicate that grammatical error correction is to be performed on the sentence;

[0028] Inputting the sentence, the context of the sentence and the second text description into a grammatical error correction model, and the grammatical error correction model outputs a grammatical error correction result of the sentence;

[0029] The error correction model is trained by using training sentences, the context of the training sentences and the second text description as training samples, and using the error correction results annotated with the training sentences as sample labels.

[0030] Optionally, before correcting the sentence for grammatical errors, the method further includes:

[0031] Performing pinyin restoration processing on the sentence to obtain a sentence after pinyin restoration processing;

[0032] Then the sentence is corrected for grammatical errors, including:

[0033] The sentence after the pinyin restoration process is corrected for grammatical errors.

[0034] Optionally, after performing spelling correction on the composition to be corrected and generating a spelling correction result for the composition to be corrected and performing grammatical error correction on the composition to be corrected and generating a grammatical error correction result for the composition to be corrected, the method further includes:

[0035] Based on the result of correcting the wrong characters in the composition to be corrected and the result of correcting the wrong grammar in the composition to be corrected, generating a corrected text;

[0036] Determine multiple writing requirements corresponding to the composition to be corrected;

[0037] Generate comments based on the corrected text and multiple writing requirements corresponding to the composition to be corrected.

[0038] Optionally, after generating comments based on the corrected text and the multiple writing requirements corresponding to the composition to be corrected, the method further includes:

[0039] Based on the comments, determining a target writing requirement corresponding to the composition to be corrected, wherein the target writing requirement is at least one writing requirement among multiple writing requirements corresponding to the composition to be corrected; the quality of the composition to be corrected in terms of the target writing requirement is lower than the quality of the composition to be corrected in terms of non-target writing requirements among the multiple writing requirements;

[0040] A polished text is obtained based on the multiple writing requirements, the target writing requirements and the corrected text; the quality of the polished text in terms of the target writing requirements is higher than the quality of the composition to be corrected in terms of the target writing requirements.

[0041] A composition correction device, comprising:

[0042] An acquisition unit, used to acquire the user's composition to be corrected;

[0043] A wrong character correction unit is used to correct wrong characters in the composition to be corrected, and generate a wrong character correction result for the composition to be corrected; each wrong character correction result of the composition to be corrected includes the wrong characters in the composition to be corrected, and the correct characters corresponding to the wrong characters;

[0044] A wrong character distinguishing unit, used for generating wrong character distinguishing results based on the wrong character correction results of the composition to be corrected, each wrong character distinguishing result is used for indicating the difference between the wrong character and the corresponding correct character in the corresponding wrong character correction result;

[0045] The error correction unit is used to correct the error in the composition to be corrected and generate the error correction result of the composition to be corrected; each error correction result of the composition to be corrected includes the sentence with error in the composition to be corrected and the correct sentence corresponding to the sentence with error.

[0046] Optionally, each of the misspelling analysis results includes at least one of the meaning, word grouping example and sentence construction example of the wrong character in the corresponding misspelling correction result, and at least one of the meaning, word grouping example and sentence construction example of the correct character corresponding to the wrong character.

[0047] Optionally, the misspelling analysis unit includes:

[0048] A sentence and context acquisition unit, for acquiring, for each wrong-word correction result in the composition to be corrected, a sentence corresponding to the wrong-word correction result and a context of the sentence corresponding to the wrong-word correction result;

[0049] A first text description acquisition unit, used for acquiring a first text description, wherein the first text description is used for indicating the analysis of the wrong characters in the wrong character correction result and the correct characters corresponding to the wrong characters;

[0050] The misspelling analysis result generating unit is used to input the sentence corresponding to the misspelling correction result, the context of the sentence corresponding to the misspelling correction result and the first text description into a misspelling analysis model, and the misspelling analysis model outputs the misspelling analysis result corresponding to the misspelling correction result; the misspelling analysis model is trained with the sentence corresponding to the training misspelling correction result, the context of the sentence corresponding to the training misspelling correction result and the first text description corresponding to the training misspelling correction result as training samples, and with the misspelling analysis result corresponding to the training misspelling correction result as sample labels.

[0051] Optionally, the error correction unit includes:

[0052] A sentence-level error correction unit is used to correct the error of each sentence in the composition to be corrected, and generate an error correction result for the sentence;

[0053] A target sentence determination unit, used to determine a target sentence from the composition to be corrected, wherein the target sentence is a sentence in the composition to be corrected that meets a preset condition;

[0054] The error correction result determination unit is used to determine the error correction result of the target sentence in the composition to be corrected as the error correction result of the composition to be corrected.

[0055] Optionally, the target sentence determination unit is specifically configured to:

[0056] If a sentence in the composition to be corrected satisfies at least one of the following conditions, the sentence is determined to be a target sentence:

[0057] Condition 1: There is a presupposition error in the sentence;

[0058] Condition 2: Pinyin exists in the sentence;

[0059] Condition three: the number of clauses in the sentence is inconsistent with the number of clauses in the corresponding error correction result.

[0060] Optionally, the sentence-level error correction unit includes:

[0061] A second text description acquisition unit, used to acquire a second text description, where the second text description is used to indicate that grammatical error correction is to be performed on the sentence;

[0062] The sentence error correction result generating unit is used to input the sentence, the context of the sentence and the second text description into a sentence error correction model, and the sentence error correction model outputs the sentence error correction result; the sentence error correction model is trained using training sentences, the context of the training sentences and the second text description as training samples, and using the error correction results annotated with the training sentences as sample labels.

[0063] Optionally, the device further comprises:

[0064] A pinyin recovery unit, used for performing pinyin recovery processing on the sentence before performing grammatical error correction on the sentence to obtain a sentence after pinyin recovery processing;

[0065] The sentence-level error correction unit is specifically used for:

[0066] The sentence after the pinyin restoration process is corrected for grammatical errors.

[0067] Optionally, the device further comprises:

[0068] The comment generation unit is used for generating a corrected text based on the spelling correction results of the composition to be corrected and the grammatical correction results of the composition to be corrected, and generating a corrected text based on the spelling correction results of the composition to be corrected and the grammatical correction results of the composition to be corrected; determining multiple writing requirements corresponding to the composition to be corrected; and generating comments based on the corrected text and the multiple writing requirements corresponding to the composition to be corrected.

[0069] Optionally, the device further comprises:

[0070] A polishing unit is used for, after generating comments based on the corrected text and multiple writing requirements corresponding to the composition to be corrected, determining a target writing requirement corresponding to the composition to be corrected based on the comments, wherein the target writing requirement is at least one writing requirement among the multiple writing requirements corresponding to the composition to be corrected; the quality of the composition to be corrected in terms of the target writing requirement is lower than the quality of the composition to be corrected in terms of non-target writing requirements among the multiple writing requirements; obtaining a polished text based on the multiple writing requirements, the target writing requirement and the corrected text; the quality of the polished text in terms of the target writing requirement is higher than the quality of the composition to be corrected in terms of the target writing requirement.

[0071] A composition correction device, comprising a memory and a processor;

[0072] The memory is used to store programs;

[0073] The processor is used to execute the program to implement the various steps of the composition correction method described above.

[0074] A readable storage medium stores a computer program, which, when executed by a processor, implements the various steps of the composition correction method described above.

[0075] By means of the above technical solution, the present application discloses a composition marking method, device, equipment and readable storage medium. After obtaining the user's composition to be corrected, the composition to be corrected is corrected for spelling errors to generate a spelling correction result for the composition to be corrected, and a spelling analysis result is generated based on the spelling correction result for the composition to be corrected. The composition to be corrected is also corrected for grammatical errors to generate a grammatical error correction result for the composition to be corrected. Since each spelling correction result for the composition to be corrected includes the wrong characters in the composition to be corrected and the correct characters corresponding to the wrong characters, the spelling analysis result can indicate the difference between the wrong characters and the corresponding correct characters in the corresponding spelling correction result, and each grammatical error correction result for the composition to be corrected includes the sentences with grammatical errors in the composition to be corrected and the correct sentences corresponding to the sentences with grammatical errors. After viewing the spelling correction results, the user can learn how to modify the wrong characters, after viewing the spelling analysis results, can more deeply understand the reasons for modifying the wrong characters, and after viewing the grammatical error correction results, can learn how to modify the grammatical errors. Therefore, this solution helps to effectively improve the user's writing ability. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0077] Figure 1 A schematic diagram of a process of a composition correction method disclosed in an embodiment of the present application;

[0078] Figure 2 A schematic diagram of a result of character identification disclosed in an embodiment of the present application;

[0079] Figure 3 A schematic diagram of display effects of a wrong-word correction result and a grammatical error correction result disclosed in an embodiment of the present application;

[0080] Figure 4 A schematic diagram of input and output of a grammatical error correction model when correcting grammatical errors in a sentence disclosed in an embodiment of the present application;

[0081] Figure 5 This is a schematic diagram of the structure of a composition correction device disclosed in an embodiment of the present application;

[0082] Figure 6 This is a hardware structure block diagram of a composition correction device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0083] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0084] Next, the composition correction method provided by the present application is introduced through the following embodiments. The execution subject of the composition correction method provided by the present application can be a terminal device (such as a computer, a smart phone, a learning machine, etc.).

[0085] Reference Figure 1 , Figure 1 This is a flow chart of a composition correction method disclosed in an embodiment of the present application. The method may include:

[0086] Step S101: Obtain the user's composition to be corrected.

[0087] In the present application, the composition to be corrected can be a composition in any language. As one possible implementation method, the composition to be corrected can be a Chinese composition. As other possible implementation methods, the composition to be corrected can be a composition in English, French, Russian, Spanish and other languages. This application does not impose any limitations on this.

[0088] In the present application, the composition to be corrected can be obtained by directly inputting it into a terminal device (such as a computer, a smart phone, a learning machine, etc.), or it can be obtained by photographing, scanning, etc. the user's paper composition using a terminal device (such as a computer, a smart phone, a learning machine, etc.). The present application does not impose any restrictions on this.

[0089] Step S102: correcting wrong characters in the composition to be corrected, and generating wrong character correction results for the composition to be corrected; each wrong character correction result of the composition to be corrected includes the wrong characters in the composition to be corrected, and the correct characters corresponding to the wrong characters.

[0090] In this application, the spelling error correction for the composition to be corrected to generate the spelling error correction result of the composition to be corrected includes: for each sentence in the composition to be corrected, performing spelling error correction on the sentence to generate the spelling error correction result of the sentence; and determining the spelling error correction results of each sentence in the composition to be corrected as the spelling error correction result of the composition to be corrected. The spelling error correction result of the sentence includes the misspelled words in the sentence and the correct words corresponding to the misspelled words.

[0091] Step S103: Generate a spelling error discrimination result based on the spelling error correction result of the composition to be corrected, and each spelling error discrimination result is used to indicate the difference between the misspelled word and the corresponding correct word in the corresponding spelling error correction result.

[0092] As an implementable manner, each spelling error discrimination result includes at least one of the comparison content between the misspelled word and the corresponding correct word in the corresponding spelling error correction result, the meaning of the misspelled word in the corresponding spelling error correction result, word formation examples and sentence-making examples, and at least one of the meaning of the correct word corresponding to the misspelled word, word formation examples and sentence-making examples.

[0093] For easy understanding, refer to Figure 2 , Figure 2 FIG. is a schematic diagram of a spelling error discrimination result disclosed in an embodiment of the present application. As Figure 2 shown in the spelling error discrimination result, the difference between the misspelled word "及 (jí)" and the corresponding correct word "计 (jì)" in the spelling error correction result is indicated, which includes the comparison content between the misspelled word "及 (jí)" and the corresponding correct word "计 (jì)", the meaning of the misspelled word "及 (jí)", word formation examples and sentence-making examples, and the meaning of the corresponding correct word "计 (jì)", word formation examples and sentence-making examples.

[0094] Step S104: Perform grammar error correction on the composition to be corrected to generate the grammar error correction result of the composition to be corrected; each grammar error correction result of the composition to be corrected includes the sentence with grammar errors in the composition to be corrected and the correct sentence corresponding to the sentence with grammar errors.

[0095] In this application, grammar errors include but are not limited to sentence pattern confusion, disorder, improper word usage, redundancy, omission, punctuation problems, pinyin problems, sentence segmentation problems, etc., and this application does not make any limitations on this.

[0096] It should be noted that in the present application, after generating the error correction results of the wrong characters, the error analysis results of the wrong characters and the error correction results of the composition to be corrected, the user can view the error correction results of the wrong characters, the error analysis results and the error correction results of the composition to be corrected. As an implementable method, the error correction results of the wrong characters, the error analysis results and the error correction results of the composition to be corrected can be directly output. As another implementable method, after receiving the user's viewing request, the error correction results of the wrong characters, the error analysis results and the error correction results of the composition to be corrected can be output again, so that the user can view the error correction results of the wrong characters and the error correction results of the composition to be corrected. As an output method, the error correction results of the wrong characters, the error analysis results and the error correction results of the composition to be corrected can be generated into a text for display. In order to enhance the user's experience, as another output method, the error correction results of the wrong characters, the error analysis results and the error correction results of the language can also be rendered on the original image of the composition to be corrected for display. This application does not impose any restrictions on this.

[0097] For ease of understanding, refer to Figure 3 , Figure 3 This is a schematic diagram of the display effect of a wrong character correction result and a grammatical error correction result disclosed in the embodiment of this application. Figure 3 As shown, the circle position corresponds to the wrong character, the box pointed by the arrow at the circle is the correct character, the horizontal line part is the sentence with grammatical errors, and the box pointed by the arrow at the horizontal line is the correct sentence corresponding to the sentence with grammatical errors. After displaying the wrong character correction results and the grammatical error correction results, the user can trigger the wrong character correction results part, and after receiving the user's trigger operation on the wrong character correction results, the wrong character analysis results corresponding to the wrong character correction results can be displayed ( Figure 3 not shown).

[0098] The present embodiment discloses a composition correction method. After obtaining the composition to be corrected by the user, the composition to be corrected is corrected for spelling errors to generate a spelling error correction result of the composition to be corrected, and a spelling error identification result is generated based on the spelling error correction result of the composition to be corrected. The composition to be corrected is also corrected for grammatical errors to generate a grammatical error correction result of the composition to be corrected. Since each spelling error correction result of the composition to be corrected includes the wrong characters in the composition to be corrected and the correct characters corresponding to the wrong characters, the spelling error identification result can indicate the difference between the wrong characters and the corresponding correct characters in the corresponding spelling error correction result, and each grammatical error correction result of the composition to be corrected includes the sentences with grammatical errors in the composition to be corrected and the correct sentences corresponding to the sentences with grammatical errors. After viewing the spelling error correction result, the user can learn how to modify the wrong characters, after viewing the spelling error identification result, the user can have a deeper understanding of the reasons for modifying the wrong characters, and after viewing the grammatical error correction result, the user can learn how to modify the grammatical errors. Therefore, the present solution helps to effectively improve the writing ability of the user.

[0099] In another embodiment of the present application, a specific implementation manner for correcting typos in each sentence of the composition to be corrected and generating the typo correction result of the sentence is described. This manner may include the following steps:

[0100] Step S201: Detect the typos in the sentence and obtain the candidate word set corresponding to the typos.

[0101] Specifically, detecting the typos in the sentence includes: for each word in the sentence, replacing the word with each word in the corresponding confusion word set of the word respectively, and forming a candidate sentence set from the replaced sentences. Based on a pre-established typo detection model, calculate the perplexity of the sentence and the perplexity of each sentence in the candidate sentence set. Based on the perplexity of the sentence and the perplexity of each sentence in the candidate sentence set, determine whether the word is a typo. Among them, the confusion word set corresponding to a word may include the words with similar shapes, similar sounds, and the same sounds of the word.

[0102] Specifically, the candidate word set corresponding to the typo may be the words in the confusion word set corresponding to the sentence with a perplexity higher than that of the sentence in the candidate sentence set.

[0103] For ease of understanding, in this embodiment, taking the word "店 (diàn)" in the sentence "我在看店视 (Wǒ zài kàn diàn shì)" as an example, the process of determining whether the word "店 (diàn)" is a typo is described:

[0104] Assume that the confusion word set corresponding to "店 (diàn)" is {电 (diàn), 点 (diǎn), 占 (zhàn)}. First, replace the "店 (diàn)" in "我在看店视 (Wǒ zài kàn diàn shì)" with "电 (diàn)", "点 (diǎn)", and "占 (zhàn)" respectively to obtain the candidate sentence set {我在看电视 (Wǒ zài kàn diàn shì), 我在看点视 (Wǒ zài kàn diǎn shì), 我在看占视 (Wǒ zài kàn zhàn shì)}. After obtaining the candidate sentence set, calculate the perplexity of "我在看店视 (Wǒ zài kàn diàn shì)" and the perplexity of "我在看电视 (Wǒ zài kàn diàn shì)", "我在看点视 (Wǒ zài kàn diǎn shì)", and "我在看占视 (Wǒ zài kàn zhàn shì)" in the candidate sentence set based on a pre-established statistical language model. After calculation, the perplexity of "我在看店视 (Wǒ zài kàn diàn shì)" is 55, the perplexity of "我在看电视 (Wǒ zài kàn diàn shì)" is 23, the perplexity of "我在看点视 (Wǒ zài kàn diǎn shì)" is 61, and the perplexity of "我在看占视 (Wǒ zài kàn zhàn shì)" is 42. Since the perplexity of "我在看电视 (Wǒ zài kàn diàn shì)" and "我在看占视 (Wǒ zài kàn zhàn shì)" are both higher than that of "我在看店视 (Wǒ zài kàn diàn shì)", it can be determined that the "店 (diàn)" in "我在看店视 (Wǒ zài kàn diàn shì)" is a typo, and the candidate word set corresponding to the typo "店 (diàn)" can be composed of "电 (diàn)" and "占 (zhàn)".

[0105] Step S202: Mask the wrong word in the sentence based on a pre-established masked language model and predict the probability that the word at the masked position in the masked sentence is each candidate word in the candidate word set corresponding to the typo.

[0106] For the above example "我在看店视", based on the pre-established masked language model, mask the character "店", and predict the probabilities that the character at the masked position is "电" and the probability that it is "占".

[0107] Optionally, the typo detection model can be a language model based on a deep neural network. For example, a language model based on ELMO, a language model based on BERT, etc. These models can learn deeper syntactic and semantic information of the language through a large number of parameters. The masked language model can be a masked language model based on Bert. The typo detection model and the masked language model can also be an integrated model, such as the Soft-Masked model. This application does not make any limitations on this.

[0108] Step S203: Based on the predicted probabilities, determine the correct character corresponding to the typo from the candidate character set corresponding to the typo.

[0109] In this application, the candidate character with the highest predicted probability can be determined as the correct character corresponding to the typo. For the above example "我在看店视", assume that the probability that the character at the masked position is predicted to be "电" through step a2 is 0.99, and assume that the probability that the character at the masked position is "占" is 0.13. Then, it is determined that the correct character corresponding to the typo "店" is "电".

[0110] As an implementable manner, in this application, a typo discrimination model can be pre-constructed and trained, and the typo discrimination model generates a typo discrimination result based on the typo correction result of the composition to be corrected.

[0111] It should be noted that in this application, no limitations are imposed on the structure of the typo discrimination model. As an implementable manner, the structure of the typo discrimination model can be the structure of currently commonly used large-scale generation models, such as the structure of the ChatGPT model, the structure of the PaLM (Pathways Language Model) model, the structure of the Pangu large model, and the encoder-decoder structure of the Transformer model, etc.

[0112] After determining the structure of the character error discrimination model, it is necessary to re-determine the training data and train it. It should be noted that in this application, the data used to train the character error discrimination model includes the sentences corresponding to the character error correction results for training, the context of the sentences corresponding to the character error correction results for training, the first text description corresponding to the character error correction results for training, and the character error discrimination results corresponding to the character error correction results for training. Among them, the first text description is used to indicate the discrimination of the misspelled characters in the character error correction results and the correct characters corresponding to the misspelled characters. The character error discrimination results corresponding to the character error correction results for training include the content indicating the difference between the misspelled characters and the corresponding correct characters in the corresponding character error correction results. For example, at least one of the comparison content between the misspelled characters and the corresponding correct characters in the corresponding character error correction results, the meaning of the misspelled characters in the corresponding character error correction results, the example of word formation, and the example of sentence making, and at least one of the meaning of the correct characters corresponding to the misspelled characters, the example of word formation, and the example of sentence making. The character error discrimination model can be trained with the training objective that the character error discrimination results output by the character error discrimination model approach the character error discrimination results corresponding to the character error correction results for training, and its loss function can adopt the cross-entropy loss function.

[0113] Then, in another embodiment of this application, the specific implementation manner of generating the character error discrimination results based on the character error correction results of the composition to be corrected in step S103 is described. This manner may include the following steps:

[0114] Step S301: For each character error correction result in the composition to be corrected, obtain the sentence corresponding to the character error correction result and the context of the sentence corresponding to the character error correction result.

[0115] Exemplarily, a character error correction result is to change "及" to "计". The sentence corresponding to this character error correction result and the context of the sentence corresponding to this character error correction result are "Replace the hard bottom with a reclining chair. This reclining chair can move backward, just like a bed seat. When you are tired, you can sleep on the reclining chair. Set

及

[0116] Step S302: Obtain the first text description, which is used to indicate the discrimination of the misspelled characters in the character error correction results and the correct characters corresponding to the misspelled characters.

[0117] In this application, the first text description can be set by default, or the first text description can be input by the user.

[0118] When the first text description is the case of user input, as an implementable manner, the user can input at any time when the first text description needs to be input. As another implementable manner, a prompt message can be generated first, and the prompt message is used to instruct the user to input the first text description, and the user inputs the first text description after obtaining the prompt message. After the user inputs the first text description, the terminal device can obtain the first text description input by the user and execute the following step S303. The manner in which the user inputs the first text description can be any one of voice input, text input, or image input, and this application does not make any limitations in this regard. It should be noted that if the user does not input the first text description, the first text description adopts the default setting.

[0119] Based on the above example, the first text description can be "In this context, the 'and' in the bracket position should be changed to 'ji', and ask the students to distinguish between these two Chinese characters."

[0120] Step S303: Input the sentence corresponding to the character error correction result, the context of the sentence corresponding to the character error correction result, and the first text description into the character discrimination model, and the character discrimination model outputs the character discrimination result corresponding to the character error correction result.

[0121] Based on the above example, the character discrimination result corresponding to the character error correction result output by the character discrimination model can be as Figure 2 shown.

[0122] In another embodiment of the present application, a specific implementation manner of performing grammar error correction on the composition to be corrected in step S104 to generate the grammar error correction result of the composition to be corrected is described. This manner may include the following steps:

[0123] Step S401: For each sentence in the composition to be corrected, perform grammar error correction on the sentence to generate the grammar error correction result of the sentence.

[0124] As an implementable manner, in the present application, a grammar error correction model can be pre-constructed and trained, and the grammar error correction model performs grammar error correction on each sentence in the composition to be corrected to generate the grammar error correction result of the sentence.

[0125] It should be noted that in the present application, no limitations are imposed on the structure of the grammar error correction model. As an implementable manner, the structure of the grammar error correction model can be the structure of currently commonly used large-scale generation models, such as the structure of the ChatGPT model, the structure of the PaLM (Pathways Language Model) model, the structure of the Pangu large model, and the encoder-decoder structure of the Transformer model, etc.

[0126] After determining the structure of the error correction model, it is necessary to re-determine the training data and train it. It should be noted that in the present application, the data used to train the error correction model includes training sentences, the context of the training sentences, the second text description, and the error correction results annotated with the training sentences, wherein the second text description is used to indicate that the sentences are corrected for errors. The error correction model can be trained with the error correction results output by the error correction model being close to the error correction results annotated with the training sentences as the training goal, and its loss function can adopt a cross-entropy loss function.

[0127] In the present application, the sentence is grammatically corrected to generate a grammatical error correction result of the sentence, including: obtaining a second text description, the second text description is used to indicate that the sentence is grammatically corrected; the sentence, the context of the sentence and the second text description are input into a grammatical error correction model, and the grammatical error correction model outputs the grammatical error correction result of the sentence.

[0128] In the present application, the second text description may be set by default, or the second text description may be input by a user.

[0129] When the second text description is input by the user, as an implementable method, the user can input the second text description at any time when the second text description is needed. As another implementable method, a prompt message can be generated first, and the prompt message is used to instruct the user to input the second text description. The user enters the second text description after obtaining the prompt message. After the user enters the second text description, the terminal device can obtain the second text description input by the user and execute the following step S303. The user can input the second text description in any one of voice input, text input or image input, and this application does not impose any limitation on this. It should be noted that if the user does not enter the second text description, the second text description adopts the default setting.

[0130] Exemplarily, the second text description may be “required to correct grammatical errors in the sentence”.

[0131] For ease of understanding, refer to Figure 4 , Figure 4 This is a schematic diagram of the input and output of a grammatical error correction model when correcting grammatical errors in a sentence disclosed in an embodiment of the present application. Figure 4 As shown in the figure, the input of the speech error correction model is the input part, and the output is the output part.

[0132] It should be noted that in the Chinese composition correction scenario, when users encounter words they do not know how to write during the composition writing process, they will use pinyin to replace them. The existence of pinyin may affect the accuracy of the output results of the error correction model. In order to improve the accuracy of the output results of the error correction model, in the present application, before the error correction of the sentence is performed, the method also includes: performing pinyin restoration processing on the sentence to obtain the sentence after the pinyin restoration processing; then performing error correction on the sentence includes: performing error correction on the sentence after the pinyin restoration processing.

[0133] Step S402: determining a target sentence from the composition to be corrected, wherein the target sentence is a sentence in the composition to be corrected that meets a preset condition.

[0134] In the present application, in actual scenarios, there may be some sentences without grammatical errors that are corrected. In order to avoid misleading users, in the present application, some target sentences can be screened out, and the corrected sentences corresponding to these target sentences can be used as grammatical error correction results.

[0135] As an implementable method, determining the target sentence from the composition to be corrected in the present application includes: if the sentence in the composition to be corrected meets at least one of the following conditions, determining the sentence as the target sentence: Condition one, there is a preset grammatical error in the sentence; Condition two, there is pinyin in the sentence; Condition three, the number of clauses in the sentence is inconsistent with the number of clauses in the corresponding grammatical error correction result.

[0136] It should be noted that in this application, each sentence in the composition to be corrected can be checked for grammatical errors to determine whether each sentence has preset grammatical errors. Preset grammatical errors include but are not limited to mixed sentence patterns, disordered order, inappropriate wording, redundancy, missing, punctuation problems, etc., and this application does not impose any restrictions on this. If the number of clauses in the sentence is inconsistent with the number of clauses in the corresponding grammatical error correction result, it means that the sentence has a punctuation problem.

[0137] In one embodiment of the composition, a language error detection model can be pre-trained. The language error detection model is trained with training sentences as training samples, with the language error types annotated in the training sentences as sample labels, and with the language error types output by the model approaching the sample labels as training targets. The language error detection model can be a language model based on a deep neural network, such as a language model based on ELMO, a language model based on BERT, etc. These models can learn deeper syntactic and semantic information of the language through a large number of parameters.

[0138] After the error detection model is trained, each sentence in the composition to be corrected can be input into the error detection model, and the error detection model can output the error type of each sentence in the composition to be corrected, and the error type is any one or more of the above-mentioned preset errors.

[0139] Step S403: determining the grammatical error correction result of the target sentence in the composition to be corrected as the grammatical error correction result of the composition to be corrected.

[0140] In another embodiment of the present application, after performing spelling correction on the composition to be corrected and generating a spelling correction result for the composition to be corrected and performing grammatical error correction on the composition to be corrected and generating a grammatical error correction result for the composition to be corrected, the method further includes:

[0141] Step S501: Based on the results of correcting misspellings and grammatical errors in the composition to be corrected, a corrected text is generated.

[0142] In this application, the wrong characters in the composition to be corrected can be corrected into correct characters, and the sentences with grammatical errors in the composition to be corrected can be corrected into correct sentences, so as to generate a corrected text.

[0143] Step S502: Determine multiple writing requirements corresponding to the composition to be corrected.

[0144] In this application, different types of essays have different writing requirements. For a certain type of essay, the corresponding writing requirements of this type of essay are to break down and refine the writing elements involved in this type of essay to form graded and measurable specific indicators. The writing elements are the knowledge points or writing ability training points involved in this type of essay.

[0145] For ease of understanding, illustratively, the writing elements are:

[0146] Write down clearly what happened and how you felt at the time.

[0147] Corresponding writing requirements may include:

[0148] Writing requirement 1: Write clearly what happened;

[0149] Writing requirement 2: Write down your feelings as things happen and develop;

[0150] Writing requirement 3: Use language, actions, expressions, psychological descriptions, etc. to express your feelings clearly.

[0151] As an implementation method, if the subject of the composition to be corrected belongs to the target subject, the writing requirements corresponding to the subject of the composition to be corrected are determined as the writing requirements of the composition to be corrected. That is, for the target subject, the corresponding relationship between the subject and the writing requirements is pre-set. As an example, the target subject can be the writing subject of a unit in the textbook used for school teaching.

[0152] As another possible implementation method, if the subject of the composition to be corrected belongs to a non-target subject, then the writing requirements corresponding to the composition to be corrected are generated based on the composition to be corrected.

[0153] Step S503: Generate comments based on the corrected text and multiple writing requirements corresponding to the composition to be corrected.

[0154] In the present application, a comment generation model can be pre-trained, and the corrected text and multiple writing requirements corresponding to the composition to be corrected are input into the comment generation model, and the comment generation model generates comments.

[0155] It should be noted that in the present application, there is no limitation on the structure of the comment generation model. As an implementable embodiment, the structure of the comment generation model can be the structure of a currently commonly used large-scale generation model, such as the structure of the ChatGPT model, the structure of the PaLM (Pathways Language Model) model, the structure of the Pangu model, and the encoder-decoder structure of the Transformer model.

[0156] After determining the structure of the comment generation model, it is necessary to re-determine the training data and train it. It should be noted that in the present application, the data used to train the comment generation model includes the training composition, the writing requirements corresponding to the training composition, and the comments annotated with the training composition. The comment generation model can be trained with the comment output by the comment generation model being close to the comments annotated with the training composition as the training goal, and its loss function can adopt a cross-entropy loss function.

[0157] It should be noted that in this application, the comments generated may include general comments and fragmentary comments; wherein the general comments are the overall review results for the composition to be corrected, and different fragmentary comments are the review results for different text fragments in the composition to be corrected.

[0158] In an optional embodiment, the fragmentary comments include heuristic comments, which use the form of questions to point out suggestions for modifying the essay to be corrected.

[0159] Optionally, the fragmentary comments may further include: declarative comments, which point out the advantages and disadvantages of the text fragment associated with the fragmentary comments in terms of writing requirements. For example, the following two fragmentary comments are declarative comments: "Writing about 'I' learning to swim" and "Through learning to swim, 'I' understand a truth."

[0160] The current intelligent review methods are limited to the review of language ability (for example, accurate wording, clear meaning, appropriate structure, concise sentences, coherent text and logic, plain language, compliance with norms, the ability to express objective concepts clearly, accurately, coherently, appropriately, and without grammatical errors, etc.), and lack in-depth review of the content of the text, resulting in limited improvement in users' writing abilities.

[0161] In this embodiment, after determining the multiple writing requirements corresponding to the composition to be corrected, the comments generated based on the corrected text of the composition to be corrected and the multiple writing requirements corresponding to the composition to be corrected are associated with the writing requirements, that is, the comments are the result of evaluating the composition to be corrected based on the writing requirements. Therefore, based on this application, an in-depth review of the content of the composition to be corrected is achieved, which can help users effectively improve their writing skills.

[0162] In another embodiment of the present application, after generating comments based on the corrected text and the multiple writing requirements corresponding to the composition to be corrected, the method further includes:

[0163] Step S601: Based on the comments, determine the target writing requirements corresponding to the composition to be corrected.

[0164] In the present application, the target writing requirement is at least one writing requirement among the multiple writing requirements corresponding to the composition to be corrected; the quality of the composition to be corrected in terms of the target writing requirement is lower than the quality of the composition to be corrected in terms of the non-target writing requirements among the multiple writing requirements;

[0165] As an implementation method, the target comment of the composition to be corrected can be obtained first, and then the target writing requirement corresponding to the composition to be corrected can be determined based on the target comment. The target comment can be a comment in the comment that guides the writer to modify the composition to be corrected so as to improve the quality of the composition to be corrected in terms of the target writing requirement.

[0166] Optionally, the target comments may be sequence-labeled to determine at least one writing requirement corresponding to the target comments as the target writing requirement.

[0167] Step S602: Obtaining a polished text based on the multiple writing requirements, the target writing requirements and the corrected text.

[0168] The quality of the polished text in terms of the target writing requirements is higher than the quality of the composition to be corrected in terms of the target writing requirements.

[0169] In the present application, a polishing model may be pre-trained, and multiple writing requirements, the target writing requirements, and the corrected text may be input into the polishing model, and the polished text may be generated by the polishing model.

[0170] It should be noted that in the present application, there is no limitation on the structure of the polishing model. As an implementable embodiment, the structure of the polishing model can be the structure of a currently commonly used large-scale generation model, such as the structure of the ChatGPT model, the structure of the PaLM (Pathways Language Model) model, the structure of the Pangu model, and the encoder-decoder structure of the Transformer model.

[0171] After determining the structure of the polishing model, it is necessary to re-determine the training data and train it. It should be noted that in the present application, the data used to train the polishing model includes the corrected text corresponding to the training composition, the writing requirements corresponding to the training composition, the target writing requirements corresponding to the training composition, and the polished text corresponding to the training composition. The polishing model can be trained with the text output by the polishing model approaching the polished text corresponding to the training composition as the training target, and its loss function can adopt the cross-entropy loss function.

[0172] In this embodiment, the corrected text of the composition to be corrected and the corresponding writing weaknesses of the composition to be corrected (i.e., the target writing requirements) are obtained, and a polished text is generated based on multiple writing requirements, the target writing requirements, and the corrected text. The quality of the generated polished text in terms of the target writing requirements is improved, and the purpose of polishing around the writing weaknesses of the composition to be corrected is achieved, that is, personalized polishing of the composition to be corrected is achieved, which can help users effectively improve their writing skills.

[0173] The composition marking device disclosed in the embodiment of the present application is described below. The composition marking device described below and the composition marking method described above can be referred to in correspondence with each other.

[0174] Reference Figure 5 , Figure 5 This is a schematic diagram of the structure of a composition correction device disclosed in the embodiment of this application. Figure 5 As shown, the composition correction device may include:

[0175] An acquisition unit 11 is used to acquire the user's composition to be corrected;

[0176] The wrong-word correction unit 12 is used to correct wrong-words in the composition to be corrected and generate wrong-word correction results for the composition to be corrected; each wrong-word correction result of the composition to be corrected includes the wrong word in the composition to be corrected and the correct word corresponding to the wrong word;

[0177] The wrong-word distinguishing unit 13 is used to generate a wrong-word distinguishing result based on the wrong-word correction result of the composition to be corrected, each wrong-word distinguishing result is used to indicate the difference between the wrong word and the corresponding correct word in the corresponding wrong-word correction result;

[0178] The error correction unit 14 is used to correct the error in the composition to be corrected and generate the error correction result of the composition to be corrected; each error correction result of the composition to be corrected includes the sentence with error in the composition to be corrected and the correct sentence corresponding to the sentence with error.

[0179] As an implementable embodiment, each of the misspelling analysis results includes at least one of the meaning, word grouping example and sentence construction example of the wrong character in the corresponding misspelling correction result, and at least one of the meaning, word grouping example and sentence construction example of the correct character corresponding to the wrong character.

[0180] As an implementable embodiment, the misspelling identifying unit includes:

[0181] A sentence and context acquisition unit, for acquiring, for each wrong-word correction result in the composition to be corrected, a sentence corresponding to the wrong-word correction result and a context of the sentence corresponding to the wrong-word correction result;

[0182] A first text description acquisition unit, used for acquiring a first text description, wherein the first text description is used for indicating the analysis of the wrong characters in the wrong character correction result and the correct characters corresponding to the wrong characters;

[0183] The misspelling analysis result generating unit is used to input the sentence corresponding to the misspelling correction result, the context of the sentence corresponding to the misspelling correction result and the first text description into a misspelling analysis model, and the misspelling analysis model outputs the misspelling analysis result corresponding to the misspelling correction result; the misspelling analysis model is trained with the sentence corresponding to the training misspelling correction result, the context of the sentence corresponding to the training misspelling correction result and the first text description corresponding to the training misspelling correction result as training samples, and with the misspelling analysis result corresponding to the training misspelling correction result as sample labels.

[0184] As an implementable embodiment, the error correction unit includes:

[0185] A sentence-level error correction unit is used to correct the error of each sentence in the composition to be corrected, and generate an error correction result for the sentence;

[0186] A target sentence determination unit, used to determine a target sentence from the composition to be corrected, wherein the target sentence is a sentence in the composition to be corrected that meets a preset condition;

[0187] The error correction result determination unit is used to determine the error correction result of the target sentence in the composition to be corrected as the error correction result of the composition to be corrected.

[0188] As an implementable embodiment, the target sentence determination unit is specifically used to:

[0189] If a sentence in the composition to be corrected satisfies at least one of the following conditions, the sentence is determined to be a target sentence:

[0190] Condition 1: There is a presupposition error in the sentence;

[0191] Condition 2: There is pinyin in the sentence;

[0192] Condition three: the number of clauses in the sentence is inconsistent with the number of clauses in the corresponding error correction result.

[0193] As an implementable embodiment, the sentence-level error correction unit includes:

[0194] A second text description acquisition unit, used to acquire a second text description, where the second text description is used to indicate that grammatical error correction is to be performed on the sentence;

[0195] The sentence error correction result generating unit is used to input the sentence, the context of the sentence and the second text description into a sentence error correction model, and the sentence error correction model outputs the sentence error correction result; the sentence error correction model is trained using training sentences, the context of the training sentences and the second text description as training samples, and using the error correction results annotated with the training sentences as sample labels.

[0196] As an implementable embodiment, the device further includes:

[0197] A pinyin recovery unit, used for performing pinyin recovery processing on the sentence before performing grammatical error correction on the sentence to obtain a sentence after pinyin recovery processing;

[0198] The sentence-level error correction unit is specifically used for:

[0199] The sentence after the pinyin restoration process is corrected for grammatical errors.

[0200] As an implementable embodiment, the device further includes:

[0201] The comment generation unit is used for generating a corrected text based on the spelling correction results of the composition to be corrected and the grammatical correction results of the composition to be corrected, and generating a corrected text based on the spelling correction results of the composition to be corrected and the grammatical correction results of the composition to be corrected; determining multiple writing requirements corresponding to the composition to be corrected; and generating comments based on the corrected text and the multiple writing requirements corresponding to the composition to be corrected.

[0202] As an implementable embodiment, the device further includes:

[0203] A polishing unit is used for, after generating comments based on the corrected text and multiple writing requirements corresponding to the composition to be corrected, determining a target writing requirement corresponding to the composition to be corrected based on the comments, wherein the target writing requirement is at least one writing requirement among the multiple writing requirements corresponding to the composition to be corrected; the quality of the composition to be corrected in terms of the target writing requirement is lower than the quality of the composition to be corrected in terms of non-target writing requirements among the multiple writing requirements; obtaining a polished text based on the multiple writing requirements, the target writing requirement and the corrected text; the quality of the polished text in terms of the target writing requirement is higher than the quality of the composition to be corrected in terms of the target writing requirement.

[0204] Reference Figure 6 , Figure 6 The hardware structure diagram of a composition correction device provided in the embodiment of the present application is shown in FIG. Figure 6 ,The hardware structure of the essay grading device may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;

[0205] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;

[0206] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;

[0207] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0208] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:

[0209] Get the user's essay to be corrected;

[0210] Performing wrong character correction on the composition to be corrected, and generating wrong character correction results for the composition to be corrected; each wrong character correction result of the composition to be corrected includes the wrong character in the composition to be corrected, and the correct character corresponding to the wrong character;

[0211] Based on the wrong character correction result of the composition to be corrected, generating wrong character identification results, each wrong character identification result is used to indicate the difference between the wrong character and the corresponding correct character in the corresponding wrong character correction result;

[0212] The composition to be corrected is corrected for grammatical errors to generate grammatical error correction results for the composition to be corrected; each grammatical error correction result of the composition to be corrected includes a sentence with grammatical errors in the composition to be corrected and a correct sentence corresponding to the sentence with grammatical errors.

[0213] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0214] The embodiment of the present application further provides a readable storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:

[0215] Get the user's essay to be corrected;

[0216] Performing wrong character correction on the composition to be corrected, and generating wrong character correction results for the composition to be corrected; each wrong character correction result of the composition to be corrected includes the wrong character in the composition to be corrected, and the correct character corresponding to the wrong character;

[0217] Based on the wrong character correction result of the composition to be corrected, generating wrong character identification results, each wrong character identification result is used to indicate the difference between the wrong character and the corresponding correct character in the corresponding wrong character correction result;

[0218] The composition to be corrected is corrected for grammatical errors to generate grammatical error correction results for the composition to be corrected; each grammatical error correction result of the composition to be corrected includes a sentence with grammatical errors in the composition to be corrected and a correct sentence corresponding to the sentence with grammatical errors.

[0219] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0220] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0221] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0222] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A composition correction method, characterized in that: The method comprises: Get the user's essay to be corrected; Performing wrong character correction on the composition to be corrected, and generating wrong character correction results for the composition to be corrected; each wrong character correction result of the composition to be corrected includes the wrong character in the composition to be corrected, and the correct character corresponding to the wrong character; Based on the wrong character correction result of the composition to be corrected, generating wrong character identification results, each wrong character identification result is used to indicate the difference between the wrong character and the corresponding correct character in the corresponding wrong character correction result; The composition to be corrected is corrected for grammatical errors to generate grammatical error correction results for the composition to be corrected; each grammatical error correction result of the composition to be corrected includes a sentence with grammatical errors in the composition to be corrected and a correct sentence corresponding to the sentence with grammatical errors.

2. The method according to claim 1, characterized in that Each of the misspelling analysis results includes at least one of the meaning, word grouping example and sentence construction example of the misspelling in the corresponding misspelling correction result, and at least one of the meaning, word grouping example and sentence construction example of the correct word corresponding to the misspelling.

3. The method according to claim 1 or 2, characterized in that: The generating of the result of character error analysis based on the character error correction result of the composition to be corrected includes: For each wrong-word correction result in the composition to be corrected, obtaining a sentence corresponding to the wrong-word correction result and a context of the sentence corresponding to the wrong-word correction result; Obtaining a first text description, where the first text description is used to indicate the analysis of the wrong characters in the wrong character correction result and the correct characters corresponding to the wrong characters; The sentence corresponding to the misspelling correction result is input into a misspelling analysis model along with the context of the sentence corresponding to the misspelling correction result and the first text description. The misspelling analysis model outputs the misspelling analysis result corresponding to the misspelling correction result.

4. The method according to claim 1, characterized in that: The step of correcting the grammatical errors of the composition to be corrected and generating the grammatical error correction result of the composition to be corrected includes: For each sentence in the composition to be corrected, correct the sentence for grammatical errors and generate a grammatical error correction result for the sentence; Determine a target sentence from the composition to be corrected, wherein the target sentence is a sentence in the composition to be corrected that meets a preset condition; The error correction result of the target sentence in the composition to be corrected is determined as the error correction result of the composition to be corrected.

5. The method according to claim 4, characterized in that Determining the target sentence from the composition to be corrected includes: If a sentence in the composition to be corrected satisfies at least one of the following conditions, the sentence is determined to be a target sentence: Condition 1: There is a presupposition error in the sentence; Condition 2: Pinyin exists in the sentence; Condition three: the number of clauses in the sentence is inconsistent with the number of clauses in the corresponding error correction result.

6. The method according to claim 4, characterized in that Performing grammatical error correction on the sentence to generate a grammatical error correction result of the sentence includes: Obtaining a second text description, where the second text description is used to indicate that grammatical error correction is to be performed on the sentence; The sentence, the context of the sentence and the second text description are input into a grammatical error correction model, and the grammatical error correction model outputs a grammatical error correction result of the sentence.

7. The method according to claim 4, characterized in that Before correcting the sentence for grammatical errors, the method further includes: Performing pinyin restoration processing on the sentence to obtain a sentence after pinyin restoration processing; Then the sentence is corrected for grammatical errors, including: The sentence after the pinyin restoration process is corrected for grammatical errors.

8. The method according to claim 1, characterized in that After performing spelling correction on the composition to be corrected and generating a spelling correction result for the composition to be corrected and performing grammatical error correction on the composition to be corrected and generating a grammatical error correction result for the composition to be corrected, the method further includes: Based on the result of correcting the wrong characters in the composition to be corrected and the result of correcting the wrong grammar in the composition to be corrected, generating a corrected text; Determine multiple writing requirements corresponding to the composition to be corrected; Generate comments based on the corrected text and multiple writing requirements corresponding to the composition to be corrected.

9. The method according to claim 8, characterized in that After generating comments based on the corrected text and the multiple writing requirements corresponding to the composition to be corrected, the method further includes: Based on the comments, determining a target writing requirement corresponding to the composition to be corrected, wherein the target writing requirement is at least one writing requirement among multiple writing requirements corresponding to the composition to be corrected; the quality of the composition to be corrected in terms of the target writing requirement is lower than the quality of the composition to be corrected in terms of non-target writing requirements among the multiple writing requirements; A polished text is obtained based on the multiple writing requirements, the target writing requirements and the corrected text; the quality of the polished text in terms of the target writing requirements is higher than the quality of the composition to be corrected in terms of the target writing requirements.

10. A composition correction device, characterized in that: The device comprises: An acquisition unit, used to acquire the user's composition to be corrected; A wrong character correction unit is used to correct wrong characters in the composition to be corrected, and generate a wrong character correction result for the composition to be corrected; each wrong character correction result of the composition to be corrected includes the wrong characters in the composition to be corrected, and the correct characters corresponding to the wrong characters; A wrong character distinguishing unit, used for generating wrong character distinguishing results based on the wrong character correction results of the composition to be corrected, each wrong character distinguishing result is used for indicating the difference between the wrong character and the corresponding correct character in the corresponding wrong character correction result; The error correction unit is used to correct the error in the composition to be corrected and generate the error correction result of the composition to be corrected; each error correction result of the composition to be corrected includes the sentence with error in the composition to be corrected and the correct sentence corresponding to the sentence with error.

11. A composition correction device, characterized in that: including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement the various steps of the composition correction method as described in any one of claims 1 to 9.

12. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the composition marking method according to any one of claims 1 to 9 is implemented.

Citation Information

Cited By

  • Multimodal OCR (Optical Character Recognition) method and system for handwritten compositions of pupils

    CN121617103A

  • A primary school student handwriting composition multi-modal OCR identification method and system

    CN121617103B