Artificial intelligence-based text optimization method, device, equipment and storage medium
Through the artificial intelligence-based text optimization method, the text is optimized after sentence identification and correction of grammatical errors, which solves the problem that existing technology cannot beautify the correct text and improves the quality of the article.
Patent Information
- Application Number
- CN202011317046.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-20
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2040-11-20
AI Technical Summary
Existing technologies can only correct spelling and grammatical errors, but cannot beautify and optimize correct texts, nor can they improve the sophistication of vocabulary and authentic sentence structure in English articles.
Through an AI-based approach, the system identifies the objects to be corrected in the text by sentence recognition, performs grammatical correction, and then optimizes the text based on this, including phrase replacement and grammatical structure adjustment, to output more advanced and authentic text.
Further optimization of the correct text has been achieved, making the text's vocabulary more advanced, the collocation more reasonable, and the sentence structure more authentic, thereby improving the overall quality of the article.
Smart Images

Figure CN112395869B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an artificial intelligence-based text optimization method, device, equipment and storage medium. Background Art
[0002] Writing English articles (e.g., exam essays, emails, and application materials) is often a significant challenge for non-native English speakers. Because the quality of these articles often hinges on achieving or achieving a crucial goal, authors often seek help from English language professionals, translation agencies, or rewriting companies. While this approach can yield higher-quality English articles, it often comes with time and financial burdens. Furthermore, miscommunication between authors and English language professionals can lead to discrepancies between the rewritten content and the original.
[0003] With the recent development of machine learning and deep learning, various natural language processing technologies have been applied to assistive writing in English, such as spelling correction and the identification and correction of grammatical errors. These writing assistance systems can improve the quality of English writing and ensure its fluency. However, a good English article requires more than just error-free writing; sometimes, it demands more, such as sophisticated vocabulary, more effective collocations, and more authentic sentence structure. However, current machine learning and deep learning technologies only correct spelling and grammatical errors, but fail to enhance or optimize error-free text.
[0004] The above content is only used to assist in understanding the technical solution of the present invention and does not constitute an admission that the above content is prior art. Summary of the Invention
[0005] The main purpose of the present invention is to provide an artificial intelligence-based text optimization method, which aims to solve the technical problem that the existing technology only corrects spelling errors and grammatical errors in the text and cannot beautify and optimize the correct text.
[0006] To achieve the above object, the present invention provides a text optimization method based on artificial intelligence, the method comprising the following steps:
[0007] Obtaining an original text to be processed, segmenting the original text to be processed into sentences, and obtaining sentence texts;
[0008] Performing grammatical recognition on the sentence text, and determining the object to be corrected contained in the sentence text according to the recognition result;
[0009] Correcting the object to be corrected to obtain a corrected sentence text;
[0010] optimizing the modified sentence text to obtain an optimized sentence text;
[0011] outputting a reference text according to the optimized sentence text;
[0012] determining a target text according to the original text to be processed and the reference text.
[0013] Optionally, the modifying the object to be modified to obtain a modified sentence text comprises:
[0014] obtaining a relative position of the object to be modified in the sentence text;
[0015] obtaining a to-be-modified word corresponding to the relative position in the sentence text;
[0016] modifying the to-be-modified word in the sentence text to obtain a modified sentence text.
[0017] Optionally, the modifying the to-be-modified word in the sentence text to obtain a modified sentence text comprises:
[0018] obtaining a first word and a second word corresponding to the to-be-modified word according to an arrangement order of each word in the sentence text;
[0019] determining a plurality of reference words between the first word and the second word based on a standard grammar structure;
[0020] obtaining a usage probability of each reference word from a preset grammar data set, and taking a reference word with a maximum usage probability as a target word;
[0021] replacing the to-be-modified word with the target word to obtain a modified sentence text.
[0022] Optionally, the optimizing the modified sentence text to obtain an optimized sentence text comprises:
[0023] obtaining a target word group corresponding to each word group in the modified sentence text in a first optimization rule;
[0024] replacing each word group in the modified sentence text with the target word group to obtain a rewritten sentence text;
[0025] performing a colloquial modification on the rewritten sentence text based on a second optimization rule to obtain an optimized sentence text.
[0026] Optionally, before the obtaining a target word group corresponding to each word group in the modified sentence text in a first optimization rule, the method further comprises:
[0027] obtaining an accuracy score and a simplification confidence corresponding to each simplified rule in the rule database;
[0028] selecting a simplified rule from the plurality of simplified rules, wherein the simplified rule has an accuracy score greater than a preset score threshold and a simplification confidence greater than a preset confidence threshold;
[0029] converting the simplified rule having the accuracy score greater than the preset score threshold and the simplification confidence greater than the preset confidence threshold into a first optimized rule.
[0030] Optionally, the obtaining of the target word group corresponding to each word group in the first optimized rule from the modified sentence text comprises:
[0031] obtaining an initial tense of each word group in the modified sentence text;
[0032] converting the initial tense of each word group into a preset tense;
[0033] obtaining a target word group corresponding to each word group in the first optimized rule in the preset tense.
[0034] Optionally, the determining of the target text according to the to-be-processed original text and the reference text comprises:
[0035] obtaining a number of sentence texts corresponding to the to-be-processed original text and the reference text, and a number of words and a number of phonemes corresponding to each sentence text;
[0036] determining an original readability index corresponding to the to-be-processed original text and a reference readability index corresponding to the reference text according to the number of sentence texts, the number of words and the number of phonemes;
[0037] when the original readability index is greater than or equal to the reference readability index, taking the to-be-processed original text as the target text;
[0038] when the original readability index is less than the reference readability index, taking the reference text as the target text.
[0039] In addition, to achieve the above-mentioned purpose, the application further provides a text optimization device based on artificial intelligence, which comprises:
[0040] a division module configured to obtain a to-be-processed original text, divide the to-be-processed original text into sentence texts, and obtain the sentence texts;
[0041] a recognition module configured to perform syntax recognition on the sentence texts, and determine a to-be-corrected object contained in the sentence texts according to a recognition result;
[0042] a correction module configured to correct the to-be-corrected object to obtain a corrected sentence text;
[0043] an optimization module configured to optimize the corrected sentence text to obtain an optimized sentence text;
[0044] an output module configured to output a reference text according to the optimized sentence text;
[0045] a comparison module configured to determine a target text according to the to-be-processed original text and the reference text.
[0046] In addition, to achieve the above object, the present application further provides a text optimization device based on artificial intelligence, which comprises a memory, a processor and a text optimization program based on artificial intelligence stored in the memory and executable on the processor, and the text optimization program based on artificial intelligence is configured to implement the steps of the text optimization method based on artificial intelligence.
[0047] In addition, to achieve the above object, the present application further provides a storage medium, which stores a text optimization program based on artificial intelligence, and the text optimization program based on artificial intelligence implements the steps of the text optimization method based on artificial intelligence when executed by a processor.
[0048] In the present application, the to-be-processed original text is obtained, the to-be-processed original text is segmented into sentences to obtain a sentence text, the sentence text is subjected to syntax recognition, the to-be-corrected object contained in the sentence text is determined according to the recognition result, the to-be-corrected object is corrected to obtain a corrected sentence text, the corrected sentence text is subjected to optimization processing to obtain an optimized sentence text, a reference text is output according to the optimized sentence text, and a target text is determined according to the to-be-processed original text and the reference text. Through the correction processing and optimization processing of the to-be-processed original text, the reference text is output, and the target text is determined according to the to-be-processed original text and the reference text, which can further optimize the correct text on the basis of the correct text, so that the optimization of the text is more comprehensive. BRIEF DESCRIPTION OF DRAWINGS
[0049] Figure 1 is a structural schematic diagram of a text optimization device based on artificial intelligence of a hardware running environment involved in the embodiment scheme of the present application;
[0050] Figure 2 is a flowchart of a first embodiment of the text optimization method based on artificial intelligence of the present application;
[0051] Figure 3This is a flow chart of a second embodiment of the text optimization method based on artificial intelligence of the present invention;
[0052] Figure 4 This is a flow chart of a third embodiment of the text optimization method based on artificial intelligence of the present invention;
[0053] Figure 5 This is a structural block diagram of the first embodiment of the text optimization device based on artificial intelligence of the present invention.
[0054] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0055] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0056] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of an artificial intelligence-based text optimization device in the hardware operating environment involved in the embodiment of the present invention.
[0057] like Figure 1 As shown, the artificial intelligence-based text optimization device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to implement connection and communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard). Optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a wireless fidelity (WI-FI) interface). The memory 1005 may be a high-speed random access memory (RAM) memory or a stable non-volatile memory (NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0058] Those skilled in the art will understand that Figure 1 The structure shown in does not constitute a limitation on the text optimization device based on artificial intelligence, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0059] like Figure 1As shown, the memory 1005 as a storage medium can include an operating system, a network communication module, a user interface module and an artificial intelligence-based text optimization program.
[0060] In Figure 1 In the artificial intelligence-based text optimization device shown, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the artificial intelligence-based text optimization device can be arranged in the artificial intelligence-based text optimization device, and the artificial intelligence-based text optimization device calls the artificial intelligence-based text optimization program stored in the memory 1005 through the processor 1001, and executes the artificial intelligence-based text optimization method provided in the embodiments of the present application.
[0061] The embodiments of the present application provide an artificial intelligence-based text optimization method, which refers to Figure 2 , Figure 2 The flowchart of a first embodiment of the artificial intelligence-based text optimization method of the present application is shown.
[0062] In this embodiment, the artificial intelligence-based text optimization method includes the following steps:
[0063] Step S10: Obtain the original text to be processed, divide the original text to be processed into sentences, and obtain the sentence text.
[0064] It should be noted that the execution subject of the present embodiment can be an artificial intelligence-based text optimization device, and can also be other devices that can achieve the same or similar functions, and the present embodiment does not limit this. The artificial intelligence-based text optimization device in the present embodiment can be used to obtain input text, correct errors in the input text, further optimize the corrected correct text, and finally output the optimized text.
[0065] In this embodiment, the original text to be processed can be obtained by direct connection through a USB3.0 data line or the like, or can be obtained from a cloud server or a cloud platform through an Internet method. The communication protocol used to obtain the original text to be processed can be a serial data communication protocol, and the network communication protocol used to obtain the original text to be processed through the Internet method can be a TCP / IP protocol, an IPX / SPX protocol, a NetBEUI protocol and the like. The present embodiment does not limit this.
[0066] It can be understood that the original text to be processed needs to be input by a user, and the user can input the original text to be processed through a storage medium such as a U disk, or upload the original text to be processed to a cloud server or a cloud platform in the form of the Internet. When the user has original text to be processed, the processing of the original text can be started by inputting a start instruction through a key. Since there are many original texts to be processed, the corresponding original text to be processed can be obtained according to the text identifier in the start instruction. Further, if the user needs to process multiple different original texts, the original texts to be processed can also be processed according to the processing priority in the start instruction. In addition, it should be noted that the original text to be processed can also be input by a terminal device. The user can store the original text to be processed in the storage of the terminal device in advance, and set a preset time. When the preset time is reached, the terminal device inputs the original text to be processed stored in the storage.
[0067] It should be emphasized that, in order to further ensure the privacy and security of the object to be corrected, the object to be corrected can also be stored in a node of a block chain.
[0068] In a specific implementation, the original text to be processed is an original text that has not been processed. The original text to be processed can have word errors, syntax errors, and unreasonable word collocations. In order to improve the processing effect of the original text to be processed, the original text to be processed is divided into sentences in this embodiment to obtain sentence texts. The original text to be processed is composed of multiple sentence texts, and each sentence text corresponds to a sentence in the original text to be processed.
[0069] It should be noted that the original text to be processed can be divided into sentences according to punctuation marks in the original text to be processed. For example, the original text to be processed is "He told me: he will work overtime tonight.", and the original text to be processed can be divided into two sentence texts "He told me" and "he will work overtime tonight." For another example, the original text to be processed is "Today is Monday, he is going to school now.", and the original text to be processed can be divided into two sentence texts "Today is Monday" and "he is going to school now." The original text to be processed can be divided into sentences according to semicolons, commas, and periods. The original text to be processed can also be divided into sentences according to other sentence division methods, which are not limited in this embodiment.
[0070] Step S20: performing syntax recognition on the sentence text, and determining an object to be corrected contained in the sentence text according to a recognition result.
[0071] In the embodiment, after obtaining the sentence text, the grammar in the sentence text is recognized. In the embodiment, the grammar in the sentence text can be recognized according to the standard grammar structure in the literature such as a textbook and a dictionary, and the grammar can also be recognized in other manners, which is not limited in the embodiment.
[0072] In a specific implementation, after obtaining the recognition result, the object to be corrected included in the sentence text can be determined based on the recognition result, and the object to be corrected includes but is not limited to a word error and a grammar error in the sentence text. For example, in the sentence text "The main cause of traffic accidents on the highway is that the drivers violate traffic rules or operate improperly", the word error collocation is "the main cause... caused", "the main cause" can be taken as the object to be corrected, or "caused" can be taken as the object to be corrected, and for example, in the sentence text "he are going to school now", the grammar error is "are", which is taken as the object to be corrected.
[0073] Step S30: correcting the object to be corrected to obtain a corrected sentence text.
[0074] In a specific implementation, after determining the object to be corrected in the sentence text, the object to be corrected can also be corrected based on the standard grammar structure in the literature such as a textbook and a dictionary, and the object to be corrected can also be corrected in other manners, which is not limited in the embodiment, and the corrected sentence text is a sentence text without errors such as a word error and a grammar error. In order to facilitate understanding, an example is given. For example, in the sentence text "The main cause of traffic accidents on the highway is that the drivers violate traffic rules or operate improperly", the object to be corrected is "the main cause" or "caused", and after the object to be corrected is corrected, the corrected sentence text can be "The main cause of traffic accidents on the highway is that the drivers violate traffic rules or operate improperly" or "Traffic accidents on the highway are caused by the drivers violating traffic rules or operating improperly", and for example, in the sentence text "he are going to school now", the object to be corrected is "are", and after the object to be corrected is corrected, the corrected sentence text can be "he is going to school now".
[0075] Step S40: optimizing the corrected sentence text to obtain an optimized sentence text.
[0076] It should be noted that, in order to make the text optimization based on artificial intelligence more comprehensive and make the optimized text have more advanced words, more reasonable word collocations and more idiomatic sentences, in the embodiment, after obtaining the corrected sentence text, the corrected sentence text is optimized to obtain an optimized sentence text.
[0077] In a specific implementation, the modified sentence text can be processed according to the written expression manner and the alternative word manner, and can also be processed according to other manners, which are not limited in the embodiment. For the convenience of understanding, the modified sentence text is taken as an example, for example, the word "teacher" is replaced by "educator", and the sentence text "a lot" is replaced by "significant quantity", and "Thk U" is replaced by "Thank you".
[0078] Step S50: outputting a reference text according to the optimized sentence text.
[0079] It can be understood that the meaning of the sentence expression, the number and structure of the sentence text are not changed after the optimization, and the reference text is composed of the optimized sentence text according to the optimized sentence text. In the embodiment, the optimized sentence text can be combined according to the position and order of the optimized sentence text in the original text to be processed, or can be combined according to the mark symbol and other marks in the original text to be processed, which are not limited in the embodiment.
[0080] Step S60: determining a target text according to the original text to be processed and the reference text.
[0081] It should be noted that in actual cases, the reference text after the correction and optimization contains more written expressions and writing manners, and does not necessarily have good readability, therefore, in order to make the final output text have better readability, the original text to be processed is compared with the reference text to determine the target text, and the target text is the final text output to the user or the interrupt device.
[0082] In a specific implementation, since the reference text does not have errors in words or grammar, the difference between the number of errors in the original text to be processed and the reference text is the number of errors in the original text to be processed, and the number of errors and the number of colloquial expressions in the original text to be processed can be combined, and the error number threshold and the colloquial expression number threshold can be set, for example, when the number of errors in the original text to be processed is less than the error number threshold and the number of colloquial expressions is greater than the colloquial expression number threshold, the original text to be processed is taken as the target text, and otherwise, the reference text is taken as the target text, and the target text can be determined according to other manners, which are not limited in the embodiment.
[0083] In the embodiment, the original text to be processed is obtained, the original text to be processed is segmented into sentences, and a sentence text is obtained; grammar recognition is performed on the sentence text, and a to-be-corrected object contained in the sentence text is determined according to a recognition result; the to-be-corrected object is corrected to obtain a corrected sentence text; the corrected sentence text is optimized to obtain an optimized sentence text; a reference text is output according to the optimized sentence text; and a target text is determined according to the original text to be processed and the reference text. Through the correction and optimization of the original text to be processed, the reference text is output, and the target text is determined according to the original text to be processed and the reference text, so that the correct text can be further optimized on the basis of the correct text, and the optimization of the text is more comprehensive.
[0084] Reference Figure 3 , Figure 3 The flowchart of the second embodiment of the text optimization method based on artificial intelligence is shown.
[0085] Based on the first embodiment, the step S30 in the method of the embodiment comprises:
[0086] Step S301: obtaining a relative position of the to-be-corrected object in the sentence text.
[0087] In the embodiment, after obtaining the to-be-corrected object, the relative position of the to-be-corrected object in the sentence text is obtained based on the structure of the sentence text and the arrangement order of each word or phrase. For example, the sentence text is "he are going to school now", the to-be-corrected object is "are", there are six words in the sentence text, and it can be obtained that the to-be-corrected object "are" is the second word in the sentence text, so the relative position of the to-be-corrected object "are" in the sentence text is the second.
[0088] Step S302: obtaining a to-be-corrected word corresponding to the relative position in the sentence text.
[0089] It can be understood that the to-be-corrected object can be a word or a phrase, and the phrase is also composed of multiple words. Based on the relative position, the corresponding to-be-corrected word can be found in the sentence text. The to-be-corrected word can be one word or multiple words, which is not limited in the embodiment. For example, the to-be-corrected object in the sentence text "he are going to school now" is "are", and since the to-be-corrected object is a word, the to-be-corrected word is also "are".
[0090] Step S303: correcting the to-be-corrected word in the sentence text to obtain a corrected sentence text.
[0091] In specific implementation, after the word to be corrected in the sentence text is determined, the word to be corrected can also be corrected based on the standard grammar structure in the literature materials such as textbooks and dictionaries, and can also be corrected in other manners, which is not limited in the embodiment. The corrected sentence text is a sentence text without errors such as word errors and grammar errors.
[0092] Further, the step S303 specifically includes: obtaining the first word and the second word corresponding to the word to be corrected according to the arrangement order of each word in the sentence text; determining a plurality of reference words between the first word and the second word based on the standard grammar structure; obtaining the usage probability of each reference word from a preset grammar data set, and taking the reference word with the maximum usage probability as a target word; and replacing the word to be corrected with the target word to obtain the corrected sentence text.
[0093] It should be noted that the first word and the second word corresponding to the word to be corrected can be determined according to the arrangement order of each word in the sentence text and the relative position of the word to be corrected in the sentence text. The first word is the previous word or the last word of the word to be corrected, and the second word is the next word or the next word of the word to be corrected. For example, the second word "are" in the sentence text "he are going to school now" is the word to be corrected, the first word "he" before the word "are" can be obtained, and the second word "going" after the word "are" can be obtained.
[0094] In specific implementation, after the first word and the second word are obtained, a plurality of reference words between the first word and the second word can be obtained, the reference word is a word conforming to the standard grammar structure, and then the usage probability of each reference word is obtained from the preset grammar data set. The usage probability of the target word is the maximum, wherein the preset grammar data set is a commonly used grammar set obtained based on big data. For example, according to the sentence text "he are going to school now", the first word "he" and the second word "going" are obtained. Assuming that the reference words "likes" and "is" are obtained based on the standard grammar structure, and assuming that the usage probability of the reference word "likes" is 15% and the usage probability of the reference word "is" is 80% based on the preset grammar data set, the usage probability of the reference word "is" is the maximum according to the comparison, and the reference word "is" is the target word. After the target word is determined, the word to be corrected is replaced with the target word, and the corrected sentence text is obtained.
[0095] The embodiment obtains the relative position of the to-be-corrected object in the sentence text, obtains a to-be-corrected word corresponding to the relative position in the sentence text, and corrects the to-be-corrected word in the sentence text to obtain a corrected sentence text. By obtaining the relative position of the to-be-corrected object and correcting the to-be-corrected word corresponding to the relative position, the corrected sentence text does not have errors such as words or grammar, and a more accurate sentence text can be obtained.
[0096] Reference Figure 4 , Figure 4 The flowchart of the third embodiment of the text optimization method based on artificial intelligence is shown.
[0097] Based on the first embodiment, the step S40 in the embodiment includes:
[0098] Step S401: obtaining a target word group corresponding to each word group in the corrected sentence text in the first optimization rule.
[0099] It should be noted that, in order to make the text more advanced, reasonable and more natural without errors, after obtaining the corrected sentence text, the embodiment finds the target word group corresponding to each word group in the corrected sentence text in the first optimization rule. The first optimization rule is a rule for converting simple word groups into complex word groups. For example, the target word group of "be bad" in the first optimization rule is "impact negatively".
[0100] Step S402: replacing each word group in the corrected sentence text with the target word group to obtain a rewritten sentence text.
[0101] It can be understood that after obtaining the target word group, each word group is replaced with the target word group to obtain a rewritten sentence text, and the rewritten sentence text is a sentence text composed of the target word group. For example, "a lot" in the corrected sentence text is replaced with "significant quantity" in the target word group in the first optimization rule.
[0102] Step S403: performing oral modification on the rewritten sentence text based on a second optimization rule to obtain an optimized sentence text.
[0103] It should be noted that the first optimization rule is to rewrite simple word groups into complex word groups, and the second optimization rule is to modify oral expressions in the sentence text into written expressions. The second optimization rule is a rule for modifying oral expressions into written expressions. For example, the oral expression "Thk U" in the sentence text is modified into "Thank you".
[0104] Further, the step S401 specifically includes: obtaining the initial tense of each phrase in the modified sentence text; converting the initial tense of each phrase into a preset tense; and obtaining the target phrase corresponding to each phrase in the preset tense in the first optimization rule.
[0105] It should be noted that when obtaining the target phrase of each phrase, the initial tense of each phrase needs to be obtained, such as past tense, future tense, etc., and then the initial tense of each phrase is converted into a preset tense, which can be set as general present tense, and the embodiment is not limited thereto, for example, the past tense "wanted" is converted into "want". Finally, when each phrase is in the preset tense, the target phrase corresponding to each phrase in the first optimization rule is obtained.
[0106] Further, before the step S401, it further includes: obtaining the accuracy score and the simplification confidence corresponding to each simplification rule in the rule database; screening the simplification rule with the accuracy score greater than a preset score threshold and the simplification confidence greater than a preset confidence threshold from the plurality of simplification rules; and converting the simplification rule with the accuracy score greater than the preset score threshold and the simplification confidence greater than the preset confidence threshold into the first optimization rule.
[0107] It should be noted that the rule database includes a plurality of simplification rules, and the simplification rule is a rule for simplifying complex phrases. Each simplification rule has a corresponding accuracy score and simplification confidence. The accuracy score and the simplification confidence are pre-set in the rule database. When different simplification rules are obtained, the corresponding accuracy score and simplification confidence can be obtained from the rule database at the same time. For example, the accuracy score of the simplification rule "significant quantity"→ "alot" is 2, and the simplification confidence is 0.5. In the embodiment, the range of the accuracy score can be set to 1-5, and the range of the simplification confidence can be set to "0-1". Other ranges can also be set, and the embodiment is not limited thereto.
[0108] In a specific implementation, in order to improve the optimization effect, the preset score threshold of the accuracy score and the preset confidence threshold of the simplification confidence are used to screen the plurality of simplification rules in the rule database. In the embodiment, the preset score threshold can be set to 4, and the preset confidence threshold can be set to 0.8. Assuming that the accuracy score of the simplification rule O is 3, and the simplification confidence is 0.6, the accuracy score of the simplification rule P is 4.5, and the simplification confidence is 0.9, the simplification rule P is converted into the first optimization rule.
[0109] It should be noted that converting the simplification rule into the first optimization rule is equivalent to reversing the simplification rule, for example, the simplification rule is "significant quantity" -> "a lot", and the first optimization rule obtained after conversion is "a lot" -> "significant quantity".
[0110] Further, the step S60 in the embodiment includes:
[0111] Step S601: Obtain the number of sentence texts corresponding to the to-be-processed original text and the reference text, and the number of words and the number of phonemes corresponding to each sentence text.
[0112] It should be noted that in order to make the text after the correction and optimization processing more readable, the number of sentence texts corresponding to the to-be-processed original text and the reference text, and the number of words and the number of phonemes corresponding to each sentence text are obtained in the embodiment.
[0113] Step S602: Determine the original readability index corresponding to the to-be-processed original text and the reference readability index corresponding to the reference text according to the number of sentence texts, the number of words and the number of phonemes.
[0114] In specific implementation, the original readability index and the reference readability index can be calculated according to a preset formula, and the preset formula is Wherein, 0.39, 11.8 and 15.59 are constants, W is the number of words, S1 is the number of sentence texts, and S2 is the number of phonemes.
[0115] Step S603: When the original readability index is greater than or equal to the reference readability index, the to-be-processed original text is taken as the target text.
[0116] It should be noted that the greater the readability index, the easier the text is to read, so when the original readability index is greater than or equal to the reference readability index, it means that the to-be-processed original text is more suitable for users to read, and the to-be-processed original text is taken as the target text of the final output.
[0117] Step S604: When the original readability index is less than the reference readability index, the reference text is taken as the target text.
[0118] It can be understood that when the original readability index is less than the reference readability index, it means that the reference text after the correction and optimization is more suitable for users to read, and the reference text is taken as the target text of the final output.
[0119] The embodiment obtains target word groups corresponding to each word group in the modified sentence text in the first optimization rule; replaces each word group in the modified sentence text with the target word group to obtain a rewritten sentence text; and performs oralization correction on the rewritten sentence text based on a second optimization rule to obtain an optimized sentence text. The first optimization rule and the second optimization rule are used to optimize the modified sentence text, so that the words in the text are more advanced, more collocated, and more idiomatic. In addition, the target text is selected from the original text to be processed and the reference text according to the readability index, so that the final output target text is more suitable for user reading, and user experience is improved.
[0120] In addition, the embodiment of the present application also provides a storage medium, wherein the storage medium stores an artificial intelligence-based text optimization program, and the artificial intelligence-based text optimization program is executed by a processor to implement the steps of the artificial intelligence-based text optimization method described above.
[0121] Since the storage medium adopts all the technical solutions of the above-mentioned embodiments, it at least has all the beneficial effects brought by the technical solutions of the above-mentioned embodiments, which will not be repeated here.
[0122] Reference Figure 5 , Figure 5 is a structural block diagram of the first embodiment of the artificial intelligence-based text optimization device of the present application.
[0123] As Figure 5 shown, the artificial intelligence-based text optimization device provided by the embodiment of the present application comprises:
[0124] The division module 10 is configured to obtain an original text to be processed, divide the original text to be processed into sentences, and obtain a sentence text.
[0125] The recognition module 20 is configured to perform syntax recognition on the sentence text, and determine a to-be-corrected object contained in the sentence text according to a recognition result.
[0126] The correction module 30 is configured to correct the to-be-corrected object to obtain a modified sentence text.
[0127] The optimization module 40 is configured to perform optimization processing on the modified sentence text to obtain an optimized sentence text.
[0128] The output module 50 is configured to output a reference text according to the optimized sentence text.
[0129] The comparison module 60 is configured to determine a target text according to the original text to be processed and the reference text.
[0130] In the embodiment, the original text to be processed is obtained, the original text to be processed is segmented into sentences to obtain sentence texts, grammar recognition is performed on the sentence texts, the objects to be corrected contained in the sentence texts are determined according to the recognition results, the objects to be corrected are corrected to obtain corrected sentence texts, the corrected sentence texts are optimized to obtain optimized sentence texts, a reference text is output according to the optimized sentence texts, and a target text is determined according to the original text to be processed and the reference text. Through the correction and optimization of the original text to be processed, the reference text is output, and the target text is determined according to the original text to be processed and the reference text, so that the correct text can be further optimized on the basis of the correct text, and the optimization of the text is more comprehensive.
[0131] In an implementation, the correction module 30 is further configured to obtain a relative position of the object to be corrected in the sentence text, obtain a word to be corrected corresponding to the relative position in the sentence text, and correct the word to be corrected in the sentence text to obtain the corrected sentence text.
[0132] In an implementation, the correction module 30 is further configured to obtain a first word and a second word corresponding to the word to be corrected according to an arrangement order of each word in the sentence text, determine a plurality of reference words between the first word and the second word based on a standard grammar structure, obtain a usage probability of each reference word from a preset grammar data set, and take a reference word with a maximum usage probability as a target word, and replace the word to be corrected with the target word to obtain the corrected sentence text.
[0133] In an embodiment, the optimization module 40 is further configured to obtain a target word group corresponding to each word group in the corrected sentence text in a first optimization rule, replace each word group in the corrected sentence text with the target word group to obtain a rewritten sentence text, and perform oralization correction on the rewritten sentence text based on a second optimization rule to obtain the optimized sentence text.
[0134] In an embodiment, the text optimization apparatus based on artificial intelligence further comprises a conversion module.
[0135] The conversion module is configured to obtain an accuracy score and a simplification confidence corresponding to each simplification rule in a rule database, filter a simplification rule with an accuracy score greater than a preset score threshold and a simplification confidence greater than a preset confidence threshold from a plurality of simplification rules, and convert the simplification rule with the accuracy score greater than the preset score threshold and the simplification confidence greater than the preset confidence threshold into a first optimization rule.
[0136] In an embodiment, the optimization module 40 is further configured to acquire an initial tense of each phrase in the modified sentence text; convert the initial tense of each phrase into a preset tense; and acquire a target phrase corresponding to each phrase in the preset tense in the first optimization rule.
[0137] In an embodiment, the comparison module 60 is further configured to acquire a number of sentence texts corresponding to the original text to be processed and the reference text, and a number of words and a number of phonemes corresponding to each sentence text; determine an original readability index corresponding to the original text to be processed and a reference readability index corresponding to the reference text according to the number of sentence texts, the number of words, and the number of phonemes; when the original readability index is greater than or equal to the reference readability index, take the original text to be processed as the target text; and when the original readability index is less than the reference readability index, take the reference text as the target text.
[0138] The blockchain referred to in the present application is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. The blockchain is essentially a decentralized database, and is a series of data blocks associated using cryptographic methods. Each data block contains information of a batch of network transactions, and is used to verify the validity (anti-fake) of the information and generate the next block. The blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer, etc.
[0139] It should be understood that the above is only an example, and does not constitute any limitation on the technical solutions of the present application. In specific applications, those skilled in the art can set it up according to the needs, and the present application does not limit it.
[0140] It should be noted that the above-described workflow is only illustrative and does not limit the scope of protection of the present application. In actual applications, those skilled in the art can select part or all of them to achieve the purpose of the present embodiment, and this place does not limit it.
[0141] In addition, technical details not described in detail in the present embodiment can be referred to the text optimization method based on artificial intelligence provided by any embodiment of the present application, which will not be repeated here.
[0142] Moreover, it is to be understood that the phraseology and terminology used herein is for the purpose of description and should not be regarded as limiting. The use of "including" "comprising" or "having" and variations thereof herein is intended to encompass the presence of one or more recited elements or steps and not the exclusion of any other integers or steps. The use of "including", "comprising", "having" and "with" and variations thereof herein is intended to encompass the presence of one or more recited elements or steps and not the exclusion of any other integers or steps.
[0143] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0144] Those skilled in the art can clearly understand the above-mentioned embodiment methods from the description of the above embodiments, which can be realized by software and necessary general hardware platforms, of course, also can be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a read only memory (ROM) / RAM, a magnetic disk, an optical disk) and includes a plurality of instructions for making a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) execute the methods described in various embodiments of the present application.
[0145] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields, which is made by using the content of the specification and drawings of the present application, is also included in the patent protection scope of the present application.
Claims
1. A text optimization method based on artificial intelligence, characterized in that: The text optimization method based on artificial intelligence includes: Obtaining an original text to be processed, segmenting the original text to be processed into sentences, and obtaining sentence texts; Performing grammatical recognition on the sentence text, and determining the object to be corrected contained in the sentence text according to the recognition result; Correcting the object to be corrected to obtain a corrected sentence text; Obtaining the initial tense of each phrase in the corrected sentence text; Convert the initial tense of each phrase into the preset tense; Obtaining target phrases corresponding to each phrase in a preset tense in the first optimization rule; Replacing each phrase in the revised sentence text with the target phrase to obtain a rewritten sentence text; Performing colloquial correction on the rewritten sentence text based on a second optimization rule to obtain an optimized sentence text; Outputting a reference text according to the optimized sentence text; A target text is determined according to the original text to be processed and the reference text.
2. The text optimization method based on artificial intelligence according to claim 1, characterized in that: The step of correcting the object to be corrected to obtain a corrected sentence text includes: Obtaining the relative position of the object to be corrected in the sentence text; Obtain the word to be corrected corresponding to the relative position in the sentence text; Correct the words to be corrected in the sentence text to obtain a corrected sentence text, and the object to be corrected is stored in the blockchain.
3. The text optimization method based on artificial intelligence according to claim 2, characterized in that: The step of correcting the words to be corrected in the sentence text to obtain a corrected sentence text includes: Obtaining a first word and a second word corresponding to the word to be corrected according to the arrangement order of each word in the sentence text; determining a plurality of reference words between the first word and the second word based on a standard grammatical structure; Obtain the usage probability of each reference word from a preset grammar dataset, and use the reference word with the highest usage probability as the target word; The word to be corrected is replaced with the target word to obtain a corrected sentence text.
4. The text optimization method based on artificial intelligence according to claim 1, characterized in that: Before obtaining the target phrases corresponding to the first optimization rule for each phrase in the corrected sentence text, the method further includes: Obtain the accuracy score and simplification confidence corresponding to each simplified rule in the rule database; Filtering out simplified rules whose accuracy scores are greater than a preset score threshold and whose simplified confidences are greater than a preset confidence threshold from the plurality of simplified rules; The simplified rule whose accuracy score is greater than a preset score threshold and whose simplified confidence is greater than a preset confidence threshold is converted into a first optimization rule.
5. The text optimization method based on artificial intelligence according to any one of claims 1 to 4, characterized in that: The determining of the target text according to the original text to be processed and the reference text includes: Obtaining the number of sentence texts corresponding to the original text to be processed and the reference text, as well as the number of words and the number of syllables corresponding to each sentence text; Determining an original readability index corresponding to the original text to be processed and a reference readability index corresponding to the reference text according to the number of sentence texts, the number of words, and the number of syllables; When the original readability index is greater than or equal to the reference readability index, using the original text to be processed as the target text; When the original readability index is less than the reference readability index, the reference text is used as the target text.
6. A text optimization device based on artificial intelligence, characterized in that: The text optimization device based on artificial intelligence includes: A segmentation module is used to obtain the original text to be processed, and to segment the original text to be processed into sentences to obtain sentence texts; A recognition module, configured to perform grammatical recognition on the sentence text and determine the object to be corrected contained in the sentence text according to the recognition result; A correction module, configured to correct the object to be corrected to obtain a corrected sentence text; an optimization module configured to obtain an initial tense of each phrase in the revised sentence text; convert the initial tense of each phrase into a preset tense; obtain a target phrase corresponding to each phrase in the preset tense in a first optimization rule; replace each phrase in the revised sentence text with the target phrase to obtain a rewritten sentence text; and perform colloquial correction on the rewritten sentence text based on a second optimization rule to obtain an optimized sentence text; An output module, configured to output a reference text based on the optimized sentence text; The comparison module is used to determine the target text according to the original text to be processed and the reference text.
7. A text optimization device based on artificial intelligence, characterized in that: The artificial intelligence-based text optimization device includes: a memory, a processor, and an artificial intelligence-based text optimization program stored in the memory and executable on the processor, wherein the artificial intelligence-based text optimization program is configured to implement the steps of the artificial intelligence-based text optimization method according to any one of claims 1 to 5.
8. A storage medium, characterized in that: The storage medium stores an artificial intelligence-based text optimization program, which, when executed by a processor, implements the steps of the artificial intelligence-based text optimization method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Interactive text translation method and device
CN109582977A
Text processing method and device
CN110502754A