Data processing method, identification method, device and computing equipment

By constructing a graph structure and using graph neural network to fuse dictionary information, the problem of low accuracy of sequence labeling models is solved, the text recognition accuracy and model training accuracy are improved, and the dependence on manual labeling is reduced.

CN112836498BActive Publication Date: 2024-12-06ALIBABA GROUP HOLDING LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911157158.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-11-22
Publication Date
2024-12-06
Estimated Expiration
2039-11-22

AI Technical Summary

Technical Problem

In the prior art, the accuracy of the sequence labeling model is low, resulting in low text recognition accuracy and relying on manual labeling, which is costly and inaccurate enough.

Method used

By representing the training text and dictionary as nodes, a graph structure is constructed, and a graph neural network is used to fuse dictionary information to train text recognition models to improve text expression accuracy and model training accuracy.

Benefits of technology

It improves text recognition accuracy and model training accuracy, reduces dependence on manual annotation, and enhances the model's expression ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112836498B_ABST
    Figure CN112836498B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a data processing method, recognition method, device and computing equipment. Among them, the multiple elements obtained by segmenting the training text are represented as nodes respectively; wherein the elements are composed of single words or multiple words; multiple different types of dictionaries are represented as nodes respectively; the edges between the nodes are represented by the association relationship between the nodes to construct a first graph; the text recognition model is trained using the first graph and the training labels respectively marked for the multiple elements; the feature words in the text to be processed can be identified using the text recognition model, and the technical solution provided by the embodiment of the present application improves the accuracy of text expression, improves the accuracy of model training, and improves the accuracy of text recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer application technology, and more particularly, to a data processing method, device, and mobile terminal. Background Art

[0002] Sequence labeling is a common problem in natural language processing. Sequence labeling can solve problems such as word segmentation, named entity recognition, and keyword extraction.

[0003] Sequence labeling involves assigning a label of a certain type from a set of labels to each element in a sequence and then training a model to identify the labels of the elements in the sequence being processed. In natural language processing, a sequence can refer to multiple elements formed by segmenting a text into words or characters. Sequence labeling is essentially a text recognition problem. For example, named entity recognition can identify named entity words of different named entity types in a text.

[0004] Since labels in sequence labeling rely on manual annotation, to improve model accuracy and text recognition accuracy, external knowledge can be introduced into the model to supplement the labeled data. Dictionaries are a form of external knowledge, each storing words corresponding to a label type. However, how to effectively improve model accuracy by introducing dictionaries into the model has become a technical challenge that needs to be addressed. Summary of the Invention

[0005] The embodiments of the present application provide a data processing method, apparatus, and computing device to solve the technical problems of low model accuracy and low text recognition accuracy in the prior art.

[0006] In a first aspect, an embodiment of the present application provides a data processing method, comprising:

[0007] The multiple elements obtained by segmenting the training text are respectively represented as nodes; wherein the elements are composed of a single word or multiple words;

[0008] Represent multiple dictionaries of different types as nodes;

[0009] Representing edges between nodes by using association relationships between nodes to construct a first graph;

[0010] A text recognition model is trained using the first graphic and the training labels respectively annotated for the multiple elements.

[0011] In a second aspect, an embodiment of the present application provides an identification method, comprising:

[0012] Representing multiple elements obtained by segmenting the text to be processed as nodes respectively; wherein the elements are composed of single words or multiple words;

[0013] Represent multiple dictionaries of different types as nodes;

[0014] Representing the edges between the nodes by the association relationship between the nodes, and constructing a second graph;

[0015] Based on the second graph, a text recognition model is used to identify feature words in the text to be processed.

[0016] In a third aspect, an embodiment of the present application provides a data processing method, including:

[0017] The multiple elements obtained by segmenting the training text are respectively represented as nodes; wherein the elements are composed of a single word or multiple words;

[0018] Represent multiple dictionaries of different named entity types as nodes;

[0019] Representing edges between nodes by using association relationships between nodes to construct a first graph;

[0020] A text recognition model is trained using the first graphic and the training labels respectively annotated for the multiple elements.

[0021] In a fourth aspect, an embodiment of the present application provides an identification method, including:

[0022] Representing multiple elements obtained by segmenting the text to be processed as nodes respectively; wherein the elements are composed of single words or multiple words;

[0023] Represent multiple dictionaries of different named entity types as nodes;

[0024] Representing the edges between the nodes by the association relationship between the nodes, and constructing a second graph;

[0025] Based on the second graphic, a text recognition model is used to identify named entity words in the text to be processed.

[0026] In a fifth aspect, an embodiment of the present application provides a processing method, comprising:

[0027] Representing multiple elements obtained by segmenting the text to be processed as nodes respectively; wherein the elements are composed of single words or multiple words;

[0028] Represent multiple dictionaries of different types as nodes;

[0029] Representing the edges between the nodes by the association relationship between the nodes, and constructing a second graph;

[0030] Identify feature words in the text to be processed using a text recognition model based on the second graph;

[0031] Based on the feature words, corresponding processing is performed.

[0032] In a sixth aspect, an embodiment of the present application provides a data processing device, including:

[0033] A first determining module is configured to represent multiple elements obtained by segmenting the training text as nodes, wherein the elements are composed of a single word or multiple words;

[0034] A second determining module is used to represent multiple dictionaries of different types as nodes respectively;

[0035] A first construction module is configured to construct a first graph by representing edges between nodes using association relationships between the nodes;

[0036] The model training module is used to train a text recognition model using the first graphic and the training labels respectively marked for the multiple elements.

[0037] In a seventh aspect, an embodiment of the present application provides an identification device, including:

[0038] A third determining module is configured to represent the plurality of elements obtained by segmenting the to-be-processed text as nodes, wherein the elements are composed of a single word or multiple words;

[0039] a fourth determining module, configured to represent a plurality of dictionaries of different types as nodes;

[0040] A second construction module is used to represent the edges between different nodes by the association relationship between the nodes to construct a second graph;

[0041] A text recognition module is used to recognize feature words in the text to be processed based on the second graphic using a text recognition model.

[0042] In an eighth aspect, an embodiment of the present application provides a computing device, including a processing component and a storage component;

[0043] The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component;

[0044] The processing component is used to:

[0045] The multiple elements obtained by segmenting the training text are respectively represented as nodes; wherein the elements are composed of a single word or multiple words;

[0046] Represent multiple dictionaries of different types as nodes;

[0047] Representing edges between different nodes using association relationships between nodes to construct a first graph;

[0048] A text recognition model is trained using the first graphic and the training labels respectively annotated for the multiple elements.

[0049] In a ninth aspect, an embodiment of the present application provides a computing device, including a processing component and a storage component;

[0050] The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component;

[0051] The processing component is used to:

[0052] Representing multiple elements obtained by segmenting the text to be processed as nodes respectively; wherein the elements are composed of single words or multiple words;

[0053] Represent multiple dictionaries of different types as nodes;

[0054] The edges between different nodes are represented by the association relationship between the nodes to construct a second graph;

[0055] Based on the second graph, a text recognition model is used to identify feature words in the text to be processed.

[0056] In an embodiment of the present application, the elements obtained by segmenting the training text are represented as nodes, and different types of dictionaries are represented as nodes, and edges between the nodes are established to construct a first graph. The first graph and the training labels annotated for the elements are then used to train the text recognition model. In an embodiment of the present application, dictionary information is integrated, and the text is modeled as a graph to implement the training of the text recognition model, so that the accuracy of text expression and the accuracy of dictionary fusion can be improved, the accuracy of model training is improved, and the accuracy of text recognition can be improved.

[0057] These and other aspects of the present application will become more readily apparent from the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0059] Figure 1 A flow chart showing an embodiment of a data processing method provided by the present application is shown;

[0060] Figure 2 A schematic diagram of a graphics encoding process in a practical application of an embodiment of the present application is shown;

[0061] Figure 3 A flow chart showing an embodiment of an identification method provided by the present application is shown;

[0062] Figure 4 A schematic diagram of the model training process in a practical application of an embodiment of the present application is shown;

[0063] Figure 5 A schematic structural diagram of an embodiment of a data processing device provided by the present application is shown;

[0064] Figure 6 A schematic structural diagram of an embodiment of a computing device provided by the present application is shown;

[0065] Figure 7 A schematic structural diagram of an embodiment of an identification device provided by the present application is shown;

[0066] Figure 8 A structural diagram of another embodiment of a computing device provided by the present application is shown. DETAILED DESCRIPTION

[0067] In order to enable people skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0068] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.

[0069] The technical solutions of the embodiments of the present application are mainly applied to scenarios involving sequence labeling problems in natural language processing, such as word segmentation, named entity recognition, keyword recognition, etc.

[0070] Taking named entity recognition as an example, named entity recognition is an important foundation for application fields such as information extraction, question-answering systems, syntactic analysis, and machine translation. Named entity recognition is the process of identifying named entity words from the text to be processed, where named entities can include names of people, organizations, places, and all other entities identified by names. In addition, numbers, dates, currencies, addresses, percentages, and the like can also be included. In the prior art, the training text is usually segmented into multiple elements, and the Word2vec (word to vector) technology can be used to represent the elements as feature vectors, thereby modeling the training text as input features, using the input features as model input, and using the training labels annotated for the elements as model output, thereby achieving model training. However, this approach relies on manual annotation for element labels, which is time-consuming, labor-intensive, and inaccurate. Therefore, the inventors considered whether external knowledge, specifically dictionaries, could be introduced to supplement the annotated data. So, how could dictionaries be introduced? The inventors proposed a method for matching the N-gram segmentation of the training text with each dictionary separately. If a segmentation matches the dictionary, the dictionary position is marked as 1; otherwise, it is marked as 0. Using one-hot encoding, each segmentation can be represented as a dictionary feature. The dictionary features of each word are then concatenated after the input features of the training text, serving as model input, while the training labels of each element serve as the model output, enabling model training. However, due to the richness of Chinese word meanings, there can be a large number of words that match each dictionary image. Typically, the dictionary features are compressed before being concatenated, resulting in information loss. Therefore, this approach still fails to accurately represent the text, affecting the accuracy of model training.

[0071] In order to improve the accuracy of model training, the inventor proposed the technical solution of this application after a series of studies. The embodiment of this application expresses text through a graphical structure and integrates dictionary information to improve the accuracy of text expression, thereby improving the accuracy of model training and text recognition.

[0072] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.

[0073] Figure 1The present invention provides a flowchart of an embodiment of a data processing method. This embodiment mainly describes the technical solution of the present invention from the perspective of model training. The method may include the following steps:

[0074] 101: Multiple elements obtained by segmenting the training text are represented as nodes respectively.

[0075] Wherein, the element consists of a single word or multiple words.

[0076] The multiple elements can be obtained by performing word segmentation and / or character segmentation on the training text. Therefore, each element can be composed of a single word or multiple words. If it is multiple words, the multiple words are composed of consecutive single words in the training text to form a word in the training text.

[0077] 102: Represent multiple dictionaries of different types as nodes respectively.

[0078] Depending on the sequence recognition task, you can create multiple different types of dictionaries. For example, for text recognition tasks, the dictionary type can be differentiated by named entity type, such as person names, place names, and organization names.

[0079] It can be seen that the nodes in the embodiment of the present application may include dictionary nodes and element nodes.

[0080] 103: Representing edges between nodes using association relationships between nodes to construct a first graph.

[0081] In the embodiment of the present application, a graph is a data structure that models a set of objects (nodes) and their relationships (edges).

[0082] By representing the dictionary and elements as nodes, and then based on the association relationship between different nodes, the edges between the nodes can be determined, and the nodes can be connected using the edges to form a graph data structure. In order to facilitate description and distinction in the embodiment of this application, it is named the first graph.

[0083] Optionally, the association relationship between nodes may be determined based on the contextual relationship between elements and the matching relationship between elements and dictionaries. Therefore, the method of representing the edges between nodes based on the association relationship between nodes and constructing the first graph may include:

[0084] Determine the edges between different nodes based on the contextual relationships between different elements and the matching relationships between different elements and different dictionaries;

[0085] Based on the edges between different nodes, a first graph is constructed.

[0086] The context relationship can refer to whether two elements are adjacent in the training text. If so, they have a context relationship. For example, in the training text "I like to eat cakes", the single characters "喜" and "欢" have context information.

[0087] As an optional way, the matching relationship between the dictionary and the elements can mean that the dictionary has a matching relationship with each element of the matching word that matches it. Among them, the matching word that matches the dictionary can mean that the dictionary includes this word. For example, in the training text "Zhang San is in Beijing People's Park", where "People's Park" hits a certain dictionary, the elements "人", "民", "公", and "园" all have a matching relationship with this dictionary.

[0088] As another optional way, the matching relationship between the dictionary and the elements can mean that the dictionary has a matching relationship with the first element and the last element of the matching word that matches it.

[0089] Among them, there is also a matching relationship between each element in the matching word that matches the dictionary. For example, still taking the training text "Zhang San is in Beijing People's Park" as an example, where "People's Park" hits a certain dictionary, the elements "人" and "园" both have a matching relationship with this dictionary. The element "人" and the element "民", the element "民" and the element "公", the element "公" and the element "园" not only have a context relationship but also have a matching relationship.

[0090] Therefore, optionally, based on the context relationship between different elements and the matching relationship between different elements and different dictionaries, determining the edges between different nodes can be:

[0091] Based on the context relationship or matching relationship between different elements, determine the edges between the nodes corresponding to different elements;

[0092] Based on the matching relationship between different elements and different dictionaries, establish the edges between the nodes corresponding to the elements and the nodes corresponding to the dictionaries.

[0093] In a possible implementation manner, each dictionary can be represented by two nodes, respectively representing the start of the match and the end of the match. For the convenience of description, the first node and the second node can be used to represent the two nodes representing the dictionary respectively. Therefore, in some embodiments, the representing multiple different types of dictionaries as nodes respectively includes:

[0094] Represent multiple different types of dictionaries as the first node and the second node respectively; where the first node represents the start of the match with the element, and the second node represents the end of the match with the element.

[0095] Among them, the first node and the second node can both have a matching relationship with each word in the matching words matched in the dictionary, or the first node, that is, the node indicating the start of the match, only has a matching relationship with the first element in the matching words, and the second node only has a matching relationship with the last element in the matching words.

[0096] In addition, the first graph may be an undirected graph or a directed graph.

[0097] If the first graph is a directed graph, that is, the edges between nodes have directions, for nodes with contextual relationships, the edge direction can be the node corresponding to the previous element (also mostly expressed as the previous node in the subsequent description) pointing to the node corresponding to the next element (also mostly expressed as the following node in the subsequent description); for nodes with matching relationships, the edge direction can include the dictionary corresponding node (also mostly expressed as the dictionary node in the subsequent description) pointing to the element corresponding node (also mostly expressed as the element node in the subsequent description), and the previous node pointing to the next node.

[0098] If each dictionary can be represented by two nodes, representing the start and end of the match respectively, then the edge direction between the first node, that is, the node representing the start of the match and the element node can be the first node pointing to the element node; the edge direction between the second node, that is, the node representing the end of the match and the element node can be the element node pointing to the second node.

[0099] 104: Train a text recognition model using the first graphic and the training labels respectively labeled for the multiple elements.

[0100] The text recognition model may include a graph neural network, so that the first graphic can be encoded to obtain feature vectors of the multiple elements. The graph neural network can be trained along with the text recognition model to obtain parameters of the graph neural network.

[0101] Of course, a separate graph neural network model can also be used to encode the first graph to obtain feature vectors of multiple elements, and then train a text recognition model based on the feature vectors of the multiple elements and the training labels annotated with the multiple elements. The graph neural network model can be obtained by training with sample graphs and sample feature vectors, etc.

[0102] Therefore, the text recognition model can be used to identify and obtain feature words belonging to different label types in the text to be processed.

[0103] In this embodiment, text is expressed through a graphical structure and dictionary information is integrated to improve the accuracy of text expression, thereby improving the accuracy of model training and text recognition.

[0104] In some embodiments, training the text recognition model using the training labels respectively annotated with the first graphic and the plurality of elements may include:

[0105] Inputting the first graphic into a text recognition model, and encoding the first graphic via the text recognition model to obtain feature vectors of the plurality of elements;

[0106] The text recognition model is trained based on the feature vectors of the multiple elements and the training labels respectively annotated with the multiple elements.

[0107] The text recognition model can be specifically used to recognize the text to be processed based on the second graph established by the text to be processed to determine the feature words in the text to be processed.

[0108] In some embodiments, the training of the text recognition model based on the feature vectors of the multiple elements and the labels respectively annotated with the multiple elements includes:

[0109] The training labels respectively annotated for the multiple elements are used as output results of the text recognition model, and the text recognition model is trained based on the feature vectors of the multiple elements.

[0110] The text recognition model can be a neural network model. As described above, the text recognition model can include a graph neural network, which can serve as the input layer of the text recognition model. Therefore, in some embodiments, the text recognition model can include a graph encoding network and a text recognition network.

[0111] Inputting the first graphic into a text recognition model and encoding the first graphic via the text recognition model to obtain feature vectors of the plurality of elements includes:

[0112] Using the first graphic as input data of the text recognition model, encoding the first graphic via the graphic encoding network to obtain feature vectors of the plurality of elements;

[0113] The taking the training labels respectively labeled with the multiple elements as the output result of the text recognition model and training the text recognition model based on the feature vectors of the multiple elements includes:

[0114] The feature vectors of the multiple elements are used as input data of the text recognition network, and the training labels respectively marked for the multiple elements are used as output results of the recognition network. The text recognition model is trained to obtain model parameters of the graphic encoding network and model parameters of the text recognition network.

[0115] Among them, graph neural networks can be implemented using GCN (Graph Convolutional Neural Network) or GGNN (Gated Graph Sequence Neural Networks), and text recognition networks can be implemented using LSTM (Long Short-Term Memory) + CRF (conditional random field algorithm).

[0116] The graph neural network may encode each node in the first graph separately, and in order to further improve the accuracy of the element feature vector, repeated encoding operations may be performed. Therefore, in some embodiments, using the first graph as input data for the text recognition model, encoding the first graph via the graph coding network to obtain the feature vectors of the multiple elements may include:

[0117] Using the first graph as input data for the text recognition model, performing multiple repeated encoding operations on each node through the graph encoding network in combination with the current encoding vectors of each node adjacent to each node; wherein the first encoding operation for each node is performed based on the initial vector of each node;

[0118] The encoding vectors of the nodes corresponding to the multiple elements obtained by the last encoding are respectively used as the feature vectors of the multiple elements.

[0119] The first encoding operation for each node is performed based on its initial vector. The initial vector for an element node can be a word vector or character vector, which can be obtained through conversion techniques such as Word2vec (word to vector) or skip-gram (a word vector conversion model). This is similar to existing techniques and will not be described in detail here. The initial vector for a dictionary node can be randomly set.

[0120] Each node is repeatedly encoded, each based on the current encoding vectors of its neighbors. This allows the encoding vector for each node to contain more information. During each encoding operation, each node both receives and sends information to its neighbors.

[0121] The number of repetitions of encoding can be pre-set based on actual application conditions. The encoding vector of the element node obtained by the last encoding can be used as the feature vector of the element.

[0122] In order to facilitate the understanding of the graphic encoding process, an example is given below. Figure 2 As shown in FIG, a schematic diagram of a first graph is shown. Assume that the first graph includes six nodes: A, B, C, D, E, and F. These six nodes are connected according to their association relationships to form edges between the nodes. Each node has an initial vector. For element nodes, the initial vector can be a Word2vec vector. For dictionary nodes, the initial vector can be arbitrarily set.

[0123] Using graph neural networks, we can calculate the encoding vector of each node. For example, Figure 2 In the example, node A is adjacent to nodes B, C, and D, so the encoding vector of node A can be specifically calculated by combining the initial vectors of nodes B, C, and D. In order to make the encoding vector contain more information, for example, the information of nodes that are far apart can be encoded into node A, so the encoding operation can be repeated. That is, the first encoding vector of node A can be calculated by the initial vectors of the four nodes A, B, C, and D. During the repeated encoding operation, the second encoding vector of node A can be calculated using the first graph encoding vectors of nodes A, B, C, and D. Since the first encoding vector of node C contains the information of nodes E and node F, the second encoding vector of node A also contains the information of E and F. Figure 2 As shown in the figure, the first encoding vector of node B contains the information of nodes A and C, and the first encoding vector of node C contains the information of nodes A, B, E, and F; the first encoding vector of node D contains the information of node A. When node A is encoded for the second time, it needs to be calculated in combination with the first encoding vectors of nodes B, C, and D, and the first encoding vector of node C contains the information of E and node F. Therefore, the second encoding vector of node A also contains the information of E and F.

[0124] The number of repeated encoding times can be set based on the actual task, and usually does not exceed 4 times.

[0125] In a practical application, when using a graph neural network to encode a node to obtain an encoding vector, it can be implemented according to the following formula:

[0126]

[0127]

[0128]

[0129]

[0130]

[0131]

[0132] Where H represents the matrix composed of the encoding vectors of the t-1th time of |V| nodes, and t is an integer greater than or equal to 1; W represents the encoding vector obtained by encoding the vth node for the tth time; l represents the weight parameter of the edge; is the update factor, which is used to control the forgotten information and indicates which new information is selected to be remembered; To adjust the factors, control the newly generated information and decide from which past information the new information is generated; is the critical matrix parameter; Indicates which past information to choose to forget; Indicates newly generated information. That is, it represents the final node state, that is, the encoding vector. In addition, the other parameters in the formula are all model parameters.

[0133] As can be seen from the above description, each dictionary can be represented by two nodes, representing the start and end of a match respectively. Therefore, in some embodiments, representing multiple dictionaries of different types as nodes includes:

[0134] Multiple dictionaries of different types are represented as first nodes and second nodes respectively; wherein the first node represents the start of matching with the element, and the second node represents the end of matching with the element.

[0135] The first node of each dictionary may specifically have a matching relationship with the first element of its matching word, and the second node may specifically have a matching relationship with the last element of its matching word.

[0136] For example, the training copy obtains multiple elements by word segmentation, and each element is composed of a single word. Assuming that the word "People's Park" hits a certain dictionary, the first node corresponding to the dictionary has a matching relationship with the element "people" node, and the second node has a matching relationship with the element "garden" node. The element "people" and the element "people", the element "people" and the element "public", and the element "public" and the element "garden" respectively have a contextual relationship and a matching relationship. When the first graph is a directed graph, the edge direction between the first node and the element node can be the first node pointing to the element node, and the edge direction between the second node and the element node can be the element node pointing to the second node. For example, the first node points to the element "people" node, the element "garden" node points to the second node, and for nodes with contextual relationships and matching relationships, the previous node points to the next node, such as the element "people" node points to the element "people" node. That is, there may be two edges between the element nodes.

[0137] Of course, those skilled in the art will understand that the node representation method corresponding to the dictionary and the node representation method corresponding to the text are not limited to the methods described in the embodiments of the present application. Any node representation method that can represent a dictionary and any node representation method that can represent text should fall within the scope of protection of the present application.

[0138] In one practical application, the elements obtained by segmenting the training text may be composed of single words, that is, the training text is segmented into words. The training labels of each element can be set as follows. In some embodiments, the training text recognition model may include the following:

[0139] For each word, a training label is set according to the label type of the feature word composed of the word, and whether the word is the starting word, middle word, end word, word or component word that does not belong to any label type in the feature word composed of the word;

[0140] The text recognition model is trained using the first graphic and the training labels of the individual words.

[0141] In some embodiments, position information may also be added to the training label. Therefore, for each word, according to the label type of the feature word composed of the word, and whether the word is the starting word, middle word, end word, word, or component word that does not belong to any label type in the feature word composed of the word, setting the training label of each word may include:

[0142] For each single word, a training label is set for each single word according to the text position of the single word in the training text, the label type of the feature word composed of the single word, and whether the single word is the starting character, middle character, end character, single character, or a component character that does not belong to any label type in the feature word composed of the single word.

[0143] Here, the single character is the starting character, middle character, ending character, or single character in the feature word that it constitutes: For example, if the feature word is "railway station", "huo" is the starting character, "che" is the middle character, and "zhan" is the ending character. Of course, if the feature word has only two characters, these two characters are the starting character and the ending character respectively; if the feature word has only one character, it is a single character.

[0144] If a character in the training text does not constitute any feature word, it is based on a constituent character that does not belong to any label type.

[0145] It should be noted that the feature word in the embodiment of the present application refers to a specific word belonging to a certain label type that needs to be identified in the sequence labeling task. For example, the feature word can be a named entity word, and the label type is the named entity type.

[0146] To facilitate labeling, the letters B, E, I, and S can be used to represent the start word, end word, middle word, and single word, respectively. If there are 6 label types, the 6 label types can also be represented by different identification symbols. Based on the 6 label types and the start word, end word, middle word, and single word, 24 labels can be set. For component words that do not belong to any label type, the label O can be used to represent them, that is, a total of 25 labels.

[0147] For example, in the named entity recognition scenario, assume that there are four named entity types including time (represented by the symbol TIME), place (represented by the symbol LOC), person's name (represented by the symbol PER), and organization (represented by the symbol ORG). For example, the training text is "Zhang San is in People's Park", where Zhang San is a person's name and People's Park is a place. If it does not belong to any named entity type, then the label sequence corresponding to "Zhang San is in People's Park" can be "B-PER, E-PER, O, B-LOC, I-LOC, I-LOC, E-LOC".

[0148] In some embodiments, training the text recognition model using the training labels respectively annotated with the first graphic and the plurality of elements may include:

[0149] Encoding the first graph to obtain feature vectors of the plurality of elements;

[0150] A text recognition model is trained based on the feature vectors of the multiple elements and the training labels respectively annotated with the multiple elements.

[0151] The encoding of the first graph may be achieved through an independent graph neural network model, and the graph neural network model may be obtained through training based on sample graphs and sample vectors.

[0152] Figure 3 This is a flowchart of an embodiment of a recognition method provided in an embodiment of the present application. This embodiment mainly describes the technical solution of the present application from the perspective of text recognition. The method may include the following steps:

[0153] 301: Representing multiple elements obtained by segmenting the text to be processed as nodes.

[0154] Wherein, the element consists of a single word or multiple words.

[0155] The multiple elements can be obtained by performing word segmentation or character segmentation on the text to be processed.

[0156] 302: Represent multiple dictionaries of different types as nodes respectively.

[0157] 303: Representing the edges between the nodes using the association relationship between the nodes to construct a second graph.

[0158] The association relationship between different nodes may include the contextual relationship between elements and the matching relationship between elements and dictionaries.

[0159] Among them, the contextual relationship can refer to whether two elements are adjacent in the training text, and the matching relationship between the element and the dictionary can refer to that if a certain element or a word composed of a certain element and other elements hits a certain dictionary, that is, a certain dictionary contains a certain element or a word composed of a certain element and at least one other element, then it can be said that there is a matching relationship between the element and the dictionary.

[0160] Among them, the second graph can be an undirected graph or a directed graph. If the first graph is a directed graph, that is, the edges between nodes have directions, for nodes with contextual relationships, the edge direction can be from the previous node to the next node, and for nodes with matching relationships, the edge direction can be from the dictionary node to the element node.

[0161] In a practical application, each dictionary can be represented by two nodes, representing the start of matching and the end of matching respectively. The node representing the start of matching has a matching relationship with the first element of its matching term, and the node representing the end of matching has a matching relationship with the last element of its matching term. The edge direction between the node representing the start of matching and the element node can be from the node representing the start of matching to the element node, and the edge direction between the node representing the end of matching and the element node can be from the element node to the node representing the end of matching.

[0162] The second graph construction method is the same as the first graph construction method, but for different texts. For details, please refer to Figure 1 As described in the illustrated embodiment.

[0163] 304: Identify feature words in the text to be processed using a text recognition model based on the second graph.

[0164] The specific training method of the text recognition model can be found in the data processing methods of the above embodiments, and will not be repeated here.

[0165] In this embodiment, text is expressed through a graphic structure and dictionary information is integrated to improve text expression accuracy and text recognition accuracy.

[0166] In some embodiments, identifying the feature words in the to-be-processed text using a text recognition model based on the second graphic may include:

[0167] Identify labels corresponding to the multiple elements in the text to be processed using a text recognition model based on the second graphic;

[0168] Based on the labels corresponding to the multiple elements, characteristic words in the text to be processed are determined.

[0169] For example, when the element is composed of a single word, combined with the above description, we can know that 25 labels can be set. Since the label represents the label type of the single word and the starting word, middle word, ending word or single word in the characteristic word it constitutes, the characteristic words in the text to be processed can be obtained based on the labels of different single words.

[0170] The text to be processed may include at least one feature word.

[0171] In some embodiments, identifying the labels corresponding to the multiple elements in the to-be-processed text using a text recognition model based on the second graphic includes:

[0172] Inputting the second graphic into the text recognition model, and encoding the second graphic by the text recognition model to obtain feature vectors of the plurality of elements;

[0173] Based on the feature vectors of the multiple elements, labels corresponding to the multiple elements are identified.

[0174] As can be seen from the above description, the text recognition model may include a graphic encoding network and a text recognition network; therefore, in some embodiments, inputting the second graphic into the text recognition model and encoding the second graphic by the text recognition model to obtain the feature vectors of the multiple elements may include:

[0175] Inputting the second graphic into the text recognition model, and encoding the second graphic by the graphic encoding network to obtain feature vectors of the multiple elements;

[0176] The identifying, based on the feature vectors of the multiple elements, the labels corresponding to the multiple elements may include:

[0177] Based on the feature vectors of the multiple elements, the text recognition network is used to identify labels corresponding to the multiple elements.

[0178] The step of inputting the second graphic into the text recognition model and encoding the second graphic by the graphic coding network to obtain the feature vectors of the multiple elements may include:

[0179] Inputting the second graph into the text recognition model, and performing multiple repeated encoding operations on each node using a graph coding network, specifically combining the current encoding vectors of each node's neighboring nodes; wherein the first encoding operation for each node is performed based on the initial vector of each node;

[0180] The encoding vectors of the nodes corresponding to the multiple elements obtained by the last encoding are respectively used as the feature vectors of the multiple elements.

[0181] In some embodiments, establishing edges between different nodes based on association relationships between different nodes to construct the second graph may include:

[0182] Based on the contextual relationships between different elements and the matching relationships between different elements and different dictionaries, edges between different nodes are established to construct a second graph.

[0183] In some embodiments, representing multiple dictionaries of different types as nodes may include:

[0184] Multiple dictionaries of different types are represented as first nodes and second nodes respectively; wherein the first node represents the start of matching with the element, and the second node represents the end of matching with the element.

[0185] The first node of each dictionary specifically has a matching relationship with the first element of its matching word, and the second node specifically has a matching relationship with the last element of its matching word.

[0186] In a practical application, the technical solution of the embodiment of the present application can be specifically applied to a named entity recognition scenario. The dictionary type is specifically divided according to the named entity type, so multiple dictionaries of different named entity types can be represented as nodes respectively.

[0187] Therefore, in the named entity recognition scenario, the embodiment of the present application further provides a data processing method, which may include:

[0188] The multiple elements obtained by segmenting the training text are respectively represented as nodes; wherein the elements are composed of a single word or multiple words;

[0189] Represent multiple dictionaries of different named entity types as nodes;

[0190] Establishing edges between different nodes based on association relationships between different nodes to construct a first graph;

[0191] A text recognition model is trained using the first graphic and the training labels respectively annotated for the multiple elements.

[0192] This embodiment of the application also provides an identification method, which may include:

[0193] Multiple elements obtained by splitting the text to be processed are respectively represented as nodes; wherein, the elements are composed of single characters or multiple characters.

[0194] Multiple dictionaries of different named entity types are respectively represented as nodes.

[0195] Edges are established between different nodes based on the association relationships between different nodes to construct a second graph.

[0196] Based on the second graph, a named entity word in the text to be processed is recognized using a text recognition model.

[0197] For ease of understanding, an example is given below. Assume the training text is "Zhang San is in Beijing People's Park". The training text can be split into multiple single characters, such as Figure 4 As described above, assume these multiple single characters are respectively represented as nodes c1, c2, c3..., and each single character in this training text can also be respectively represented as: Zhang (c1), San (c2), in (c3), Bei (c4), Jing (c5), Ren (c6), Min (c7), Gong (c8), Yuan (c9). Among them, there is a context relationship between adjacent single characters. Therefore, based on the context relationships of each single character, the edges of each single character node can be determined. For example, c1 and c2 have a context relationship, c2 and c3 have a context relationship, and so on.

[0198] Assume there are 4 dictionaries of named entity types (place names, organizations, personal names, and other entities, represented by LOC, ORG, PER, and OTH respectively). In a practical application, each dictionary can be represented by two nodes. Therefore, 8 dictionary nodes can be obtained, which are respectively represented as nodes LOC1, LOC2, ORG1, ORG2, PER1, PER2, OTH1, and OTH2. Among them, LOC1, ORG1, PER1, and OTH1 respectively represent the start nodes of matching, and LOC2, ORG2, PER2, and OTH2 respectively represent the end nodes of matching.

[0199] Among them, the node representing the start of matching specifically has a matching relationship with the first single character of its matching word, and the node representing the end of matching specifically has a matching relationship with the last single character of its matching word. And there is also a matching relationship between adjacent single characters in each single character of the matching word in the hit dictionary. For example, if "Zhang San" hits the personal name dictionary, then PER1 has a matching relationship with c1, PER2 has a matching relationship with c2, and there is a matching relationship between c1 and c2.

[0200] Assume that "Zhang San" and "Zhang San in" hit the dictionary PER, "Beijing people" hit the dictionary OTH, "Beijing" hit the dictionary ORG with the dictionary LOC, "People's Park" hit the dictionary LOC, the specific edge relationship can be seen in Figure 4 In the first graph 401 shown in FIG, the dotted line represents the matching relationship, and the solid line represents the contextual relationship.

[0201] When the first graph is a directed graph, the edge direction can be as follows: Figure 4 The arrows in the first graph 401 generally point to the previous node pointing to the next node, the node indicating the start of the match pointing to the single-word node, and the single-word node pointing to the node indicating the end of the match.

[0202] After constructing the first graph, the training labels of each single word can be set according to the named entity type of the named entity word composed of each single word, and whether the single word is the starting word, middle word, end word, single word or component word that does not belong to any named entity type in the named entity word composed of it.

[0203] Therefore, the first graphic and the training labels of each word can be used to train the text recognition model.

[0204] The text recognition model may be composed of a graph neural network 402 and a text recognition network. In practical applications, the text recognition network may be composed of an LSTM network 403 and a CRF network 404.

[0205] Thus, the first graph is input into the graph neural network 402 and encoded by the graph neural network 402 to obtain the feature vectors corresponding to each word;

[0206] The feature vector of each word is used as the input data of the text recognition model, and the training label of each word is used as the output data, so that the text recognition model can be trained. Through training with a large number of training samples, the model parameters of the graphic coding network and the model parameters of the text recognition network can be obtained.

[0207] Thus, the obtained text recognition model can be used to perform named entity recognition on the text to be processed to determine the labels to which each word in the text to be processed belongs. Based on the labels to which each word belongs, the named entity words in the text to be processed can be determined.

[0208] In practical applications, there are many scenarios where it is necessary to identify and obtain feature words in the text to be processed, especially when the feature words are named entity words. In application scenarios such as information extraction, question-answering systems, syntactic analysis, and machine translation, named entity recognition must be performed first.

[0209] Therefore, the present invention also provides a processing method, which may include the following steps:

[0210] Representing multiple elements obtained by segmenting the text to be processed as nodes respectively; wherein the elements are composed of single words or multiple words;

[0211] Represent multiple dictionaries of different types as nodes;

[0212] Representing the edges between the nodes by the association relationship between the nodes, and constructing a second graph;

[0213] Identify feature words in the text to be processed using a text recognition model based on the second graph;

[0214] Based on the feature words, corresponding processing is performed.

[0215] As an optional method, the characteristic words may refer to colloquial words. By identifying colloquial words in the text to be processed, colloquial errors in the text to be processed can be eliminated to obtain a standard text. Therefore, the corresponding processing based on the characteristic words may include:

[0216] The colloquial words are eliminated from the text to be processed to obtain a standard text.

[0217] Eliminating the colloquial words may refer to deleting the colloquial words from the text to be processed.

[0218] In addition, the feature words may refer to named entity words. In the named entity recognition scenario, the named entity words obtained based on recognition can be used in a variety of applications. As another optional method, the corresponding processing based on the feature words may include:

[0219] Information extraction is performed on the text to be processed according to the named entity words and the named entity types of the named entity words to obtain structured text.

[0220] Because the text recognition module is trained based on a dictionary of different named entity types, and the training labels include the named entity types, the text recognition module can obtain the named entity types. Therefore, based on the named entity words and the named entity types of the named entity words, information can be extracted from the text to be processed to obtain structured text.

[0221] Among them, the specific implementation method of information extraction is the same as the existing technology, except that the recognition of named entity words can be carried out according to the technical solution of the embodiment of this application. Therefore, this application will not repeat the acquisition of structured text here.

[0222] Structuring the text to be processed can be applied to standardize court documents such as indictments in court trial scenarios. Named entity recognition can be used to identify specific legal terms, defendant names, plaintiff names, etc. in court trial documents.

[0223] As another optional manner, before representing the multiple elements obtained by segmenting the to-be-processed text as nodes, the method further includes:

[0224] Obtaining the text to be processed input by the user;

[0225] The performing corresponding processing based on the feature words includes:

[0226] Performing an object search based on the named entity words to obtain search results;

[0227] The search results are provided to the user. For example, in an e-commerce scenario, product names can be found through named entity recognition, and the identified named entity words are also product names. Then, products can be found based on the product names, and the search results can include a product search results page.

[0228] Furthermore, the text to be processed may refer to speech recognition text obtained through speech recognition technology. Therefore, by identifying characteristic words in the speech recognition text, the speech recognition text can be detected and corrected. Therefore, as another optional method, the corresponding processing based on the characteristic words may include:

[0229] The feature words are verified, and the speech recognition text is corrected based on the verification result.

[0230] Among them, the feature word can be verified in combination with the feature word type, and the speech recognition text can be corrected based on the verification result. For example, when the feature word is a colloquial word, the colloquial word can be eliminated from the speech recognition text. When the feature word is a named entity word, the vocabulary corresponding to the named entity type can be combined to find out whether the feature word is in the vocabulary. If not, the user can be prompted to correct the speech recognition text, etc.

[0231] Figure 5 This is a schematic structural diagram of an embodiment of a data processing device provided by the present application. The device may include:

[0232] The first determining module 501 is used to represent multiple elements obtained by segmenting the training text as nodes; wherein the elements are composed of single words or multiple words;

[0233] A second determining module 502 is configured to represent multiple dictionaries of different types as nodes respectively;

[0234] A first construction module 503 is configured to construct a first graph by representing edges between nodes using association relationships between the nodes;

[0235] The model training module 504 is configured to train a text recognition model using the first graphic and the training labels respectively annotated for the plurality of elements.

[0236] In some embodiments, the model training module is specifically used to input the first graphic into a text recognition model, encode it through the text recognition model to obtain the feature vectors of the multiple elements; and train the text recognition model based on the feature vectors of the multiple elements and the training labels respectively marked on the multiple elements.

[0237] The text recognition model may be used to recognize the text to be processed based on the second graph established based on the text to be processed to determine the characteristic words in the text to be processed.

[0238] In some embodiments, the model training module is based on the feature vectors of the multiple elements and the training labels respectively labeled with the multiple elements. Training the text recognition model includes taking the training labels respectively labeled with the multiple elements as the output result of the text recognition model, and training the text recognition model based on the feature vectors of the multiple elements.

[0239] In some embodiments, the text recognition model includes a graphic encoding network and a text recognition network;

[0240] The model training module inputs the first graphic into a text recognition model, and encodes the first graphic via the text recognition model to obtain feature vectors of the multiple elements, including: using the first graphic as input data of the text recognition model, and encoding the first graphic via the graphic encoding network to obtain feature vectors of the multiple elements;

[0241] The model training module uses the training labels respectively annotated for the multiple elements as the output results of the text recognition model, and based on the feature vectors of the multiple elements, trains the text recognition model, including: using the feature vectors of the multiple elements as the input data of the text recognition network, and the training labels respectively annotated for the multiple elements as the output results of the text recognition network, training the text recognition model to obtain model parameters of the graphic encoding network and model parameters of the text recognition network.

[0242] In some embodiments, the model training module uses the first graphic as input data of the text recognition model, and encodes the first graphic via the graphic encoding network to obtain feature vectors of the plurality of elements, including:

[0243] Using the first graph as input data for the text recognition model, performing multiple repeated encoding operations on each node through the graph encoding network in combination with the current encoding vectors of each node adjacent to each node; wherein the first encoding operation for each node is performed based on the initial vector of each node;

[0244] The encoding vectors of the nodes corresponding to the multiple elements obtained by the last encoding are respectively used as the feature vectors of the multiple elements.

[0245] In some embodiments, the first construction module is specifically configured to determine edges between different nodes based on contextual relationships between different elements and matching relationships between different elements and different dictionaries; and construct a first graph based on the edges between different nodes.

[0246] In some embodiments, the second determining module is specifically configured to represent multiple dictionaries of different types as first nodes and second nodes, respectively; wherein the first node represents the start of matching with the element, and the second node represents the end of matching with the element.

[0247] In some embodiments, the elements consist of single words;

[0248] The model training module is specifically used to set a training label for each word according to the label type of the feature word composed of the word, and whether the word is a starting word, a middle word, an end word, a word in the feature word, or a component word that does not belong to any label type;

[0249] The text recognition model is trained using the first graphic and the training labels of the individual words.

[0250] In some embodiments, the model training module is specifically configured to encode the first graphic to obtain feature vectors of the plurality of elements;

[0251] A text recognition model is trained based on the feature vectors of the multiple elements and the training labels respectively annotated with the multiple elements.

[0252] In a practical application, the technical solution of the present application can be applied to a named entity recognition scenario. In the named entity recognition scenario:

[0253] The first determining module is specifically configured to represent a plurality of elements obtained by segmenting the training text as nodes; wherein the elements are composed of a single word or multiple words;

[0254] The second determining module is specifically configured to represent a plurality of dictionaries of different named entity types as nodes respectively.

[0255] Figure 5The data processing device can execute Figure 1 The implementation principle and technical effects of the data processing method described in the illustrated embodiment will not be described in detail. The specific manner in which each module and unit performs operations in the data processing device in the above embodiment has been described in detail in the embodiment of the method and will not be elaborated on here.

[0256] In one possible design, Figure 5 The data processing apparatus of the illustrated embodiment may be implemented as a computing device, such as Figure 6 As shown, the computing device may include a storage component 601 and a processing component 602;

[0257] The storage component 601 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 602 .

[0258] The processing component 602 is used to:

[0259] The multiple elements obtained by segmenting the training text are respectively represented as nodes; wherein the elements are composed of a single word or multiple words;

[0260] Represent multiple dictionaries of different types as nodes;

[0261] Representing edges between nodes by using association relationships between nodes to construct a first graph;

[0262] A text recognition model is trained using the first graphic and the training labels respectively annotated for the multiple elements.

[0263] The processing component 602 may include one or more processors to execute computer instructions to perform all or part of the steps in the above method. Of course, the processing component may also be implemented as one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above method.

[0264] The storage component 601 is configured to store various types of data to support operations in the computing device. The storage component can be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0265] Of course, a computing device may also include other components, such as input / output interfaces and communication components. The input / output interface provides an interface between the processing component and peripheral interface modules, such as output devices and input devices. The communication component is configured to facilitate wired or wireless communication between the computing device and other devices.

[0266] The computing device can be a physical device or an elastic computing host provided by a cloud computing platform. In this case, the computing device can refer to a cloud server, and the processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform. Therefore, as used herein, "computing device" can refer to a remote web server, server, computer networking device, chipset, desktop computer, laptop computer, workstation, or any other processing device or equipment.

[0267] The present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a computer, the above-mentioned Figure 1 The data processing method of the illustrated embodiment.

[0268] Figure 7 This is a schematic diagram of the structure of an embodiment of an identification device provided in an embodiment of the present application. The device may include:

[0269] The third determining module 701 is used to represent the multiple elements obtained by segmenting the text to be processed as nodes respectively; wherein the elements are composed of a single word or multiple words;

[0270] A fourth determining module 702 is configured to represent multiple dictionaries of different types as nodes respectively;

[0271] A second construction module 703 is configured to construct a second graph by representing the edges between the nodes using the association relationships between the nodes;

[0272] The text recognition module 704 is configured to recognize feature words in the text to be processed based on the second graphic using a text recognition model.

[0273] In some embodiments, the text recognition module is specifically configured to recognize, based on the second graphic, labels corresponding to the plurality of elements in the text to be processed using a text recognition model;

[0274] Based on the labels corresponding to the multiple elements, characteristic words in the text to be processed are determined.

[0275] In some embodiments, the text recognition module uses a text recognition model based on the second graphic to identify the labels corresponding to the multiple elements in the text to be processed. Specifically,

[0276] The second graphic is input into the text recognition model, and the text recognition model encodes the second graphic to obtain feature vectors of the multiple elements; based on the feature vectors of the multiple elements, labels corresponding to the multiple elements are identified.

[0277] In some embodiments, the text recognition model includes a graphic encoding network and a text recognition network;

[0278] The text recognition module inputs the second graphic into the text recognition model, and the text recognition model encodes the second graphic to obtain feature vectors of the multiple elements; based on the feature vectors of the multiple elements, identifying labels corresponding to the multiple elements includes:

[0279] The second graphic is input into the text recognition model, and the graphic encoding network encodes the second graphic to obtain feature vectors of the multiple elements; based on the feature vectors of the multiple elements, the text recognition network is used to identify labels corresponding to the multiple elements.

[0280] In a practical application, the technical solution of the present application can be applied to a named entity recognition scenario. In the named entity recognition scenario:

[0281] The third determining module is specifically used to represent the multiple elements obtained by segmenting the to-be-processed text as nodes respectively; wherein the elements are composed of a single word or multiple words;

[0282] The fourth determining module is specifically configured to represent a plurality of dictionaries of different named entity types as nodes respectively;

[0283] The second construction module is specifically configured to represent edges between nodes by using association relationships between the nodes to construct a second graph;

[0284] The text recognition module is specifically configured to recognize named entity words in the text to be processed using a text recognition model based on the second graphic.

[0285] Figure 7 The identification device can perform Figure 3 The implementation principle and technical effects of the identification method described in the illustrated embodiment will not be described in detail. The specific manner in which each module and unit performs operations in the identification device in the above embodiment has been described in detail in the embodiment of the method, and will not be elaborated here.

[0286] In one possible design, Figure 7 The identification device of the embodiment shown can be implemented as a computing device, such as Figure 8As shown, the computing device may include a storage component 801 and a processing component 802;

[0287] The storage component 801 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 802 .

[0288] The processing component 802 is used to:

[0289] Representing multiple elements obtained by segmenting the text to be processed as nodes respectively; wherein the elements are composed of single words or multiple words;

[0290] Represent multiple dictionaries of different types as nodes;

[0291] Representing the edges between the nodes by the association relationship between the nodes, and constructing a second graph;

[0292] Based on the second graph, a text recognition model is used to identify feature words in the text to be processed.

[0293] The processing component 802 may include one or more processors to execute computer instructions to perform all or part of the steps in the above method. Of course, the processing component may also be implemented as one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above method.

[0294] The storage component 801 is configured to store various types of data to support operations in the computing device. The storage component can be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0295] Of course, a computing device may also include other components, such as input / output interfaces and communication components. The input / output interface provides an interface between the processing component and peripheral interface modules, such as output devices and input devices. The communication component is configured to facilitate wired or wireless communication between the computing device and other devices.

[0296] The computing device can be a physical device or an elastic computing host provided by a cloud computing platform. In this case, the computing device can refer to a cloud server, and the processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform. Therefore, as used herein, "computing device" can refer to a remote web server, server, computer networking device, chipset, desktop computer, laptop computer, workstation, or any other processing device or equipment.

[0297] The present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a computer, the above-mentioned Figure 1 The data processing method of the illustrated embodiment.

[0298] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0299] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0300] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0301] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A data processing method, characterized in that: include: The multiple elements obtained by segmenting the training text are respectively represented as nodes; wherein the elements are composed of a single word or multiple words; Represent multiple dictionaries of different types as nodes respectively; The edges between the nodes are represented by the association relationship between the nodes to construct a first graph, wherein the association relationship between the nodes is determined according to the contextual relationship between the elements and the matching relationship between the elements and the dictionary, wherein the matching relationship between the elements and the dictionary means that the dictionary has a matching relationship with each element of the matching words in the training text that matches it; or means that the dictionary has a matching relationship with the first element and the last element of the matching words in the training text that matches it; The first graphic is used as input data of a text recognition model, and the text recognition model is trained using the first graphic and training labels respectively annotated for the multiple elements.

2. The method according to claim 1, characterized in that The training of the text recognition model using the training labels respectively annotated by the first graphic and the plurality of elements comprises: Inputting the first graphic into a text recognition model, and encoding the first graphic via the text recognition model to obtain feature vectors of the plurality of elements; The text recognition model is trained based on the feature vectors of the multiple elements and the training labels respectively annotated with the multiple elements.

3. The method according to claim 2, characterized in that The text recognition model is used to recognize the text to be processed based on the second graph established by the text to be processed to determine the characteristic words in the text to be processed.

4. The method according to claim 2, characterized in that: The training of the text recognition model based on the feature vectors of the multiple elements and the labels respectively annotated by the multiple elements includes: The training labels respectively annotated with the multiple elements are used as output results of the text recognition model, and the text recognition model is trained based on the feature vectors of the multiple elements.

5. The method according to claim 4, characterized in that The text recognition model includes a graphic encoding network and a text recognition network; The step of inputting the first graphic into a text recognition model and encoding the first graphic via the text recognition model to obtain feature vectors of the plurality of elements comprises: Using the first graphic as input data of the text recognition model, encoding the first graphic via the graphic encoding network to obtain feature vectors of the plurality of elements; The taking the training labels respectively annotated by the multiple elements as the output result of the text recognition model, and training the text recognition model based on the feature vectors of the multiple elements comprises: The feature vectors of the multiple elements are used as input data of the text recognition network, the training labels respectively marked for the multiple elements are used as output results of the text recognition network, and the text recognition model is trained to obtain model parameters of the graphic encoding network and the model parameters of the text recognition network.

6. The method according to claim 5, characterized in that Using the first graphic as input data of the text recognition model, encoding the first graphic via the graphic encoding network to obtain feature vectors of the plurality of elements comprises: The first graph is used as input data of the text recognition model, and each node is repeatedly encoded multiple times by combining the current encoding vectors of each node adjacent to each node through the graph encoding network; wherein the first encoding operation of each node is performed based on the initial vector of each node; The encoding vectors of the nodes corresponding to the multiple elements obtained by the last encoding are used as feature vectors of the multiple elements respectively.

7. The method according to claim 1, characterized in that The constructing of the first graph by characterizing the edges between the nodes by the association relationship between the nodes includes: Based on the contextual relationship between different elements and the matching relationship between different elements and different dictionaries, the edges between different nodes are determined; Based on the edges between different nodes, a first graph is constructed.

8. The method according to claim 1, characterized in that The step of representing multiple dictionaries of different types as nodes respectively includes: Each of the multiple dictionaries of different types is represented as a first node and a second node, wherein the first node represents the start of matching with the element, and the second node represents the end of matching with the element.

9. The method according to claim 1, characterized in that: The element consists of a single word; The training of the text recognition model using the training labels respectively annotated by the first graphic and the plurality of elements comprises: For each single word, according to the label type of the feature word composed of the single word, and whether the single word is a starting word, a middle word, an ending word, a single word or a component word that does not belong to any label type in the feature word, a training label of each single word is set; The text recognition model is trained using the first graphic and the training labels of each word.

10. The method according to claim 1, characterized in that The training of the text recognition model using the training labels respectively annotated by the first graphic and the plurality of elements comprises: Encoding the first graph to obtain feature vectors of the plurality of elements; A text recognition model is trained based on the feature vectors of the multiple elements and the training labels respectively annotated with the multiple elements.

11. A recognition method, characterized in that: include: The multiple elements obtained by segmenting the text to be processed are respectively represented as nodes; wherein the elements are composed of a single word or multiple words; Represent multiple dictionaries of different types as nodes respectively; The second graph is constructed by representing the edges between the nodes by the association relationship between the nodes, wherein the association relationship between the nodes is determined according to the contextual relationship between the elements and the matching relationship between the elements and the dictionary, wherein the matching relationship between the elements and the dictionary means that the dictionary has a matching relationship with each element of the matching words in the text to be processed that matches it; or means that the dictionary has a matching relationship with the first element and the last element of the matching words in the text to be processed that matches it; Using the second graph as input data of a text recognition model, identifying labels corresponding to the multiple elements in the text to be processed based on the second graph using the text recognition model, and determining feature words in the text to be processed based on the labels corresponding to the multiple elements; The text recognition model is trained in the following way: The multiple elements obtained by segmenting the training text are represented as nodes respectively; wherein the elements are composed of a single word or multiple words; multiple dictionaries of different types are represented as nodes respectively; the edges between the nodes are represented by the association relationship between the nodes to construct a first graph, wherein the association relationship between the nodes is determined according to the contextual relationship between the elements and the matching relationship between the elements and the dictionaries, wherein the matching relationship between the elements and the dictionaries refers to the dictionary and each element of the matching words in the training text that matches it having a matching relationship; or refers to the dictionary and the first element and the last element of the matching words in the training text that matches it having a matching relationship; the first graph is used as input data of a text recognition model, and the text recognition model is trained using the first graph and the training labels respectively annotated for the multiple elements.

12. The method according to claim 11, characterized in that The step of identifying the labels corresponding to the multiple elements in the text to be processed respectively by using a text recognition model based on the second graphic includes: Inputting the second graphic into the text recognition model, and encoding the second graphic by the text recognition model to obtain feature vectors of the plurality of elements; Based on the feature vectors of the multiple elements, labels corresponding to the multiple elements are identified.

13. The method according to claim 12, characterized in that The text recognition model includes a graphic encoding network and a text recognition network; The step of inputting the second graphic into the text recognition model, and encoding the second graphic by the text recognition model to obtain the feature vectors of the plurality of elements comprises: Inputting the second graphic into the text recognition model, and encoding the second graphic by the graphic encoding network to obtain feature vectors of the multiple elements; The identifying, based on the feature vectors of the multiple elements, labels corresponding to the multiple elements respectively comprises: Based on the feature vectors of the multiple elements, the text recognition network is used to identify labels corresponding to the multiple elements respectively.

14. A data processing method, characterized in that: include: The multiple elements obtained by segmenting the training text are respectively represented as nodes; wherein the elements are composed of a single word or multiple words; Represent multiple dictionaries of different named entity types as nodes respectively; The edges between the nodes are represented by the association relationship between the nodes to construct a first graph, wherein the association relationship between the nodes is determined according to the contextual relationship between the elements and the matching relationship between the elements and the dictionary, wherein the matching relationship between the elements and the dictionary means that the dictionary has a matching relationship with each element of the matching words in the training text that matches it; or means that the dictionary has a matching relationship with the first element and the last element of the matching words in the training text that matches it; The first graphic is used as input data of a text recognition model, and the text recognition model is trained using the first graphic and training labels respectively annotated for the multiple elements.

15. A recognition method, characterized in that: include: The multiple elements obtained by segmenting the text to be processed are respectively represented as nodes; wherein the elements are composed of a single word or multiple words; Represent multiple dictionaries of different named entity types as nodes respectively; The second graph is constructed by representing the edges between the nodes by the association relationship between the nodes, wherein the association relationship between the nodes is determined according to the contextual relationship between the elements and the matching relationship between the elements and the dictionary, wherein the matching relationship between the elements and the dictionary means that the dictionary has a matching relationship with each element of the matching words in the text to be processed that matches it; or means that the dictionary has a matching relationship with the first element and the last element of the matching words in the text to be processed that matches it; Using the second graph as input data of a text recognition model, identifying labels corresponding to the multiple elements in the text to be processed based on the second graph using the text recognition model, and determining named entity words in the text to be processed based on the labels corresponding to the multiple elements; The text recognition model is trained in the following way: Represent multiple elements obtained by segmenting the training text as nodes respectively; wherein the elements are composed of single words or multiple words; represent multiple dictionaries of different named entity types as nodes respectively; characterize the edges between nodes by the association relationship between the nodes, and construct a first graph, wherein the association relationship between the nodes is determined according to the contextual relationship between the elements and the matching relationship between the elements and the dictionaries, wherein the matching relationship between the elements and the dictionaries refers to the dictionary and each element of the matching words in the training text that matches it having a matching relationship; or refers to the dictionary and the first element and the last element of the matching words in the training text that matches it having a matching relationship; use the first graph as input data for the text recognition model, and train the text recognition model using the first graph and the training labels respectively annotated for the multiple elements.

16. A processing method, characterized in that: include: The multiple elements obtained by segmenting the text to be processed are respectively represented as nodes; wherein the elements are composed of a single word or multiple words; Represent multiple dictionaries of different types as nodes respectively; The second graph is constructed by representing the edges between the nodes by the association relationship between the nodes, wherein the association relationship between the nodes is determined according to the contextual relationship between the elements and the matching relationship between the elements and the dictionary, wherein the matching relationship between the elements and the dictionary means that the dictionary has a matching relationship with each element of the matching words in the text to be processed that matches it; or means that the dictionary has a matching relationship with the first element and the last element of the matching words in the text to be processed that matches it; Using the second graph as input data of a text recognition model, identifying labels corresponding to the multiple elements in the text to be processed based on the second graph using the text recognition model, and determining feature words in the text to be processed based on the labels corresponding to the multiple elements; Based on the feature words, perform corresponding processing; The text recognition model is trained in the following way: The multiple elements obtained by segmenting the training text are represented as nodes respectively; wherein the elements are composed of a single word or multiple words; multiple dictionaries of different types are represented as nodes respectively; the edges between the nodes are represented by the association relationship between the nodes to construct a first graph, wherein the association relationship between the nodes is determined according to the contextual relationship between the elements and the matching relationship between the elements and the dictionaries, wherein the matching relationship between the elements and the dictionaries refers to the dictionary and each element of the matching words in the training text that matches it having a matching relationship; or refers to the dictionary and the first element and the last element of the matching words in the training text that matches it having a matching relationship; the first graph is used as input data of a text recognition model, and the text recognition model is trained using the first graph and the training labels respectively annotated for the multiple elements.

17. The method according to claim 16, characterized in that The characteristic word is a colloquial word; and the corresponding processing based on the characteristic word includes: The colloquial words are eliminated from the text to be processed to obtain a standard text.

18. The method according to claim 16, characterized in that The feature word is a named entity word; and the corresponding processing based on the feature word includes: According to the named entity words and the named entity types of the named entity words, information is extracted from the text to be processed to obtain a structured text.

19. The method according to claim 16, characterized in that The feature word is a named entity word; before the plurality of elements obtained by segmenting the text to be processed are represented as nodes respectively, the method further includes: Obtain the text to be processed input by the user; The performing corresponding processing based on the feature word includes: Performing object search based on the named entity words to obtain search results; The search results are provided to the user.

20. The method according to claim 16, characterized in that The text to be processed is a speech recognition text; The performing corresponding processing based on the feature word includes: The characteristic words are verified, and the speech recognition text is corrected based on the verification result.

21. A data processing device, characterized in that: include: A first determination module is used to represent multiple elements obtained by segmenting the training text as nodes respectively; wherein the elements are composed of a single word or multiple words; A second determination module is used to represent multiple dictionaries of different types as nodes respectively; A first construction module is used to construct a first graph by representing the edges between nodes by the association relationship between the nodes, wherein the association relationship between the nodes is determined according to the contextual relationship between the elements and the matching relationship between the elements and the dictionary, wherein the matching relationship between the elements and the dictionary means that the dictionary has a matching relationship with each element of the matching words in the training text that matches it; or means that the dictionary has a matching relationship with the first element and the last element of the matching words in the training text that matches it; The model training module is used to use the first graphic as input data of the text recognition model, and train the text recognition model using the first graphic and the training labels respectively annotated for the multiple elements.

22. An identification device, characterized in that: include: A third determination module is used to represent multiple elements obtained by segmenting the to-be-processed text as nodes respectively; wherein the elements are composed of a single word or multiple words; A fourth determination module, used to represent multiple dictionaries of different types as nodes respectively; A second construction module is used to construct a second graph by characterizing the edges between different nodes by the association relationship between the nodes, wherein the association relationship between the nodes is determined according to the contextual relationship between the elements and the matching relationship between the elements and the dictionary, wherein the matching relationship between the elements and the dictionary means that the dictionary has a matching relationship with each element of the matching words in the text to be processed that matches it; or means that the dictionary has a matching relationship with the first element and the last element of the matching words in the text to be processed that matches it; a text recognition module, configured to use the second graphic as input data of a text recognition model, identify labels corresponding to the multiple elements in the text to be processed based on the second graphic using the text recognition model, and determine feature words in the text to be processed based on the labels corresponding to the multiple elements; The text recognition model is trained in the following way: The multiple elements obtained by segmenting the training text are represented as nodes respectively; wherein the elements are composed of a single word or multiple words; multiple dictionaries of different types are represented as nodes respectively; the edges between the nodes are represented by the association relationship between the nodes to construct a first graph, wherein the association relationship between the nodes is determined according to the contextual relationship between the elements and the matching relationship between the elements and the dictionaries, wherein the matching relationship between the elements and the dictionaries refers to the dictionary and each element of the matching words in the training text that matches it having a matching relationship; or refers to the dictionary and the first element and the last element of the matching words in the training text that matches it having a matching relationship; the first graph is used as input data of a text recognition model, and the text recognition model is trained using the first graph and the training labels respectively annotated for the multiple elements.

23. A computing device, characterized in that including a processing component and a storage component; The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component; The processing component is used to: The multiple elements obtained by segmenting the training text are respectively represented as nodes; wherein the elements are composed of a single word or multiple words; Represent multiple dictionaries of different types as nodes respectively; The first graph is constructed by representing the edges between different nodes by the association relationship between the nodes, wherein the association relationship between the nodes is determined according to the contextual relationship between the elements and the matching relationship between the elements and the dictionary, wherein the matching relationship between the elements and the dictionary means that the dictionary has a matching relationship with each element of the matching words in the training text that matches it; or means that the dictionary has a matching relationship with the first element and the last element of the matching words in the training text that matches it; The first graphic is used as input data of a text recognition model, and the text recognition model is trained using the first graphic and training labels respectively annotated for the multiple elements.

24. A computing device, characterized in that including a processing component and a storage component; The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component; The processing component is used to: The multiple elements obtained by segmenting the text to be processed are respectively represented as nodes; wherein the elements are composed of a single word or multiple words; Represent multiple dictionaries of different types as nodes respectively; The second graph is constructed by characterizing the edges between different nodes by the association relationship between the nodes, wherein the association relationship between the nodes is determined according to the contextual relationship between the elements and the matching relationship between the elements and the dictionary, wherein the matching relationship between the elements and the dictionary means that the dictionary has a matching relationship with each element of the matching words in the text to be processed that matches it; or means that the dictionary has a matching relationship with the first element and the last element of the matching words in the text to be processed that matches it; Using the second graph as input data of a text recognition model, identifying labels corresponding to the multiple elements in the text to be processed based on the second graph using the text recognition model, and determining feature words in the text to be processed based on the labels corresponding to the multiple elements; The text recognition model is trained in the following way: The multiple elements obtained by segmenting the training text are represented as nodes respectively; wherein the elements are composed of a single word or multiple words; multiple dictionaries of different types are represented as nodes respectively; the edges between the nodes are represented by the association relationship between the nodes to construct a first graph, wherein the association relationship between the nodes is determined according to the contextual relationship between the elements and the matching relationship between the elements and the dictionaries, wherein the matching relationship between the elements and the dictionaries refers to the dictionary and each element of the matching words in the training text that matches it having a matching relationship; or refers to the dictionary and the first element and the last element of the matching words in the training text that matches it having a matching relationship; the first graph is used as input data of a text recognition model, and the text recognition model is trained using the first graph and the training labels respectively annotated for the multiple elements.