A training method of a recognition model, a recognition method and device of text data

By training a similarity model with synthetic text data and constructing a weight matrix, the problem of poor robustness caused by annotation noise in text recognition is solved, the recognition accuracy is improved, and the stability of the model is enhanced.

CN117009799BActive Publication Date: 2026-06-16GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU SHIYUAN ELECTRONICS CO LTD
Filing Date
2022-04-26
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

In text recognition, due to the diversity of categories and the existence of similar-looking characters, annotation noise leads to poor model robustness and low recognition accuracy, especially in handwritten scenarios where annotation errors are difficult to avoid.

Method used

By acquiring the first text data synthesized from real text, a similarity model is trained, a similarity matrix is ​​constructed and weight values ​​are determined, and a pre-set neural network model is trained using the weight values ​​to reduce the impact of annotation noise and improve the robustness of the model.

🎯Benefits of technology

It effectively reduced the impact of annotation noise on the model, improved the accuracy of model recognition, and enhanced the robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117009799B_ABST
    Figure CN117009799B_ABST
Patent Text Reader

Abstract

The application discloses a training method of a recognition model, a recognition method and device of text data. The method comprises the following steps: a similarity model is trained by using text data synthesized by real text, so that the condition of insufficient real text data can be met. The similarity model is trained by using text data synthesized by real text, and then, each two text data of the same text category in the real text are input into the similarity model to construct a similarity matrix corresponding to each text category in the real text. Then, the weight value corresponding to each real text data is determined by using the similarity matrix, so that the weight value of the text data carrying label noise in the real text data is effectively reduced before the neural network model is trained by using the real text data. In addition, the influence of the label noise of the text data on the model when the preset neural network model is trained by using the real text data is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method for training a recognition model, a method for recognizing text data, and an apparatus. Background Technology

[0002] Text recognition often requires numerous categories. For example, in character recognition, according to the "Chinese Character Library" project, there are nearly 100,000 Chinese characters. Even in daily life, the number of commonly used Chinese characters reaches around 8,000. When training character recognition models, staff need to label each character's category. However, with so many categories, labeling errors are inevitable. In addition to the diverse categories, there are many similar-looking characters, which further exacerbate labeling errors. Therefore, labeling cannot be 100% accurate, especially in handwritten contexts.

[0003] Therefore, in the process of developing this invention, the inventors discovered that text data contains annotation noise, which can be caused by incorrect category labeling. If the model is trained directly using text data with annotation noise, the robustness of the model will decrease, and the model's recognition accuracy will be low. Summary of the Invention

[0004] To solve the above-mentioned technical problems, or at least partially solve them, this application provides a method for training a recognition model, a method for recognizing text data, and an apparatus.

[0005] According to one aspect of the embodiments of this application, a method for training a recognition model is provided, comprising:

[0006] A similarity model is obtained by training a first text data synthesized from real text, wherein the real text includes second text data corresponding to at least one text category, and the first text data includes: second text data and third text data that has a similarity relationship with the second text data;

[0007] The similarity matrix corresponding to each text category is constructed using the second text data and the similarity model, and the weight value corresponding to each text data in the second text data is determined based on the similarity matrix.

[0008] A preset neural network model is trained using the text category and the second text data, and the loss function value of the preset neural network model during the training process is calculated using the weight values;

[0009] If the loss function value meets a preset threshold, the preset neural network model is determined as the recognition model.

[0010] Furthermore, the step of obtaining the similarity model trained using the first text data synthesized from real text includes:

[0011] Generate third text data that has a similar relationship to the second text data;

[0012] The first text data is obtained by combining the second text data and the third text data;

[0013] A preset similarity model is trained using the first text data, so that the preset similarity model learns the similarity relationship between the second and third text data in the first text data, thus obtaining a similarity model.

[0014] Furthermore, the step of constructing a similarity matrix for each text category using the second text data and the similarity model includes:

[0015] The second text data is input into the similarity model so that the similarity model extracts the text features of each text data in the second text data and calculates the similarity between every two text data in the second text data based on the text features;

[0016] Based on the aforementioned similarity, a similarity matrix is ​​constructed for the text categories corresponding to the second text data.

[0017] Furthermore, determining the weight value corresponding to each text data in the second text data based on the similarity matrix includes:

[0018] Obtain the similarity set between each text data in the second text data and other text data in the second text data from the similarity matrix;

[0019] Based on the similarity carried in the similarity set and the number of similarities, the average similarity corresponding to each text data in the second text data is calculated;

[0020] The average similarity is determined as the weight value.

[0021] Furthermore, the step of training a preset neural network model using the text category and the second text data, and calculating the loss function value of the preset neural network model during the training process using the weight values, includes:

[0022] The second text data is input into the preset neural network model to obtain the target text category of each text data in the second text data, and the category score corresponding to the target text category;

[0023] The loss function value of the preset neural network model is calculated using the weight values ​​and the category scores.

[0024] According to another aspect of the embodiments of this application, a method for recognizing text data is also provided, which utilizes the above-described recognition model and includes:

[0025] Obtain the text data to be recognized;

[0026] Obtain a pre-trained recognition model, wherein the pre-trained recognition model is a similarity model trained using first text data synthesized from real text, and a second text data corresponding to real text in the first text data. The first text data includes: the second text data, and a third text data that has a similarity relationship with the second text data. The similarity model is used to determine the weight value corresponding to each text data in the second text data.

[0027] The text data to be identified is input into the recognition model so that the recognition model extracts the text features corresponding to the text data to be identified and determines the text category corresponding to the text data to be identified based on the text features.

[0028] According to another aspect of the embodiments of this application, a training apparatus for a recognition model is also provided, comprising:

[0029] The acquisition module is used to acquire a similarity model trained using first text data synthesized from real text, wherein the real text includes second text data corresponding to at least one text category, and the first text data includes: second text data and third text data that has a similarity relationship with the second text data;

[0030] The processing module is used to construct a similarity matrix corresponding to each text category using the second text data and the similarity model, and to determine the weight value corresponding to each text data in the second text data based on the similarity matrix;

[0031] The training module is used to train a preset neural network model using the text category and the second text data, and to calculate the loss function value of the preset neural network model during the training process using the weight values.

[0032] The determination module is used to determine the preset neural network model as the recognition model when the loss function value meets a preset threshold.

[0033] According to another aspect of the embodiments of this application, a text data recognition device is also provided, comprising:

[0034] The first acquisition module is used to acquire the text data to be recognized;

[0035] The second acquisition module is used to acquire a pre-trained recognition model, wherein the pre-trained recognition model is a similarity model trained using first text data synthesized from real text, and a second text data trained using real text data corresponding to the first text data. The first text data includes: the second text data, and third text data that has a similarity relationship with the second text data. The similarity model is used to determine the weight value corresponding to each text data in the second text data.

[0036] The processing module is used to input the text data to be identified into the recognition model, so that the recognition model extracts the text features corresponding to the text data to be identified, and determines the text category corresponding to the text to be identified based on the text features.

[0037] According to another aspect of the embodiments of this application, a storage medium is also provided, the storage medium including a stored program that executes the above steps when the program is run.

[0038] According to another aspect of the embodiments of this application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the programs stored in the memory.

[0039] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the steps in the above-described method.

[0040] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application first trains a similarity model using text data synthesized from real text, which can address situations where real text data is insufficient. Simultaneously, it trains the similarity model using text data synthesized from real text, and then inputs every two text data points of the same text category from the real text into the similarity model to construct a similarity matrix corresponding to each text category in the real text. Then, it uses the similarity matrix to determine the weight value corresponding to each piece of real text data. Before training the neural network model using real text data, this effectively reduces the weight values ​​of text data carrying annotation noise in the real text data. Furthermore, it avoids the impact of annotation noise on the model when training a preset neural network model using real text data. Attached Figure Description

[0041] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0042] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 A flowchart illustrating a training method for a recognition model provided in an embodiment of this application;

[0044] Figure 2 A flowchart illustrating a text data recognition method provided in this application embodiment;

[0045] Figure 3 A block diagram of a training device for a recognition model provided in an embodiment of this application;

[0046] Figure 4 A block diagram of a text data recognition device provided in an embodiment of this application;

[0047] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute an improper limitation of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0049] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another similar entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0050] This application provides a method for training a recognition model, a method for recognizing text data, and an apparatus. The method provided by this invention can be applied to any electronic device as needed, such as a server, terminal, or other electronic device. No specific limitation is made here, and for ease of description, it will be referred to as an electronic device below.

[0051] According to one aspect of the embodiments of this application, a method embodiment for training a recognition model is provided. Figure 1 A flowchart illustrating a training method for a recognition model provided in this application embodiment is shown below. Figure 1 As shown, the method includes:

[0052] Step S11: Obtain the similarity model trained using first text data synthesized from real text. The real text includes second text data corresponding to at least one text category. The first text data includes the second text data and third text data that has a similarity relationship with the second text data. The second and third text data can be single-character images.

[0053] In this embodiment, before synthesizing the first text data, it is necessary to obtain real text for model training. The real text includes at least one text category and second text data corresponding to each text category. Since there is little text data available for training in the real text, synthesizing the first text data using real text can compensate for the lack of real data.

[0054] In this embodiment of the application, step S11, obtaining the similarity model trained using the first text data synthesized from real text, includes the following steps A1-A3:

[0055] Step A1: Generate third text data that has a similar relationship to the second text data.

[0056] Step A2: Combine the second text data and the third text data to obtain the first text data.

[0057] Step A3: Train a preset similarity model using the first text data so that the preset similarity model learns the similarity relationship between the second and third text data in the first text data, and obtains the similarity model.

[0058] In this embodiment, third text data with a similar relationship to the second text data is generated, and the third text data and the second text data corresponding to the real text are combined to obtain the first text data. It should be noted that the real text includes at least one text category and second text data corresponding to each text category.

[0059] It should be noted that training the model directly using the second text data corresponding to the real text would result in label noise. Therefore, the embodiments of this application use synthetic text data to avoid label noise. Label noise generally falls into two categories: anomalous labels, where the labeled category does not belong to any category in the current category; and label flipping, where the labeled category belongs to another category in the current category. Due to the large number of text categories, both types of label noise are common in real text data.

[0060] Furthermore, directly training a neural network model using the synthesized first text data would result in poor training performance. Therefore, this embodiment uses the synthesized first text data to train a preset similarity model. By training the preset similarity model, the model learns the similarity relationship between the second and third text data, thus obtaining a similarity model. The preset similarity model can be ResNet or VGG (Visual Geometry Group). The similarity model can determine the weight values ​​corresponding to each text data in the second text data when training the neural network model subsequently.

[0061] Step S12: Construct a similarity matrix for each text category using the second text data and the similarity model, and determine the weight value for each text data in the second text data based on the similarity matrix.

[0062] In this embodiment of the application, a similarity matrix corresponding to each text category is constructed using the second text data and a similarity model, including the following steps B1-B2:

[0063] Step B1: Input the second text data into the similarity model so that the similarity model extracts the text features of each text data in the second text data and calculates the similarity between every two text data in the second text data based on the text features.

[0064] Step B2: Construct a similarity matrix for the text category corresponding to the second text data based on the similarity.

[0065] In this embodiment of the application, the second text data of text category i is input into the similarity model. The similarity model extracts the text features of each text data in the second text data, calculates the similarity between every two text data in the second text data based on the text features, and constructs the similarity matrix corresponding to text category i based on the similarity between every two text data.

[0066] As an example, for the second text data with text category i, there are a total of N in the real data. i A number of images. After inputting all text data within this category into the similarity model, a similarity matrix can be obtained. Where j and k represent different text data in text category i, and the similarity between any two text data is represented as .

[0067] In this embodiment of the application, determining the weight value corresponding to each text data in the second text data based on the similarity matrix includes the following steps C1-C3:

[0068] Step C1: Obtain the similarity set between each text data in the second text data and other text data in the second text data from the similarity matrix.

[0069] Step C2: Based on the similarity carried in the similarity set and the number of similarities, calculate the average similarity corresponding to each text data in the second text data.

[0070] Step C3: Determine the average similarity as the weight value.

[0071] In this embodiment, after obtaining the similarity matrix, a similarity set corresponding to each text data in the second text data is retrieved from the similarity matrix. The similarity set includes the similarity between the text data and other text data in the second text data of the same category. Therefore, based on the similarity and quantity in the similarity set, the average similarity corresponding to the text data can be calculated, and the average similarity can be used as the weight value of the text data. The calculation process for the weight value is as follows:

[0072] In the formula, N represents the weight value corresponding to the j-th text in text category i. i Let i be the amount of text data corresponding to text category i. The similarity between text data j and k of category i. Let be the similarity between text data k and j of text category i.

[0073] Finally, the weight values ​​are normalized to the range [0,1] using the following formula.

[0074]

[0075] It should be noted that the embodiments of this application determine the weight value of each text data in the real text through a similarity matrix. The purpose is to reduce the weight of text data carrying annotation noise, thereby helping to reduce the impact of annotation noise (e.g., text data annotation errors) on the model when using text data to train the model in the future, and improving the robustness of the model.

[0076] Step S13: Train a preset neural network model using text categories and second text data, and calculate the loss function value of the preset neural network model during the training process using weight values.

[0077] In this embodiment, step S13, training a preset neural network model using text categories and second text data, and calculating the loss function value of the preset neural network model during training using weight values, includes the following steps D1-D2:

[0078] Step D1: Input the second text data into the preset neural network model to obtain the target text category of each text data in the second text data, and the category score corresponding to the target text category.

[0079] In this embodiment, annotation information corresponding to the second text data is obtained. This annotation information is used to annotate the text features of the second text data and the text category corresponding to those text features. The second text data is input into a preset neural network model. The preset neural network model extracts the text features of the second text data and learns the correspondence between text features and text categories. Then, based on this relationship, it outputs the target text category corresponding to the text features and calculates the category score corresponding to the target text category. The category score is mainly calculated by a fully connected layer (FC layer) and softmax, as shown in the following formula:

[0080] f i =softmax(FC(x)) where x is the feature extracted by the backbone, softmax is the activation function, and softmax is calculated as follows: n is the total number of categories, z j The output of the j-th fully connected layer, where e is the exponent.

[0081] Step D2: Calculate the loss function value of the preset neural network model using the weight values ​​and category scores.

[0082] In this embodiment, the formula for calculating the loss function value of the preset neural network model using weight values ​​and category scores is as follows:

[0083] In the formula, loss is the value of the loss function, and B is the value of the batch size. f(I) represents the weight value corresponding to text category i. b ) i The category score is assigned to the target text category.

[0084] Step S14: If the loss function value meets the preset threshold, the preset neural network model is determined as the recognition model.

[0085] In this embodiment, when the loss function value is less than a preset threshold, it is determined that the loss function value meets the preset threshold, indicating that the training effect of the preset neural network model has reached the preset effect. Therefore, the preset neural network model can be directly determined as the recognition model.

[0086] The method provided in this application first trains a similarity model using text data synthesized from real text, which can address situations where real text data is insufficient. Simultaneously, the similarity model is trained using text data synthesized from real text. Next, every two text data points of the same text category from the real text are input into the similarity model to construct a similarity matrix corresponding to each text category in the real text. Then, the similarity matrix is ​​used to determine the weight value corresponding to each piece of real text data. Before training the neural network model using real text data, this effectively reduces the weight values ​​of text data carrying annotation noise in the real text data. Furthermore, it avoids the impact of annotation noise on the model when training a pre-defined neural network model using real text data.

[0087] Figure 2 A flowchart of a text data recognition method provided in this application embodiment is shown below. Figure 2 As shown, the method may include the following steps:

[0088] Step S21: Obtain the text data to be recognized.

[0089] In this embodiment of the application, raw text data is obtained, which may include multiple raw single-character images. Then, the raw text data is normalized, and the normalized raw text data is determined as the text data to be identified.

[0090] As an example, the process of performing normalization on the original text data includes: extracting the corresponding character features from the original single-character image; normalizing the original single-character image based on the character features in terms of overall style, overall size, font type, character size, and character position to obtain the normalized single-character image, and identifying it as the text data to be recognized.

[0091] Step S22: Obtain a pre-trained recognition model. The pre-trained recognition model is a similarity model trained using first text data synthesized from real text, and a second text data corresponding to real text in the first text data. The first text data includes: second text data, and third text data that has a similar relationship with the second text data. The similarity model is used to determine the weight value corresponding to each text data in the second text data.

[0092] In this embodiment, the process of obtaining the recognition model includes: obtaining a similarity model trained using first text data synthesized from real text, wherein the real text includes second text data corresponding to at least one text category, and the first text data includes: second text data and third text data having a similar relationship with the second text data; constructing a similarity matrix corresponding to each text category using the second text data and the similarity model, and determining the weight value corresponding to each text data in the second text data based on the similarity matrix; training a preset neural network model using the text categories and the second text data, and calculating the loss function value of the preset neural network model during the training process using the weight values; and determining the preset neural network model as the recognition model when the loss function value meets a preset threshold.

[0093] Step S23: Input the text data to be recognized into the recognition model so that the recognition model can extract the text features corresponding to the text data to be recognized and determine the text category corresponding to the text to be recognized based on the text features.

[0094] In this embodiment of the application, the text to be identified is input into the recognition model, the recognition model extracts the text features of the text data to be identified, and then determines the text category corresponding to the currently extracted text features based on the correspondence between the preset text features and text categories.

[0095] In the training process of the recognition model, this application embodiment uses a similarity matrix to determine the weight value corresponding to each real text data. Before training the neural network model with real text data, it effectively reduces the weight value of text data carrying annotation noise in the real text data, reduces the impact of annotation noise on the model, and improves the accuracy of model recognition.

[0096] Figure 3 This is a block diagram of a training device for a recognition model provided in an embodiment of this application. This device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 3 As shown, the device includes:

[0097] The acquisition module 31 is used to acquire a similarity model trained using first text data synthesized from real text, wherein the real text includes at least one text category and second text data corresponding to each text category;

[0098] Processing module 32 is used to construct a similarity matrix corresponding to each text category using the second text data and the similarity model, and to determine the weight value corresponding to each text data in the second text data based on the similarity matrix;

[0099] Training module 33 is used to train a preset neural network model using text categories and second text data, and to calculate the loss function value of the preset neural network model during the training process using weight values.

[0100] The determination module 34 is used to determine the preset neural network model as the recognition model when the loss function value meets the preset threshold.

[0101] In this embodiment of the application, the acquisition module 31 is used to generate third text data that has a similar relationship with the second text data; synthesize the second text data and the third text data to obtain first text data; and use the first text data to train a preset similarity model so that the preset similarity model learns the similarity relationship between the second text data and the third text data in the first text data to obtain a similarity model.

[0102] In this embodiment of the application, the processing module 32 is used to input the second text data into the similarity model so that the similarity model extracts the text features of each text data in the second text data, calculates the similarity between every two text data in the second text data based on the text features, and constructs a similarity matrix of the text category corresponding to the second text data based on the similarity.

[0103] In this embodiment of the application, the processing module 32 is used to obtain the similarity set between each text data in the second text data and other text data in the second text data from the similarity matrix; calculate the average similarity corresponding to each text data in the second text data based on the similarity carried in the similarity set and the number of similarities; and determine the average similarity as a weight value.

[0104] In this embodiment, the training module 33 is used to input the second text data into a preset neural network model to obtain the target text category of each text data in the second text data, and the category score corresponding to the target text category; and to calculate the loss function value of the preset neural network model using the weight value and the category score.

[0105] Figure 4 This is a block diagram of a text data recognition device provided in an embodiment of this application. This device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 4 As shown, the device includes:

[0106] The first acquisition module 41 is used to acquire the text data to be recognized;

[0107] The second acquisition module 42 is used to acquire a pre-trained recognition model, wherein the pre-trained recognition model is a similarity model trained using first text data synthesized from real text, and a second text data trained using real text data corresponding to the first text data. The first text data includes: second text data, and third text data that has a similar relationship with the second text data. The similarity model is used to determine the weight value corresponding to each text data in the second text data.

[0108] The processing module 43 is used to input the text data to be recognized into the recognition model so that the recognition model can extract the text features corresponding to the text data to be recognized and determine the text category corresponding to the text to be recognized based on the text features.

[0109] This application also provides an electronic device, such as... Figure 5 As shown, the electronic device may include: a processor 1501, a communication interface 1502, a memory 1503, and a communication bus 1504, wherein the processor 1501, the communication interface 1502, and the memory 1503 communicate with each other through the communication bus 1504.

[0110] Memory 1503 is used to store computer programs;

[0111] When the processor 1501 executes the computer program stored in the memory 1503, it implements the steps of the above embodiments.

[0112] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus.

[0113] The communication interface is used for communication between the aforementioned terminal and other devices.

[0114] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0115] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0116] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform the training method of the recognition model and the text data recognition method described in any of the above embodiments.

[0117] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute the training method of the recognition model and the text data recognition method described in any of the above embodiments.

[0118] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state drive).

[0119] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

[0120] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for training a recognition model, characterized in that, include: A similarity model is obtained by training a first text data synthesized from real text, wherein the real text includes second text data corresponding to at least one text category, and the first text data includes: second text data and third text data that has a similarity relationship with the second text data; The similarity matrix corresponding to each text category is constructed using the second text data and the similarity model, and the weight value corresponding to each text data in the second text data is determined based on the similarity matrix, so as to reduce the weight of text data carrying annotation noise. A preset neural network model is trained using the text category and the second text data, and the loss function value of the preset neural network model during the training process is calculated using the weight values; If the loss function value meets a preset threshold, the preset neural network model is determined as the recognition model; The step of obtaining a similarity model trained using first text data synthesized from real text includes: generating third text data that has a similarity relationship with the second text data; synthesizing the second text data and the third text data to obtain the first text data; and training a preset similarity model using the first text data so that the preset similarity model learns the similarity relationship between the second text data and the third text data in the first text data to obtain a similarity model. The step of determining the weight value corresponding to each text data in the second text data based on the similarity matrix includes: obtaining a similarity set between each text data in the second text data and other text data in the second text data from the similarity matrix; calculating the average similarity corresponding to each text data in the second text data based on the similarity carried in the similarity set and the number of similarities; and determining the average similarity as the weight value.

2. The method according to claim 1, characterized in that, The step of constructing a similarity matrix for each text category using the second text data and the similarity model includes: The second text data is input into the similarity model so that the similarity model extracts the text features of each text data in the second text data and calculates the similarity between every two text data in the second text data based on the text features; Based on the aforementioned similarity, a similarity matrix is ​​constructed for the text categories corresponding to the second text data.

3. The method according to claim 1, characterized in that, The step of training a preset neural network model using the text category and the second text data, and calculating the loss function value of the preset neural network model during the training process using the weight values, includes: The second text data is input into the preset neural network model to obtain the target text category of each text data in the second text data, and the category score corresponding to the target text category; The loss function value of the preset neural network model is calculated using the weight values ​​and the category scores.

4. A method for recognizing text data, utilizing the recognition model described in any one of claims 1-3, characterized in that, include: Obtain the text data to be recognized; Obtain a pre-trained recognition model, wherein the pre-trained recognition model is a similarity model trained using first text data synthesized from real text, and a second text data corresponding to real text in the first text data. The first text data includes: the second text data, and a third text data that has a similarity relationship with the second text data. The similarity model is used to determine the weight value corresponding to each text data in the second text data. The text data to be identified is input into the recognition model so that the recognition model extracts the text features corresponding to the text data to be identified and determines the text category corresponding to the text data to be identified based on the text features.

5. A training device for a recognition model, characterized in that, include: The acquisition module is used to acquire a similarity model trained using first text data synthesized from real text, wherein the real text includes second text data corresponding to at least one text category, and the first text data includes: second text data and third text data that has a similarity relationship with the second text data; The processing module is used to construct a similarity matrix corresponding to each text category using the second text data and the similarity model, and to determine the weight value corresponding to each text data in the second text data based on the similarity matrix; The training module is used to train a preset neural network model using the text category and the second text data, and to calculate the loss function value of the preset neural network model during the training process using the weight values. The determination module is used to determine the preset neural network model as the recognition model when the loss function value meets a preset threshold. The acquisition module is used to generate third text data that has a similar relationship with the second text data; synthesize the second text data and the third text data to obtain the first text data; and train a preset similarity model using the first text data so that the preset similarity model learns the similarity relationship between the second text data and the third text data in the first text data to obtain a similarity model. The processing module is configured to obtain a similarity set between each text data in the second text data and other text data in the second text data from the similarity matrix; calculate the average similarity corresponding to each text data in the second text data based on the similarity carried in the similarity set and the number of similarities; and determine the average similarity as the weight value.

6. A text data recognition device, characterized in that, include: The first acquisition module is used to acquire the text data to be recognized; The second acquisition module is used to acquire a pre-trained recognition model, wherein the pre-trained recognition model is a similarity model trained using first text data synthesized from real text, and a second text data corresponding to real text in the first text data. The first text data includes: the second text data, and third text data that has a similarity relationship with the second text data. The similarity model is used to determine the weight value corresponding to each text data in the second text data. The recognition model is trained by the recognition model training device according to claim 5. The processing module is used to input the text data to be identified into the recognition model, so that the recognition model extracts the text features corresponding to the text data to be identified, and determines the text category corresponding to the text to be identified based on the text features.

7. A storage medium, characterized in that, The storage medium includes a stored program, wherein the program executes the method of any one of claims 1 to 4 when it is run.

8. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, communication interface, and memory communicate with each other through the communication bus; wherein: Memory, used to store computer programs; A processor for performing the method of any one of claims 1-4 by running a program stored in memory.