Text error detection method and device, electronic equipment and storage medium

CN117669548BActive Publication Date: 2026-09-22TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211100506.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-08
Publication Date
2026-09-22
Estimated Expiration
2042-09-08

AI Technical Summary

Technical Problem

具体而言,白名单保护的模块维护一系列的低频表达词,如果检错结果命中了白名单中的词,则直接判定为不存在错误,但是这种方式会造成“漏检”问题

Benefits of technology

[0023]通过获取待识别文本信息,对待识别文本信息进行低频词检测,可以确定出待识别文本信息中出现频率较低的至少一个目标低频词,接着,获取至少一个目标低频词对应的目标含义信息,对待识别文本信息和目标含义信息进行文本融合处理,得到目标文本信息,并对融入有目标低频词含义信息的目标文本信息进行错别字识别,可以使检错系统在错别字识别过程中学习到目标低频词的含义,可以避免由于目标低频词导致漏检和过检,进而提高文本中错别字的识别准确度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117669548B_ABST
    Figure CN117669548B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a text error detection method and device, electronic equipment and storage medium. The method comprises: obtaining to-be-recognized text information; performing low-frequency word detection on the to-be-recognized text information to obtain at least one target low-frequency word in the to-be-recognized text information; obtaining target meaning information corresponding to the at least one target low-frequency word; performing text fusion processing on the to-be-recognized text information and the target meaning information to obtain target text information; and performing error word recognition on the target text information to obtain a target recognition result. According to the embodiments of the present disclosure, the error detection system can learn the meaning of the target low-frequency word in the error word recognition process, avoid missing detection and over-detection due to the target low-frequency word, and thus improve the recognition accuracy of error words in the text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular, to a text error detection method, an apparatus, an electronic device, and a storage medium. Background Art

[0002] Currently, a general text error detection method is as follows: a text sequence is input to an error detection model, and the error detection model outputs an error detection identifier corresponding to each character by determining whether each character in the input text sequence is a wrong character, outputting 1 if it is a wrong character, and outputting 0 if it is not a wrong character.

[0003] In practical applications, error detection models often encounter low-frequency expressions, such as colloquial expressions, new popular words, proper nouns, dialects, etc., and existing error detection models will have the problems of "over-detection" or "missing detection".

[0004] Because sentences containing low-frequency expressions do not exist in the training data of the error detection model, "over-detection" of low-frequency expressions is prone to occur. For example, for a user input "what is the logo of X1X2 (a brand name)", since there are rarely or no sentences related to "X1X2" in the training data of the error detection model, the model incorrectly determines that "X1X2 logo" does not conform to normal language expression habits, and finally determines in the output result of the model that the characters "X1" and "X2" are wrong characters, resulting in "over-detection".

[0005] In order to avoid "over-detection" of low-frequency words, the error detection model adds a whitelist protection module after the output result of the error detection model. Specifically, the whitelist protection module maintains a series of low-frequency expression words. If an error detection result hits a word in the whitelist, it is directly determined that there is no error, but this method will cause the problem of "missing detection". For example, for a user input "the X1X2 of a country lies in its youth", where "X1X2" is a word in the whitelist, so although the error detection model correctly identifies that there is an error in "X1X2", because it hits the whitelist, the result of the model is modified to consider that "X1X2" has no error, resulting in "missing detection". Summary of the Invention

[0006] In view of the above technical problems, the present disclosure provides a text error detection method, an apparatus, an electronic device, and a storage medium.

[0007] According to an aspect of the embodiments of the present disclosure, there is provided a text error detection method, comprising:

[0008] acquiring text information to be identified;

[0009] performing low-frequency word detection on the text information to be identified to obtain at least one target low-frequency word in the text information to be identified;

[0010] Obtain target meaning information corresponding to the at least one target low-frequency word; the target meaning information is at least one meaning information corresponding to any one of the target low-frequency words.

[0011] The text information to be identified and the target meaning information are subjected to text fusion processing to obtain the target text information;

[0012] The target text information is subjected to typo recognition to obtain the target recognition result.

[0013] According to another aspect of the embodiments of this disclosure, a text error detection device is provided, comprising:

[0014] The text to be recognized acquisition module is used to acquire the text information to be recognized;

[0015] The low-frequency word detection module is used to perform low-frequency word detection on the text information to be identified, and obtain at least one target low-frequency word in the text information to be identified.

[0016] The target meaning information acquisition module is used to acquire target meaning information corresponding to the at least one target low-frequency word; the target meaning information is at least one meaning information corresponding to any one of the target low-frequency words.

[0017] The text fusion processing module is used to perform text fusion processing on the text information to be identified and the target meaning information to obtain the target text information;

[0018] The misspelling detection module is used to identify misspellings in the target text information and obtain the target recognition result.

[0019] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the above-described text error detection method.

[0020] According to another aspect of the present disclosure, a computer-readable storage medium is provided, which, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the above-described text error detection method.

[0021] According to another aspect of the present disclosure, a computer program product containing instructions is provided that, when run on a computer, causes the computer to perform the above-described text error detection method.

[0022] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:

[0023] By acquiring the text information to be identified and performing low-frequency word detection, at least one target low-frequency word with a low frequency of occurrence in the text information can be identified. Then, the target meaning information corresponding to the at least one target low-frequency word is acquired. Text fusion processing is performed on the text information to be identified and the target meaning information to obtain the target text information. Then, the target text information with the meaning information of the target low-frequency word is used to identify typos. This allows the error detection system to learn the meaning of the target low-frequency word during the typo identification process, which can avoid missed detection and over-detection due to the target low-frequency word, thereby improving the accuracy of typo identification in the text.

[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0025] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0026] Figure 1 This is a schematic diagram illustrating an application system according to an exemplary embodiment;

[0027] Figure 2 This is a flowchart illustrating a text error detection method according to an exemplary embodiment;

[0028] Figure 3 This is a schematic diagram illustrating the model architecture of a text error detection method according to an exemplary embodiment;

[0029] Figure 4 This is a schematic diagram illustrating a typo recognition page according to an exemplary embodiment;

[0030] Figure 5 This is a block diagram illustrating a text error detection device according to an exemplary embodiment;

[0031] Figure 6 This is a block diagram illustrating an electronic device for generating target recognition results according to an exemplary embodiment;

[0032] Figure 7 This is a block diagram illustrating another electronic device for generating target recognition results according to an exemplary embodiment. Detailed Implementation

[0033] Various exemplary embodiments, features, and aspects of this application will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.

[0034] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.

[0035] Furthermore, to better illustrate this application, numerous specific details are provided in the following detailed embodiments. Those skilled in the art should understand that this application can be implemented without certain specific details. In some instances, methods, means, components, and circuits well-known to those skilled in the art have not been described in detail in order to highlight the main points of this application.

[0036] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or computers-controlled machines to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. AI software technology mainly includes computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0037] In recent years, with the research and progress of artificial intelligence technology, it has been widely applied in many fields. The solutions provided in this application involve technologies such as machine learning / deep learning, which are specifically illustrated through the following embodiments:

[0038] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating an application system according to an exemplary embodiment. The application system can be used in the data processing method of this application. Figure 1 As shown, the application system may include at least server 01 and terminal 02.

[0039] In this embodiment, server 01 can be used to identify typos in the text information to be identified. Specifically, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0040] In this embodiment, terminal 02 can be a user terminal that generates the text information to be recognized. The user terminal may include physical devices such as smartphones, desktop computers, tablets, laptops, smart speakers, in-vehicle terminals, digital assistants, augmented reality (AR) / virtual reality (VR) devices, and smart wearable devices, and may also include software running on the physical device, such as applications. The operating system running on the user terminal in this embodiment may include, but is not limited to, Android, iOS, Linux, and Windows.

[0041] In addition, it should be noted that, Figure 1 The example shown is merely one application environment provided by this disclosure. In practical applications, other application environments may also be included. For example, the recognition of typos in the text information to be recognized can also be implemented on terminal 02.

[0042] In the embodiments described in this specification, the terminal 02 and the server 01 can be directly or indirectly connected through wired or wireless communication, and this application does not limit this connection.

[0043] It should be noted that the following diagram shows one possible sequence of steps, and it is not strictly necessary to follow this order. Some steps can be executed in parallel without interdependence.

[0044] Specifically, Figure 2 This is a flowchart illustrating a text error detection method according to an exemplary embodiment. For example... Figure 2 As shown, this text error detection method can be used in electronic devices such as terminals or servers, and specifically includes the following steps:

[0045] In step S201, the text information to be recognized is obtained.

[0046] In one specific embodiment, the text information to be identified can refer to text information to be identified regarding the presence or absence of typos. The text information to be identified may include at least one text sequence. For example, the text information to be identified could be "The future of the nation lies in its youth." It should be noted that this embodiment uses a Chinese language scenario as an example; other embodiments may also use other languages ​​such as English. This disclosure does not impose any limitations.

[0047] In one specific embodiment, the text information to be identified may be generated by a first user terminal. Specifically, the first user terminal may be the terminal of the error detection service requester on the error detection system.

[0048] In step S203, low-frequency word detection is performed on the text information to be identified to obtain at least one target low-frequency word in the text information to be identified.

[0049] In one specific embodiment, the target low-frequency word can refer to a word in the text information to be identified that belongs to the low-frequency word category.

[0050] In one specific embodiment, if low-frequency words exist in the text information to be identified, at least one target low-frequency word can be obtained by performing low-frequency word detection on the text information to be identified. If no low-frequency words exist in the text information to be identified, the target low-frequency word obtained by performing low-frequency word detection on the text information to be identified can be empty.

[0051] In one specific embodiment, the above method may further include:

[0052] Obtain a preset low-frequency word set, which includes multiple preset low-frequency words.

[0053] Accordingly, the above-mentioned low-frequency word detection of the text information to be identified, to obtain at least one target low-frequency word in the text information to be identified, may include:

[0054] Search for multiple preset low-frequency words in the text to be recognized;

[0055] If at least one preset low-frequency word is found, the at least one preset low-frequency word is used as at least one target low-frequency word.

[0056] In one specific embodiment, a preset low-frequency word set can be used to provide a reference for detecting low-frequency words in the text information to be identified. The preset low-frequency word set may include multiple preset low-frequency words. Preset low-frequency words may include colloquialisms, new and trending words, proper nouns, or dialect words, etc.

[0057] In one specific embodiment, the preset low-frequency words in the preset low-frequency word set can be generated and updated by a second user terminal, or they can be obtained by the error detection server from at least one preset data source at preset time intervals. Specifically, the aforementioned second user terminal can be a terminal of the error detection service maintainer on the error detection system; the error detection server can be the server of the error detection system.

[0058] In a specific embodiment, each preset low-frequency word can be sequentially searched in the text information to be identified. If any preset low-frequency word is found, it is taken as the target low-frequency word, and the next preset low-frequency word is searched in the text information to be identified again, until all preset low-frequency words in the preset low-frequency word set have been searched, at least one target low-frequency word in the text information to be identified can be obtained.

[0059] In the above embodiments, by acquiring a preset low-frequency word set including multiple preset low-frequency words, multiple preset low-frequency words can be pre-set in the preset low-frequency word set. Words that appear with low frequency during the training of the misspelling recognition model (such as colloquial words, new words, hot words, etc.) can be added to the preset low-frequency word set as preset low-frequency words. Multiple preset low-frequency words are searched in the text information to be recognized. If at least one preset low-frequency word is found, at least one preset low-frequency word is used as at least one target low-frequency word. This can detect target low-frequency words in the text information to be recognized that may cause recognition errors due to their low frequency during the training of the misspelling recognition model. In this way, missed detection and over-detection due to target low-frequency words can be avoided, thereby improving the recognition accuracy of misspellings in the text.

[0060] In step S205, target meaning information corresponding to at least one target low-frequency word is obtained.

[0061] In one specific embodiment, the target meaning information can be at least one meaning information corresponding to any target low-frequency word. The meaning information corresponding to any target low-frequency word can refer to descriptive information explaining the meaning of any target low-frequency word. The target meaning information can include the meaning information of any target low-frequency word as a low-frequency word, and can also include the meaning information of any target low-frequency word as a commonly used word.

[0062] In one specific embodiment, the above method may further include:

[0063] Obtain the first mapping relationship between multiple preset low-frequency words and multiple preset meaning information.

[0064] Accordingly, step S205 above may include:

[0065] Based on the first mapping relationship, find the preset meaning information corresponding to at least one target low-frequency word to obtain the target meaning information.

[0066] In one specific embodiment, any preset meaning information can be at least one meaning information corresponding to any preset low-frequency word.

[0067] In a specific embodiment, the first mapping relationship may refer to the one-to-one correspondence between any preset low-frequency word and any preset meaning information.

[0068] In one specific embodiment, after pre-constructing a preset low-frequency word set, preset meaning information corresponding to each preset low-frequency word can be determined; based on each preset low-frequency word and its corresponding preset meaning information, the aforementioned first mapping relationship is constructed. Specifically, the preset meaning information corresponding to each preset low-frequency word can be obtained by the error detection server through crawling and analysis from multiple preset data sources, or it can be generated by a second user terminal.

[0069] In one specific embodiment, when any preset low-frequency word has multiple different meanings, the preset meaning information corresponding to the preset low-frequency word can be obtained by concatenating the multiple meaning information corresponding to the preset low-frequency word. For example, suppose the meaning information corresponding to the preset low-frequency word includes first meaning information X. note1 ={x a1 ,x a2 ,x a3 ,x a4 ,x a5} and second meaning information X note2 ={x b1 ,x b2 ,x b3 ,x b4 ,x b5}, through the first meaning information X note1 Second meaning information X note2 By splicing the data together, we can obtain the preset meaning information X. note ={x a1 ,x a2 ,x a3 ,x a4 ,x a5 [SEP],x b1 ,x b2 ,x b3 ,x b4 ,x b5}; where [SEP] above is the splicing identifier.

[0070] In a specific embodiment, based on the first mapping relationship, the preset meaning information corresponding to each target low-frequency word can be sequentially searched, and the target meaning information can be generated based on the preset meaning information corresponding to each target low-frequency word.

[0071] In one specific embodiment, the above method may further include:

[0072] Obtain at least one target word;

[0073] Information capture and analysis are performed on at least one target word to obtain the word meaning information corresponding to each target word.

[0074] Based on at least one target word and word meaning information, construct at least one second mapping relationship between the target word and word meaning information;

[0075] Add the second mapping relationship to the first mapping relationship.

[0076] In a specific embodiment, the target word can refer to a word that needs to be updated to a preset low-frequency word set. The target word can be a newly generated word within a preset time period and / or a popular word within the preset time period. Optionally, the preset time period can be one month prior to the current moment. For example, the target word can include "involution," etc.; when "involution" is used as the target word, the semantic information of "involution" can include "involution can refer to a phenomenon where a cultural pattern, after reaching a certain final form, can neither stabilize nor transform into a new form, but can only continuously become more complex internally" (i.e., the semantic information of "involution" belongs to non-low-frequency words) and "involution can refer to the phenomenon where peers compete to exert more effort to fight for limited resources, thereby leading to a decrease in the individual's 'effort-to-reward ratio'" (i.e., the semantic information of "involution" belongs to low-frequency words).

[0077] In one specific embodiment, the target words can be generated and updated by a second user terminal, or they can be obtained by the error detection server from at least one preset data source at preset time intervals. Specifically, the second user terminal can be a terminal of the error detection service maintainer on the error detection system; the error detection server can be the server of the error detection system.

[0078] In one specific embodiment, the word meaning information corresponding to each target word can be at least one meaning of the target word. It is understood that when a target word has multiple meanings, the word meaning information of the target word can include the meaning of the target word as a low-frequency word, and it can also include the meaning of the target word as a commonly used word; for example, the word meaning information of the target word can include all the meanings of the target word.

[0079] In one specific embodiment, the error detection server can obtain the word meaning information corresponding to at least one target word by extracting and analyzing information from multiple preset data sources.

[0080] In one specific embodiment, after the error detection server performs information capture and analysis from multiple preset data sources, the second user terminal can review the word meaning information of the target word by the error detection server; if the meaning is incorrect or other corrections are needed, the second user terminal can correct the incorrect word meaning information.

[0081] In the above embodiments, by correcting the meaning information of incorrect words, the error detection system can better learn the meaning of the target words, thereby improving the accuracy of misspelling identification.

[0082] In a specific embodiment, the second mapping relationship can refer to a one-to-one correspondence between any target word and any word meaning information.

[0083] In the above embodiments, by acquiring at least one target word, performing information capture and analysis on the at least one target word, obtaining the word meaning information corresponding to each of the at least one target word, constructing a second mapping relationship between the at least one target word and the word meaning information based on the at least one target word and the word meaning information, and adding the second mapping relationship to the first mapping relationship, the first mapping relationship can be updated, and the timeliness and convenience of updating the first mapping relationship are improved.

[0084] In step S207, text fusion processing is performed on the text information to be identified and the target meaning information to obtain the target text information.

[0085] In one specific embodiment, the target text information can be text information carrying both the text information to be identified and the target meaning information. Specifically, the target text information may include concatenated text information and target tree structure information. It is understood that the specific fusion method of text fusion processing will result in different forms of representation of the target text information.

[0086] In a specific embodiment, when the target text information is concatenated text information, step S207 above may include:

[0087] The text information to be identified and the target meaning information are concatenated to obtain concatenated text information.

[0088] The target text information is generated based on the concatenated text information.

[0089] In one specific embodiment, the concatenated text information may include text information to be recognized, target meaning information, and concatenation identifier information. The concatenation identifier information can be set between two different pieces of text information, and can be used to separate the two different pieces of text information. It is understood that the concatenation identifier information can be set between the text information to be recognized and the target meaning information, and can be used to separate the text information to be recognized and the target meaning information.

[0090] In one specific embodiment, concatenated text information can be obtained by appending concatenation identifier information to one end of the text information to be recognized, and then appending the target meaning information to the other end of the concatenation identifier information. The other end of the concatenation identifier information can refer to the end of the concatenation identifier information that is different from the text information to be recognized. For example, suppose the text information to be recognized is X = {x1, x2, x3, ..., x...} n}, a segment of text X in the text information to be recognized i,j ={x i ,...,x j} represents a target low-frequency word, and the target meaning information corresponding to this target low-frequency word is: By concatenating the text information to be identified and the target meaning information, we can obtain concatenated text information. Wherein, [CLS] is the text start identifier and [SEP] is the concatenation identifier.

[0091] In one specific embodiment, the target text information may further include text identification information. The text identification information may include a text identifier corresponding to any text unit in the concatenated text information. The text identifier corresponding to any text unit can be used to indicate whether the text unit belongs to the text information to be identified or to the target meaning information. The text identifier may include a first identifier and a second identifier; the first identifier can be used to indicate that the text unit corresponding to the first identifier belongs to the text information to be identified; the second identifier can be used to indicate that the text unit corresponding to the second identifier belongs to the target meaning information. Here, a text unit can refer to the smallest unit constituting text information. Optionally, the first identifier can be "0" and the second identifier can be "1". Through text identification information, the error detection system can distinguish between the portion of the target text information that belongs to the text information to be identified and the portion that belongs to the target meaning information, facilitating better learning of the target meaning information and thus improving the accuracy of misspelling recognition.

[0092] In one specific embodiment, target text information can be generated by combining concatenated text information and text identifier information. Specifically, concatenated text information and text identifier information can be used as target text information.

[0093] In the above embodiments, by performing text concatenation processing on the text information to be identified and the target meaning information, concatenated text information is obtained. Text concatenation processing can improve the convenience and timeliness of text fusion processing. Then, based on the concatenated text information, the target text information is generated. This allows the concatenated text information to retain the original meaning of the text information to be identified, avoiding the destruction of the original content and structure caused by replacing the target low-frequency words with the target meaning information, which would lead to a change in the original meaning of the text information to be identified. This can improve the accuracy of the model in identifying typos in the input information.

[0094] In a specific embodiment, when the target text information is target tree structure information, step S207 may further include:

[0095] Based on the target meaning information, identify at least one associated word corresponding to each of at least one target low-frequency word;

[0096] The target tree structure information is constructed by using the text information to be identified as the main node and the low-frequency word node in the main node as the branch node, with at least one related word as the main node.

[0097] In a specific embodiment, at least one associated word corresponding to any target low-frequency word can be a word that can characterize the meaning information corresponding to the target low-frequency word. Specifically, by performing word segmentation on the meaning information of each target low-frequency word, multiple first segment words corresponding to each target low-frequency word can be obtained. Then, word segmentation analysis can be performed on the multiple first segment words corresponding to each target low-frequency word to obtain the characterization weight of each first segment word for the meaning information of any target low-frequency word. The first segment word with a characterization weight greater than a preset weight can be used as the associated word corresponding to the target low-frequency word. For example, assuming the target low-frequency word is "XX (name of a city)", and the meaning information of the target low-frequency word is "XX is the capital city of a province in China", then the associated words corresponding to the target low-frequency word can include "China", "capital city", and "city", etc.

[0098] In one specific embodiment, a low-frequency word node can be the main node where the target low-frequency word corresponding to at least one related word is located.

[0099] In a specific embodiment, multiple second words can be obtained by segmenting the text information to be identified. If any target low-frequency word is one of the multiple second words, any second word can be used as any main node. If any target low-frequency word includes multiple words from the multiple second words, the multiple second words corresponding to any target low-frequency word can be used as one main node, and other second words that do not belong to the target low-frequency word can be used as different main nodes. By using at least one related word corresponding to the low-frequency word node in the main node as a branch node of the low-frequency word node, the target tree structure information can be constructed.

[0100] In the above embodiments, a target tree structure can be constructed by using the text information to be identified as the main node and at least one related word as a branch node of the low-frequency word node in the main node. This can preserve the original meaning of the text information while integrating the target meaning information into it. This avoids the destruction of the original content and structure caused by replacing the target low-frequency word with the target meaning information, which would lead to a change in the original meaning of the text information to be identified. In this way, the accuracy of the model in identifying misspelled words in the input information can be improved.

[0101] In step S209, the target text information is subjected to typo recognition to obtain the target recognition result.

[0102] In one specific embodiment, the target recognition result can be used to indicate text units in the target text information that are misspelled. For example, in the case of a Chinese language scenario, a text unit can be a single Chinese character. The target recognition result can include error detection identifiers corresponding to multiple text units in the target text information; these error detection identifiers can include a third identifier and a fourth identifier; the third identifier can be used to indicate that the text unit corresponding to the third identifier is a misspelled character; the fourth identifier can be used to indicate that the text unit corresponding to the fourth identifier is not a misspelled character.

[0103] In one specific embodiment, the first user terminal can display a misspelling recognition page based on the target recognition result. The misspelling recognition page can be used to display text units that are misspelled in the target text information.

[0104] In a specific embodiment, a misspelling recognition model can be used to identify misspellings in the target text information to obtain the target recognition result. Specifically, step S209 above may include:

[0105] The target text information is encoded to obtain the target encoded information;

[0106] Character analysis is performed on the target encoded information to obtain typo indication information;

[0107] Based on the misspelling information, target recognition results are generated.

[0108] In one specific embodiment, the target encoding information can represent the context information of any text unit in the target text information. The representation of the target encoding information may include vectors or matrices, etc., and this disclosure does not limit it.

[0109] In one specific embodiment, the misspelling indication information can characterize the probability that any text unit in the text information to be identified is a misspelling. The misspelling indication information may include the error probabilities corresponding to multiple text units in the text information to be identified; wherein, the error probability corresponding to any one of the text units can be the probability that the text unit is a misspelling in the text information to be identified.

[0110] In one specific embodiment, the misspelling recognition model may include a preset language representation model and a preset classification model. Specifically, the target text information can be encoded using the preset language representation model in the misspelling recognition model to obtain target encoded information; the target encoded information can be analyzed using the preset classification model in the misspelling recognition model to obtain misspelling indication information.

[0111] In one specific embodiment, target text information can be obtained by inputting it into a pre-trained language representation model for encoding. Optionally, the pre-trained language representation model can be a pre-trained BERT model (Bidirectional Encoder Representation from Transformers). Specifically, target text information can be obtained by inputting it into a pre-trained BERT model for encoding. The target encoding information H can be obtained using the following formula:

[0112] H = BERT(X) * )

[0113] Among them, X * The target text information; BERT() is the preset language representation model.

[0114] In a specific embodiment, misspelling indication information can be obtained by inputting the target encoded information into a preset classification model for character analysis. Optionally, the preset classification model can be a pre-trained FFN (Feedforward Neural Network). Specifically, misspelling indication information can be obtained by inputting the target encoded information into a pre-trained FFN for character analysis. The activation function of the last layer of the FFN can be a Sigmoid function. Through the Sigmoid function of the last layer of the FFN, the error probability corresponding to each of the multiple text units in the text information to be recognized can be obtained. The misspelling indication information P can be obtained by the following formula:

[0115] P = FFN(H)

[0116] Where H represents the target encoding information; FFN() represents the preset classification model.

[0117] In one specific embodiment, the text unit with an error probability greater than a preset probability threshold in the misspelling indication information can be designated as the erroneous text unit. A third identifier can be used as the error detection identifier corresponding to the erroneous text unit, and a fourth identifier can be used as the error detection identifier corresponding to the text unit other than the erroneous text unit in the text information to be identified, thus obtaining the target recognition result. Here, the erroneous text unit can refer to a text unit in the text information to be identified that is a misspelling. The preset probability threshold can be set according to actual application needs, and this disclosure does not limit it.

[0118] In one specific embodiment, the misspelling recognition model can be trained based on the sample text information to be recognized and the sample indication information to obtain the misspelling recognition model. The recognition model to be trained can include a language representation model to be trained and a classification model to be trained. Optionally, the language representation model to be trained can be a BERT model; the classification model to be trained can be an FFN model.

[0119] In a specific embodiment, low-frequency word detection can be performed on the sample text information to be identified to obtain at least one sample low-frequency word in the sample text information; sample meaning information corresponding to the at least one sample low-frequency word can be obtained, and the sample meaning information can be at least one meaning information corresponding to any sample low-frequency word; text fusion processing can be performed on the sample text information to be identified and the sample meaning information to obtain sample text information; the sample text information can be input into the language representation model to be trained for encoding processing to obtain sample encoding information; the sample encoding information can be input into the classification model to be trained for character analysis to obtain sample misspelling indication information; based on the sample misspelling indication information and the sample indication information, loss information can be determined; based on the above loss information, the language representation model to be trained and the classification model to be trained in the recognition model to be trained can be trained to obtain the above-mentioned preset language representation model and preset classification model.

[0120] In the above embodiments, by acquiring the text information to be identified and performing low-frequency word detection on the text information to be identified, at least one target low-frequency word with a low frequency of occurrence in the text information to be identified can be determined. Then, the target meaning information corresponding to the at least one target low-frequency word is acquired, and the target text information incorporating the meaning information of the target low-frequency word is used to identify misspelled words. This allows the error detection system to learn the meaning of the target low-frequency word during the misspelling identification process, which can avoid missed detection and over-detection due to the fact that the training data of the misspelling identification model has very few target low-frequency words, thereby improving the accuracy of misspelling identification in the text.

[0121] Figure 3 This is a schematic diagram illustrating the model architecture of a text error detection method according to an exemplary embodiment. For example... Figure 3As shown, the text information to be identified can be "nodule examination," where the preset low-frequency word set can include "test" and "nodule," etc. By performing low-frequency word detection on the text information to be identified, the target low-frequency word in the text information to be identified (i.e., "nodule examination") can be found to be "nodule." Based on the first mapping relationship between multiple preset low-frequency words and multiple preset meaning information, the target meaning information of the target low-frequency word (i.e., "nodule") can be found to be "lung nodules are a disease." By performing text concatenation processing on the text information to be identified and the target meaning information, the concatenated text information "[CLS]nodule examination [SEP]lung nodules are a disease [SEP]" can be obtained, and this concatenated text information can be used as the target text information. By inputting the target text information into the preset language representation model for encoding processing, the encoding information of each text unit in the target text information can be obtained, and correspondingly, the target encoding information can be obtained. Inputting the aforementioned target encoding information into a preset classification model for character analysis yields the misspelling indication information P = {0,0,0,0,0,0}, where the "0" in the misspelling indication information can be the fourth identifier in the error detection identifier. Based on the misspelling indication information, target recognition results can be generated.

[0122] Figure 4 This is a schematic diagram illustrating a typo recognition page according to an exemplary embodiment. For example... Figure 4 As shown, the user enters "The nation's X1X2 lies in its youth" in the text input box. The first user terminal generates the text information to be recognized in real time (i.e., "The nation's X1X2 lies in its youth"), and the error detection system can detect errors in the input text in the text box in real time. Through the above text error detection method, the target recognition result can be obtained (i.e., "X1" and "X2" in the text information to be recognized are typos). Correspondingly, the recognized typos and correction suggestions can be displayed through the first user terminal.

[0123] Figure 5 This is a block diagram illustrating a text error detection device according to an exemplary embodiment. Figure 5 As shown, the device may include:

[0124] The text acquisition module 510 can be used to acquire text information to be recognized;

[0125] The low-frequency word detection module 520 can be used to detect low-frequency words in the text information to be identified, and obtain at least one target low-frequency word in the text information to be identified.

[0126] The target meaning information acquisition module 530 can be used to acquire target meaning information corresponding to at least one target low-frequency word; the target meaning information is at least one meaning information corresponding to any target low-frequency word.

[0127] The text fusion processing module 540 can be used to perform text fusion processing on the text information to be recognized and the target meaning information to obtain the target text information;

[0128] The misspelling recognition module 550 can be used to identify misspellings in target text information and obtain the target recognition result.

[0129] In one specific embodiment, the text fusion processing module 540 described above may include:

[0130] The text splicing processing module can be used to splice the text information to be recognized and the target meaning information to obtain spliced ​​text information;

[0131] The first target text information determination module can be used to generate target text information based on concatenated text information.

[0132] In one specific embodiment, the text fusion processing module 540 may further include:

[0133] The associated word determination module can be used to determine at least one associated word corresponding to each of at least one target low-frequency word based on target meaning information;

[0134] The second target text information determination module can be used to construct target tree structure information with the text information to be identified as the main node and the low-frequency word node in the main node as the branch node of at least one related word; wherein, the low-frequency word node is the main node where the target low-frequency word corresponding to at least one related word is located.

[0135] In one specific embodiment, the above-described apparatus may further include:

[0136] The preset low-frequency word set acquisition module can be used to acquire a preset low-frequency word set; the preset low-frequency word set includes multiple preset low-frequency words;

[0137] In one specific embodiment, the low-frequency word detection module 520 described above may include:

[0138] The preset low-frequency word search module can be used to find multiple preset low-frequency words in the text information to be recognized;

[0139] The target low-frequency word determination module can be used to identify at least one preset low-frequency word as at least one target low-frequency word when at least one preset low-frequency word is found.

[0140] In one specific embodiment, the above-described apparatus may further include:

[0141] The first mapping relationship acquisition module can be used to acquire the first mapping relationship between multiple preset low-frequency words and multiple preset meaning information; any preset meaning information is at least one meaning information corresponding to any preset low-frequency word.

[0142] In one specific embodiment, the target meaning information acquisition module 530 may include:

[0143] The meaning information lookup module can be used to find the preset meaning information corresponding to at least one target low-frequency word based on the first mapping relationship, and obtain the target meaning information.

[0144] In one specific embodiment, the above-described apparatus may further include:

[0145] The target word acquisition module can be used to acquire at least one target word; the target word is a newly generated word within a preset time period and / or a popular word within a preset time period;

[0146] The information capture and analysis module can be used to capture and analyze information from at least one target word to obtain the word meaning information corresponding to each target word.

[0147] The second mapping relationship determination module can be used to construct at least one second mapping relationship between at least one target word and word meaning information based on at least one target word and word meaning information.

[0148] The first mapping update module can be used to add the second mapping to the first mapping.

[0149] In one specific embodiment, the above-mentioned misspelling recognition module 550 may include:

[0150] The encoding processing module can be used to encode target text information to obtain target encoded information;

[0151] The character analysis module can be used to perform character analysis on the target encoded information to obtain misspelling indication information. The misspelling indication information represents the probability that any text unit in the target text information is a misspelling.

[0152] The target recognition result generation module can be used to generate target recognition results based on misspelling indication information.

[0153] Regarding the apparatus in the above embodiments, the specific manner in which each module and unit performs its operations has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0154] Figure 6 This is a block diagram illustrating an electronic device for generating target recognition results according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, this electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a text error detection method.

[0155] Figure 7 This is a block diagram illustrating another electronic device for generating target recognition results according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the electronic device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a text error detection method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.

[0156] Those skilled in the art will understand that Figure 6 or Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present disclosure and does not constitute a limitation on the electronic device to which the present disclosure is applied. A specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0157] In an exemplary embodiment, an electronic device is also provided, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement a text error detection method as described in the embodiments of this disclosure.

[0158] In an exemplary embodiment, a computer-readable storage medium is also provided, wherein when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the text error detection method of the present disclosure embodiments.

[0159] In an exemplary embodiment, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the text error detection method of the present disclosure embodiments.

[0160] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0161] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0162] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0163] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A text error detection method, characterized in that, The method includes: Obtain the text information to be recognized; Low-frequency word detection is performed on the text information to be identified to obtain at least one target low-frequency word in the text information to be identified; Obtain target meaning information corresponding to the at least one target low-frequency word; the target meaning information is at least one meaning information corresponding to any one of the target low-frequency words. The text information to be identified and the target meaning information are subjected to text fusion processing to obtain target text information; the target text information is text information carrying the text information to be identified and the target meaning information. The target text information is subjected to typo identification to obtain the target identification result; The method further includes: Obtain a preset low-frequency word set, a first mapping relationship between multiple preset low-frequency words and multiple preset meaning information included in the preset low-frequency word set, and at least one target word; any of the preset meaning information is at least one meaning information corresponding to any of the preset low-frequency words; the target word is a newly generated word within a preset time period and / or a popular word within the preset time period; Information capture and analysis are performed on the at least one target word to obtain the word meaning information corresponding to each of the at least one target word; Based on the at least one target word and the word meaning information, a second mapping relationship is constructed between the at least one target word and the word meaning information; Add the second mapping relationship to the first mapping relationship; The step of obtaining the target meaning information corresponding to the at least one target low-frequency word includes: Based on the first mapping relationship, the preset meaning information corresponding to the at least one target low-frequency word is searched to obtain the target meaning information; The target text information includes target tree structure information. The text fusion processing of the text information to be identified and the target meaning information to obtain the target text information includes: Based on the target meaning information, at least one associated word corresponding to each of the at least one target low-frequency words is determined; The target tree structure information is constructed by using the text information to be identified as the main node and the at least one associated word as the branch node of the low-frequency word node in the main node. The low-frequency word node is the main node where the target low-frequency word corresponding to the at least one associated word is located.

2. The method according to claim 1, characterized in that, The text fusion processing of the text information to be identified and the target meaning information to obtain the target text information includes: The text information to be identified and the target meaning information are concatenated to obtain concatenated text information. The target text information is generated based on the concatenated text information.

3. The method according to claim 1, characterized in that, The step of performing low-frequency word detection on the text information to be identified to obtain at least one target low-frequency word in the text information to be identified includes: Search for the plurality of preset low-frequency words in the text information to be identified; If at least one preset low-frequency word is found, the at least one preset low-frequency word is used as the at least one target low-frequency word.

4. The method according to any one of claims 1-3, characterized in that, The process of identifying misspelled words in the target text information to obtain the target identification result includes: The target text information is encoded to obtain target encoded information; Character analysis is performed on the target encoded information to obtain misspelling indication information, which represents the probability that any text unit in the text information to be identified is a misspelling; The target recognition result is generated based on the misspelling indication information.

5. A text error detection device, characterized in that, The device includes: The text to be recognized acquisition module is used to acquire the text information to be recognized; The low-frequency word detection module is used to perform low-frequency word detection on the text information to be identified, and obtain at least one target low-frequency word in the text information to be identified. The target meaning information acquisition module is used to acquire target meaning information corresponding to the at least one target low-frequency word; the target meaning information is at least one meaning information corresponding to any one of the target low-frequency words. The text fusion processing module is used to perform text fusion processing on the text information to be identified and the target meaning information to obtain target text information; the target text information is text information carrying the text information to be identified and the target meaning information. The misspelling detection module is used to identify misspellings in the target text information and obtain the target recognition result. The device further includes: A preset low-frequency word set acquisition module is used to acquire a preset low-frequency word set, a first mapping relationship between multiple preset low-frequency words and multiple preset meaning information included in the preset low-frequency word set, and at least one target word; any of the preset meaning information is at least one meaning information corresponding to any of the preset low-frequency words; the target word is a newly generated word within a preset time period and / or a popular word within the preset time period; The information capture and analysis module is used to perform information capture and analysis on the at least one target word to obtain the word meaning information corresponding to each of the at least one target word; The second mapping relationship determination module is used to construct a second mapping relationship between the at least one target word and the word meaning information based on the at least one target word and the word meaning information; The first mapping relationship update module is used to add the second mapping relationship to the first mapping relationship; The target meaning information acquisition module includes: The meaning information lookup module is used to look up the preset meaning information corresponding to the at least one target low-frequency word based on the first mapping relationship, and obtain the target meaning information; The target text information includes target tree structure information, and the text fusion processing module includes: The associated word determination module is used to determine at least one associated word corresponding to each of the at least one target low-frequency words based on the target meaning information; The second target text information determination module is used to construct the target tree structure information with the text information to be identified as the main node and the at least one associated word as the branch node of the low-frequency word node in the main node; wherein, the low-frequency word node is the main node where the target low-frequency word corresponding to the at least one associated word is located.

6. The apparatus according to claim 5, characterized in that, The text fusion processing module includes: The text splicing processing module is used to perform text splicing processing on the text information to be identified and the target meaning information to obtain spliced ​​text information; The first target text information determination module is used to generate the target text information based on the concatenated text information.

7. The apparatus according to claim 5, characterized in that, The low-frequency word detection module includes: A preset low-frequency word search module is used to search for the plurality of preset low-frequency words in the text information to be identified; The target low-frequency word determination module is used to identify at least one preset low-frequency word as the at least one target low-frequency word when at least one preset low-frequency word is found.

8. The apparatus according to any one of claims 5-7, characterized in that, The misspelling detection module includes: The encoding processing module is used to encode the target text information to obtain target encoded information; The character analysis module is used to perform character analysis on the target encoded information to obtain misspelling indication information, wherein the misspelling indication information represents the probability that any text unit in the text information to be identified is a misspelling; The target recognition result generation module is used to generate the target recognition result based on the misspelling indication information.

9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to execute the executable instructions to implement the text error detection method according to any one of claims 1 to 4.

10. A non-volatile computer-readable storage medium storing computer program instructions thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the text error detection method according to any one of claims 1 to 4.

11. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the text error detection method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method and device for generating spelling error correction model and method and device for spelling error correction

    CN114861637A