Text recognition method and device, computer equipment, storage medium and computer program product

Through the combination of word segmentation and tag recognition network, multiple tag links are generated to improve the accuracy of nested named entity recognition, solving the problem of inaccurate identification in the prior art, and achieving higher recognition accuracy and robustness .

CN119204010APending Publication Date: 2024-12-27SUGON INFORMATION IND +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411140007.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing nested named entity recognition method has the problem of inaccurate recognition, and it is difficult to effectively identify nested named entities in text.

Method used

By inputting the text to be recognized to the word segmentation network for word segmentation processing, generating a sequence of word segmentation to be recognized, and then inputting it into the recognition network for label recognition, generating multiple tag links, comprehensively considering the prediction results of different tags, dynamically adjusting the tag selection to Improve identification accuracy.

Benefits of technology

Improve the accuracy and robustness of nested named entity recognition, ensure the statistically most likely correctness of the recognition results, and maintain the structural and information integrity of the original text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119204010A_ABST
    Figure CN119204010A_ABST
Patent Text Reader

Abstract

The invention relates to a text recognition method and device, computer equipment, a storage medium and a computer program product, and the method comprises the steps: inputting a to-be-recognized text into a word segmentation network for word segmentation processing, obtaining a to-be-recognized word segmentation sequence, and then inputting the to-be-recognized word segmentation sequence into a recognition network for tag recognition. Obtaining a plurality of label links corresponding to the to-be-recognized word segmentation sequence, and finally recognizing the to-be-recognized text according to the plurality of label links to obtain a recognition result. Wherein each node on each label link represents a label of each word segmentation vector in the word segmentation sequence to be identified. According to the method, the to-be-identified text is generated into a plurality of label links, different label prediction results can be comprehensively considered, information in the text can be captured more comprehensively, limitation possibly brought by single prediction is overcome, and therefore the accuracy and robustness of overall identification are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and in particular to a text recognition method, apparatus, computer equipment, storage medium and computer program product. Background Art

[0002] Named Entity Recognition (NER) is a very important task in natural language processing. It is widely used in many scenarios such as text information understanding, knowledge question and answer, retrieval, and graph construction. Its main purpose is to identify entities with specific meanings or strong referentiality from text, such as names of people, places, names of organizations, dates, times, etc. Nested named entities are a special case in which one entity contains another shorter entity. For example, in a sentence, there may be multiple levels of nested entities such as geographic entities, organizational entities, and position entities.

[0003] Currently, when identifying nested named entities, a method of setting multiple annotation layers is usually used to identify multiple nested named entities, and then candidate entities are classified to identify the nested named entities.

[0004] However, the above nested named entity recognition method has the problem of inaccurate recognition. Summary of the invention

[0005] Based on this, it is necessary to provide a text recognition method, apparatus, computer device, storage medium and computer program product that can improve recognition accuracy in response to the above technical problems.

[0006] In a first aspect, the present application provides a text recognition method, the method comprising:

[0007] Input the text to be recognized into the word segmentation network for word segmentation processing to obtain the word segmentation sequence to be recognized;

[0008] The word segmentation sequence to be identified is input into the recognition network for label identification, and multiple label links corresponding to the word segmentation sequence to be identified are obtained; each node on each label link represents the label of each word segmentation vector in the word segmentation sequence to be identified;

[0009] The text to be recognized is recognized according to multiple label links to obtain a recognition result.

[0010] The text recognition method provided by the embodiment of the present application obtains a sequence of word segments to be recognized by inputting the text to be recognized into a word segmentation network for word segmentation processing, and then inputs the sequence of word segments to be recognized into a recognition network for label recognition to obtain multiple label links corresponding to the sequence of word segments to be recognized, and finally recognizes the text to be recognized based on the multiple label links to obtain a recognition result. Among them, each node on each label link represents the label of each word segmentation vector in the sequence of word segments to be recognized. The above method can comprehensively consider different label prediction results by generating multiple label links for the text to be recognized, and can more comprehensively capture the information in the text to overcome the limitations that may be caused by a single prediction, thereby improving the accuracy and robustness of the overall recognition.

[0011] In one embodiment, a word segmentation sequence to be identified is input into a recognition network for label identification, and a plurality of label links corresponding to the word segmentation sequence to be identified are obtained, including:

[0012] Input the word segmentation sequence to be identified into the recognition network for label recognition, and obtain the first candidate label corresponding to the first word segmentation vector;

[0013] The first candidate label corresponding to the first word segmentation vector and the word segmentation sequence to be identified are input into the recognition network for label identification to obtain the second candidate label corresponding to the second word segmentation vector;

[0014] A plurality of label links are determined according to the first candidate label, the second candidate label, the word segmentation sequence to be identified, and the identification network.

[0015] In one embodiment, determining a plurality of label links according to the first candidate label, the second candidate label, the word sequence to be identified, and the identification network includes:

[0016] The first candidate label and the second candidate label are used as new first candidate labels, and based on the new first candidate label, the first candidate label corresponding to the first word segmentation vector and the word segmentation sequence to be identified are input into the recognition network for label identification to obtain the second candidate label corresponding to the second word segmentation vector, until the candidate labels corresponding to all word segmentation vectors in the word segmentation sequence to be identified are determined;

[0017] According to the candidate labels corresponding to all word segmentation vectors, multiple label links are determined.

[0018] The method described in the embodiment of the present application can fully integrate the existing context information during the recognition process by inputting the candidate label corresponding to the previous word segmentation vector and the word segmentation sequence to be recognized into the recognition network for recognition when identifying the candidate label corresponding to the next word segmentation vector, so that the output sequence has higher quality, thereby improving the recognition accuracy. Moreover, the label selection is dynamically adjusted during the recognition process, so that the recognition network optimizes the prediction of subsequent labels based on the existing labels, which helps to reduce error propagation.

[0019] In one embodiment, the text to be recognized is recognized according to the multiple tag links to obtain a recognition result, including:

[0020] Select the label link with the largest total probability value from multiple label links as the target label link;

[0021] The text to be recognized is recognized according to the target label link to obtain the recognition result.

[0022] In one embodiment, the text to be recognized is recognized according to the target tag link to obtain a recognition result, including:

[0023] Determine the label corresponding to each node on the target label link;

[0024] Convert the label corresponding to each node into the corresponding target word to obtain the recognition result.

[0025] The method described in the embodiment of the present application can ensure that the selected label link is statistically most likely to be correct by selecting the label link with the largest total probability value, thereby improving the accuracy of recognition. Therefore, the subsequent conversion of the labels of each node on the target label link into the corresponding target word segmentation process also helps to maintain the structure and information integrity of the original text, making the recognition result more accurate and reliable.

[0026] In one embodiment, the recognition network includes a self-attention subnetwork, a cross-attention subnetwork, and a classification subnetwork. The word segmentation sequence to be recognized is input into the recognition network for label recognition, and a first candidate label corresponding to the first word segmentation vector is obtained, including:

[0027] Input the word sequence to be identified into the self-attention sub-network to extract context features and obtain context features;

[0028] Input the context features and the word sequence to be identified into the cross attention sub-network to extract global features and obtain global features;

[0029] The global features are input into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector.

[0030] In one embodiment, the identification network further includes a dimension reduction subnetwork, and the method further includes:

[0031] The global features are input into the dimension reduction sub-network for feature dimension reduction extraction to obtain the dimension reduction features;

[0032] The global features are input into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector, including:

[0033] The reduced dimensionality features are input into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector.

[0034] The method described in the embodiments of the present application is that the self-attention sub-network can improve the accuracy of feature extraction by paying attention to the influence of each word segmentation in the context on the target word segmentation, and can better understand the semantics of the word segmentation. The cross-attention sub-network can extract global features by combining context features and word segmentation sequences, taking into account the relationship between word segmentations, and can improve the overall accuracy of label recognition. The dimensionality reduction sub-network can reduce the dimensionality of global features, remove redundant information, make the feature representation more compact, and help improve the efficiency and accuracy of the classification network.

[0035] In a second aspect, the present application further provides a text recognition device, the device comprising:

[0036] The word segmentation processing module is used to input the text to be recognized into the word segmentation network for word segmentation processing to obtain a sequence of word segments to be recognized;

[0037] The label recognition module is used to input the word segmentation sequence to be recognized into the recognition network for label recognition, and obtain multiple label links corresponding to the word segmentation sequence to be recognized; each node on each label link represents the label of each word segmentation vector in the word segmentation sequence to be recognized;

[0038] The text recognition module is used to recognize the text to be recognized according to multiple label links to obtain a recognition result.

[0039] In a third aspect, the present application further provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:

[0040] Input the text to be recognized into the word segmentation network for word segmentation processing to obtain the word segmentation sequence to be recognized;

[0041] The word segmentation sequence to be identified is input into the recognition network for label identification, and multiple label links corresponding to the word segmentation sequence to be identified are obtained; each node on each label link represents the label of each word segmentation vector in the word segmentation sequence to be identified;

[0042] The text to be recognized is recognized according to multiple label links to obtain a recognition result.

[0043] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0044] Input the text to be recognized into the word segmentation network for word segmentation processing to obtain the word segmentation sequence to be recognized;

[0045] The word segmentation sequence to be identified is input into the recognition network for label identification, and multiple label links corresponding to the word segmentation sequence to be identified are obtained; each node on each label link represents the label of each word segmentation vector in the word segmentation sequence to be identified;

[0046] The text to be recognized is recognized according to multiple label links to obtain a recognition result.

[0047] In a fifth aspect, the present application further provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0048] Input the text to be recognized into the word segmentation network for word segmentation processing to obtain the word segmentation sequence to be recognized;

[0049] The word segmentation sequence to be identified is input into the recognition network for label identification, and multiple label links corresponding to the word segmentation sequence to be identified are obtained; each node on each label link represents the label of each word segmentation vector in the word segmentation sequence to be identified;

[0050] The text to be recognized is recognized according to multiple label links to obtain a recognition result.

[0051] The above-mentioned text recognition method, device, computer equipment, storage medium and computer program product, the method inputs the text to be recognized into the word segmentation network for word segmentation processing to obtain the word segmentation sequence to be recognized, and then inputs the word segmentation sequence to be recognized into the recognition network for label recognition to obtain multiple label links corresponding to the word segmentation sequence to be recognized, and finally recognizes the text to be recognized according to the multiple label links to obtain the recognition result. Among them, each node on each label link represents the label of each word segmentation vector in the word segmentation sequence to be recognized. The above-mentioned method can comprehensively consider different label prediction results by generating multiple label links from the text to be recognized, and can more comprehensively capture the information in the text to overcome the limitations that may be caused by a single prediction, thereby improving the accuracy and robustness of the overall recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 is an internal structure diagram of a computer device in one embodiment;

[0053] Figure 2 A flowchart of a text recognition method in one embodiment;

[0054] Figure 3 is a flowchart of a text recognition method in another embodiment;

[0055] Figure 4 is a flowchart of a text recognition method in another embodiment;

[0056] Figure 5 is a flowchart of a text recognition method in another embodiment;

[0057] Figure 6 is a flowchart of a text recognition method in another embodiment;

[0058] Figure 7 is a flowchart of a text recognition method in another embodiment;

[0059] Figure 8 is a flowchart of a text recognition method in another embodiment;

[0060] Fig. 9 is a flowchart of a text recognition method in another embodiment;

[0061] Fig.10 is a flowchart of a text recognition method in another embodiment;

[0062] Fig.11 FIG. 4 is a structural block diagram of a text recognition device in an embodiment. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0064] Named Entity Recognition (NER) is a very important task in natural language processing. It is widely used in many scenarios such as text information understanding, knowledge question and answer, retrieval, graph construction, etc. Its main purpose is to identify entities with specific meanings or strong referentiality from text, such as names of people, places, names of organizations, dates, times, etc. Nested named entities are a special case in which one entity contains another shorter entity. For example, in a sentence, there may be multiple levels of nested entities such as geographical entities, organizational entities, and position entities. At present, when identifying nested named entities, multiple nested named entities are usually identified by setting multiple annotation layers and then classifying the candidate entities to identify the nested named entities. However, the above-mentioned nested named entity recognition method has the problem of inaccurate recognition. The present application provides a text recognition method, which aims to solve the above-mentioned technical problems. The following embodiments will specifically illustrate the text recognition method described in the present application.

[0065] The text recognition method provided in the embodiment of the present application can be applied to Figure 1 In the computer device shown in the figure, the computer device can be a terminal or a server, and its internal structure diagram can be as shown in FIG. Figure 1 As shown, the computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a text recognition method is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0066] Those skilled in the art will understand that Figure 1The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0067] In one embodiment, Figure 2 As shown, a text recognition method is provided, which is applied to Figure 1 The computer device in the example is used to illustrate, including the following steps:

[0068] S201, input the text to be recognized into the word segmentation network for word segmentation processing to obtain a sequence of word segments to be recognized.

[0069] Among them, the text to be recognized can be a nested named entity text, a flat named entity text, or a text to be recognized composed of a nested named entity text and a flat named entity text. The nested named entity text includes multiple nested named entities. For example, "Xinhua Bookstore in Jinshan District, Shanghai officially opened today" is a nested named entity text, in which "Shanghai" and "Jinshan District" are geopolitical entities, and "Xinhua Bookstore" is a geographic location entity. The flat named entity text includes a single named entity, for example, "Xinhua Bookstore officially opened today", in which "Xinhua Bookstore" is a geographic location entity. The word segmentation network can be a neural network, a deep convolutional neural network, or a machine learning algorithm. The word segmentation network is used to perform word segmentation processing on the text to be recognized. The word segmentation sequence to be recognized includes multiple word segmentation vectors corresponding to the text to be recognized.

[0070] In an embodiment of the present application, the computer device can pre-train the initial word segmentation network based on the recognition text sample to obtain the word segmentation network. Optionally, the computer device can directly obtain the trained BERT encoder as the word segmentation network. When it is necessary to recognize the text to be recognized, the computer device can obtain the text to be recognized, and after obtaining the text to be recognized, the text to be recognized can be processed to obtain a text input sequence, and then the text input sequence is input into the word segmentation network for word segmentation processing to obtain a word segmentation sequence to be recognized. For example, the acquired text to be recognized is "Xinhua Bookstore in Jinshan District, Shanghai officially opened today", then the word segmentation sequence to be recognized obtained after word segmentation processing can include Shanghai, Jinshan District, Xinhua Bookstore, today, officially, opened; optionally, it can also be Shanghai, City, Jinshan, District, Xinhua, Bookstore, today, officially, opened. Optionally, after obtaining the text to be recognized, the computer device can first perform denoising on the text to be recognized, and then input the denoising text to be recognized into the word segmentation network for word segmentation processing to obtain a word segmentation sequence to be recognized.

[0071] S202, input the word segmentation sequence to be identified into the recognition network for label identification, and obtain multiple label links corresponding to the word segmentation sequence to be identified; each node on each label link represents the label of each word segmentation vector in the word segmentation sequence to be identified.

[0072] Among them, the recognition network can be a neural network, a deep convolutional neural network, or a machine learning algorithm. Specifically, the recognition network can adopt a neural network with a Transformer architecture. The number of nodes on the label link is the same as the number of word segmentation vectors in the word segmentation sequence to be identified, and each node on the label link represents the label of each word segmentation vector in the word segmentation sequence to be identified. The label of the word segmentation vector includes at least one of entity content, non-entity content, entity left boundary, entity right boundary, entity category, and separator between entity and entity category.

[0073] In an embodiment of the present application, the computer device can pre-train the initial recognition network based on the word segmentation sequence samples to obtain the recognition network. Specifically, the training can be performed by teacher-forcing. Teacher-forcing means that during the training phase, the correct annotation results in the data set are used as the input of the recognition network, instead of using the output of the recognition network. In this way, the input sequence of the previous context is always correct when the recognition network predicts each word segmentation vector, and there will be no problem of wrong data misleading the model. On the other hand, teacher-forcing makes it possible to train without waiting for the output of the label at the previous moment. In this way, all the output labels in a piece of data can be trained in parallel at the same time, greatly improving the efficiency of training. The recognition network during teacher-forcing training can be expressed by the formula:

[0074]

[0075] in To identify the hidden state of the network, is the word sequence to be recognized, and the recognition network The time step output is a character and hidden state .

[0076] Optionally, the computer device can directly obtain a trained neural network as a recognition network. After the computer device obtains the word segmentation sequence to be recognized based on the above steps, the word segmentation sequence to be recognized can be input into the recognition network, and multiple possible label links are generated for the word segmentation sequence to be recognized through the recognition network.

[0077] S203, recognizing the text to be recognized according to the multiple label links to obtain a recognition result.

[0078] Among them, the recognition results include named entities. For example, the recognition results corresponding to "Xinhua Bookstore in Jinshan District, Shanghai officially opened today" are "Shanghai", "Jinshan District" and "Xinhua Bookstore". For another example, the recognition result corresponding to "Xinhua Bookstore officially opened today" is "Xinhua Bookstore".

[0079] In an embodiment of the present application, after the computer device obtains multiple label links based on the above steps, it can select the best label link from the multiple label links, and then perform text recognition based on the best label link to obtain a recognition result. Specifically, after obtaining multiple label links, the computer device can evaluate each label link, and then select the best label link from the multiple label links based on the evaluation result. For example, multiple label links are input into the evaluation network to evaluate each label link to obtain an evaluation result. Optionally, each label link can be evaluated by an evaluation algorithm to obtain an evaluation result.

[0080] The text recognition method provided by the embodiment of the present application obtains a sequence of word segments to be recognized by inputting the text to be recognized into a word segmentation network for word segmentation processing, and then inputs the sequence of word segments to be recognized into a recognition network for label recognition to obtain multiple label links corresponding to the sequence of word segments to be recognized, and finally recognizes the text to be recognized based on the multiple label links to obtain a recognition result. Among them, each node on each label link represents the label of each word segmentation vector in the sequence of word segments to be recognized. The above method can comprehensively consider different label prediction results by generating multiple label links for the text to be recognized, and can more comprehensively capture the information in the text to overcome the limitations that may be caused by a single prediction, thereby improving the accuracy and robustness of the overall recognition.

[0081] In one embodiment, a specific implementation method for obtaining multiple label links corresponding to the word segmentation sequence to be identified is also provided, such as Figure 3 As shown, the above step S202 of "inputting the to-be-recognized word segmentation sequence into the recognition network for label recognition to obtain multiple label links corresponding to the to-be-recognized word segmentation sequence" includes:

[0082] S301, input the word segmentation sequence to be recognized into the recognition network for label recognition, and obtain the first candidate label corresponding to the first word segmentation vector.

[0083] The first candidate label may be a label corresponding to a plurality of first word segmentation vectors with a higher label probability.

[0084] In an embodiment of the present application, after the computer device obtains the word segmentation sequence to be identified, the word segmentation sequence to be identified can be input into the recognition network, and the label probability of the first word segmentation vector is calculated through the recognition network to obtain the probability of each label corresponding to the first word segmentation vector, and the labels with the highest probability in the probability of each label corresponding to the first word segmentation vector can be determined as the first candidate labels corresponding to the first word segmentation vector. Among them, the preset number can be 3, 2, or more, which is determined according to the actual accuracy requirements. For example, if the first word segmentation vector is A and the preset number is 3, then the first candidate labels can be A1, A2, and A3.

[0085] S302, input the first candidate label corresponding to the first word segmentation vector and the word segmentation sequence to be identified into the recognition network for label identification, and obtain the second candidate label corresponding to the second word segmentation vector.

[0086] The second candidate label may be a label corresponding to a plurality of second word segmentation vectors with a higher label probability.

[0087] In the embodiment of the present application, after the computer device obtains the first candidate label based on the above steps, the first candidate label and the word segmentation sequence to be identified can be input into the recognition network, and the label probability of the second word segmentation vector is calculated through the recognition network to obtain the probability of each label corresponding to the second word segmentation vector, and the labels with the highest probability in the probability of each label corresponding to the second word segmentation vector can be determined as the second candidate labels corresponding to the second word segmentation vector. For example, the second word segmentation vector is B, and the preset number is 3, then the second candidate labels include B11, B12, B13 under A1; B21, B22, B23 under A2; B31, B32, B33 under A3.

[0088] S303, determining a plurality of label links according to the first candidate label, the second candidate label, the sequence of word segments to be identified, and the identification network.

[0089] In an embodiment of the present application, after the computer device obtains the first candidate label and the second candidate label based on the above steps, it can repeat the above steps to obtain the third candidate label, the fourth candidate label, the fifth candidate label... based on the first candidate label, the second candidate label, the word segmentation sequence to be identified, and the recognition network, and then form multiple label links based on the first candidate label, the second candidate label, the third candidate label, the fourth candidate label, the fifth candidate label...

[0090] Specifically, Figure 4 As shown, the above step S303 of “determining multiple label links according to the first candidate label, the second candidate label, the sequence of word segments to be identified, and the identification network” includes:

[0091] S3031, taking the first candidate label and the second candidate label as the new first candidate label, and returning to the step of inputting the first candidate label corresponding to the first word segmentation vector and the word segmentation sequence to be identified into the recognition network for label identification, and obtaining the second candidate label corresponding to the second word segmentation vector, based on the new first candidate label, until the candidate labels corresponding to all word segmentation vectors in the word segmentation sequence to be identified are determined.

[0092] The new first candidate tag is a tag composed of the first candidate tag and the second candidate tag.

[0093] In an embodiment of the present application, after the computer device obtains the first candidate label and the second candidate label, it can use the first candidate label and the second candidate label as the new first candidate label, and then input the new first candidate label and the word segmentation sequence to be identified into the recognition network for label identification to obtain the third candidate label corresponding to the third word segmentation vector. For example, the second word segmentation vector is B, and the preset number is 3, then the second candidate labels include C111, C112, C113 under B11; C121, C122, C123 under B12... C331, C332, C333 under B33. The above step S302 is repeated until the fourth candidate label, the fifth candidate label... are obtained.

[0094] Exemplarily, the process of determining the candidate labels corresponding to all word segmentation vectors in the word segmentation sequence to be identified may be:

[0095]

[0096] Among them, x is the word sequence to be identified, are the first candidate label, the second candidate label, ... the nth candidate label respectively.

[0097] S3032: Determine multiple label links based on the candidate labels corresponding to all word segmentation vectors.

[0098] In the embodiment of the present application, after the computer device obtains the candidate labels corresponding to all word segmentation vectors based on the above steps, it can form multiple label links through the first candidate label, the second candidate label, the third candidate label, the fourth candidate label, the fifth candidate label..., and the first node on each specific label link is a label in the first candidate label, and the second node is a label in the second candidate label under a label in the first candidate label, and so on, multiple label links can be obtained. Among them, each link is composed of ABC..., for example, link 1 is A, A1, B11, C111...

[0099] The method described in the embodiment of the present application can fully integrate the existing context information during the recognition process by inputting the candidate label corresponding to the previous word segmentation vector and the word segmentation sequence to be recognized into the recognition network for recognition when identifying the candidate label corresponding to the next word segmentation vector, so that the output sequence has higher quality, thereby improving the recognition accuracy. Moreover, the label selection is dynamically adjusted during the recognition process, so that the recognition network optimizes the prediction of subsequent labels based on the existing labels, which helps to reduce error propagation.

[0100] In one embodiment, a specific implementation method for identifying the text to be identified based on multiple tag links is also provided, such as Figure 5 As shown, the above step S203 of "recognizing the text to be recognized according to multiple label links to obtain a recognition result" includes:

[0101] S401 , selecting a label link with the largest total probability value from multiple label links as a target label link.

[0102] Among them, the total probability value of the target label link is the largest.

[0103] In an embodiment of the present application, after obtaining multiple label links, the computer device can multiply the probability values ​​of each node on each label link to obtain a total probability value of each label link, and then determine the label link with the largest total probability value as the target label link.

[0104] S402, recognizing the text to be recognized according to the target label link to obtain a recognition result.

[0105] In an embodiment of the present application, after the computer device obtains the target label link based on the above steps, it can determine the label of each node on the target label link, and then determine the label of each node as the label of the word segmentation vector corresponding to each node, so as to obtain the label corresponding to each word segmentation vector. Finally, based on the label corresponding to each word segmentation vector, the text to be recognized is recognized to obtain a recognition result. Specifically, the label corresponding to each word segmentation vector can be input into a preset label recognition network for recognition to obtain a recognition result.

[0106] Optional, such as Figure 6 As shown, the above step S402 of "recognizing the text to be recognized according to the target tag link to obtain a recognition result" includes:

[0107] S4021, determine the label corresponding to each node on the target label link.

[0108] In the embodiment of the present application, after the computer device obtains the target label link based on the above steps, it can determine the label of each node on the target label link.

[0109] S4022, convert the label corresponding to each node into the corresponding target word segmentation to obtain the recognition result.

[0110] Among them, the target word segmentation is the word segmentation vector corresponding to the label corresponding to each node.

[0111] In an embodiment of the present application, after the computer device obtains the label corresponding to each node on the target label link based on the above steps, it can determine the label of each node as the label of the word segmentation vector corresponding to each node, and then obtain the label corresponding to each word segmentation vector, and then convert the label corresponding to each node into the corresponding target word segmentation according to the pre-set conversion rule to obtain the recognition result. Among them, the conversion rule is used to convert the label into a word segmentation, that is, the conversion rule is the mapping relationship between the label and the word segmentation. Exemplarily, the conversion rule can be shown in the following table:

[0112]

[0113] like Figure 7 As shown in the figure, the first row in the picture represents the labels corresponding to each node on the target label link, and the labels corresponding to each node in the second row are converted to the corresponding target segmentation. Among them, the computer device uses the symbol "Delete" to identify non-entity characters and "Keep" to identify entity characters in the output, and each "Delete" or "Keep" corresponds to a character in the input sequence. The sum of the number of "Keep" and "Delete" in the output sequence should be equal to the number of characters in the input sequence, so that the position of each character can be marked. Therefore, the left and right brackets "[", "]" are used to identify the left and right boundaries of the entity. Because the brackets can also be nested, this method can handle flat named entity recognition and nested named entity recognition at the same time. In addition, the category of the entity needs to be displayed. Moreover, the computer device inserts the separator "|" after the entity character marker and before the entity right boundary bracket "]", followed by the pre-agreed entity category label. It can be seen that the conversion rule can uniformly handle both nested named entity recognition and non-nested named entity recognition.

[0114] The method described in the embodiment of the present application can ensure that the selected label link is statistically most likely to be correct by selecting the label link with the largest total probability value, thereby improving the accuracy of recognition. Therefore, the subsequent conversion of the labels of each node on the target label link into the corresponding target word segmentation process also helps to maintain the structure and information integrity of the original text, making the recognition result more accurate and reliable.

[0115] In one embodiment, the recognition network includes a self-attention subnetwork, a cross-attention subnetwork, and a classification subnetwork. On this basis, a specific implementation method for obtaining a first candidate label corresponding to a first word segmentation vector is also provided, such as Figure 8As shown, the above step S301 of "inputting the word segmentation sequence to be identified into the recognition network for label identification to obtain the first candidate label corresponding to the first word segmentation vector" includes:

[0116] S501, input the word segmentation sequence to be identified into the self-attention sub-network to extract context features and obtain context features.

[0117] Among them, the self-attention sub-network is used to extract context features. Context features are used to describe the context dependencies within the sequence of words to be identified.

[0118] In an embodiment of the present application, the computer device may pre-train the initial self-attention sub-network based on the word segmentation samples to obtain the self-attention sub-network. Optionally, the computer device may obtain the trained self-attention sub-network. After the computer device obtains the word segmentation sequence to be identified, the word segmentation sequence to be identified may be input into the self-attention sub-network to extract context features and obtain context features.

[0119] S502, input the context features and the word segmentation sequence to be identified into the cross-attention sub-network to extract global features to obtain global features.

[0120] Among them, the cross attention sub-network is used to extract global features. Global features are used to describe the global information of the word sequence to be recognized.

[0121] In an embodiment of the present application, after the computer device obtains the context features based on the above steps, the context features and the word segmentation sequence to be identified can be input into the cross-attention sub-network to extract global features to obtain global features.

[0122] S503: Input the global features into the classification network for label recognition to obtain a first candidate label corresponding to the first word segmentation vector.

[0123] The classification network is used to predict the probability corresponding to each label. The classification network can specifically adopt a softmax classifier.

[0124] In an embodiment of the present application, the computer device can pre-train the initial classification network based on the field samples and the annotated labels to obtain the classification network. Optionally, the computer device can obtain a pre-trained neural network as the classification network. After the computer device obtains the global features based on the above steps, the global features can be input into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector.

[0125] Optionally, the above recognition network also includes a dimensionality reduction sub-network, such as Fig. 9 As shown, the method also includes:

[0126] S504: input the global features into the dimension reduction sub-network to perform feature dimension reduction extraction to obtain dimension reduction features.

[0127] Among them, the dimensionality reduction subnetwork is used to reduce the dimensionality of high-dimensional features to obtain low-dimensional features.

[0128] In an embodiment of the present application, the computer device may pre-train the initial dimension reduction sub-network based on the field samples to obtain the dimension reduction sub-network. Optionally, the computer device may also obtain a trained neural network as the dimension reduction sub-network. After obtaining the global features, the computer device may input the global features into the dimension reduction sub-network for feature dimension reduction extraction to obtain the dimension reduction features.

[0129] Correspondingly, when the computer device executes step S503 "inputting the global feature into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector", the specific execution steps are: inputting the dimensionality reduction feature into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector.

[0130] In an embodiment of the present application, after the computer device obtains the dimensionality reduction features based on the above steps, the dimensionality reduction features can be input into a classification network for label recognition to obtain a first candidate label corresponding to the first word segmentation vector.

[0131] The method described in the embodiments of the present application is that the self-attention sub-network can improve the accuracy of feature extraction by paying attention to the influence of each word segmentation in the context on the target word segmentation, and can better understand the semantics of the word segmentation. The cross-attention sub-network can extract global features by combining context features and word segmentation sequences, taking into account the relationship between word segmentations, and can improve the overall accuracy of label recognition. The dimensionality reduction sub-network can reduce the dimensionality of global features, remove redundant information, make the feature representation more compact, and help improve the efficiency and accuracy of the classification network.

[0132] Combining all the above embodiments, Fig.10 As shown, a text recognition method is also provided, the method comprising:

[0133] S601, input the text to be recognized into the word segmentation network for word segmentation processing to obtain a sequence of word segments to be recognized.

[0134] S602: Input the word segmentation sequence to be identified into the self-attention sub-network to extract context features and obtain context features.

[0135] S603, input the context features and the word sequence to be identified into the cross attention sub-network to extract global features to obtain global features.

[0136] S604: Input the global features into the dimension reduction sub-network to perform feature dimension reduction extraction to obtain dimension reduction features.

[0137] S605: Input the dimension reduction feature into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector.

[0138] S606: Input the first candidate label corresponding to the first word segmentation vector and the word segmentation sequence to be identified into the recognition network for label identification to obtain the second candidate label corresponding to the second word segmentation vector.

[0139] S607: Use the first candidate tag and the second candidate tag as a new first candidate tag, and return to execute step S606 based on the new first candidate tag.

[0140] S608, obtaining candidate labels corresponding to all word segmentation vectors in the word segmentation sequence to be identified.

[0141] S609: Determine multiple label links based on the candidate labels corresponding to all the word segmentation vectors, wherein each node on each label link represents the label of each word segmentation vector in the word segmentation sequence to be identified.

[0142] S610: Select a label link with the largest total probability value from multiple label links as a target label link.

[0143] S611, determine the label corresponding to each node on the target label link.

[0144] S612, convert the label corresponding to each node into the corresponding target word segmentation to obtain the recognition result.

[0145] The method described in the embodiments of the present application can accurately identify multi-level nested named entities and improve the comprehensiveness and accuracy of recognition.

[0146] The methods described in the above steps are all described in the above embodiments. Please refer to the above description for details and will not be repeated here.

[0147] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0148] Based on the same inventive concept, the embodiment of the present application also provides a text recognition device for implementing the above-mentioned text recognition method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in one or more text recognition device embodiments provided below can refer to the limitations of the text recognition method above, and will not be repeated here.

[0149] In one embodiment, Fig.11 As shown, a text recognition device is provided, comprising:

[0150] The word segmentation processing module 11 is used to input the text to be recognized into the word segmentation network for word segmentation processing to obtain a sequence of word segments to be recognized.

[0151] The label recognition module 12 is used to input the word segmentation sequence to be recognized into the recognition network for label recognition, and obtain multiple label links corresponding to the word segmentation sequence to be recognized; each node on each label link represents the label of each word segmentation vector in the word segmentation sequence to be recognized.

[0152] The text recognition module 13 is used to recognize the text to be recognized according to multiple label links to obtain a recognition result.

[0153] In one embodiment, the tag identification module 12 includes:

[0154] The first recognition unit is used to input the word segmentation sequence to be recognized into the recognition network for label recognition, and obtain a first candidate label corresponding to the first word segmentation vector.

[0155] The second recognition unit is used to input the first candidate label corresponding to the first word segmentation vector and the word segmentation sequence to be recognized into the recognition network for label recognition to obtain the second candidate label corresponding to the second word segmentation vector.

[0156] The third recognition unit is used to determine a plurality of label links according to the first candidate label, the second candidate label, the word segmentation sequence to be recognized, and the recognition network.

[0157] In one embodiment, the third identification unit includes:

[0158] The cyclic recognition subunit is used to take the first candidate label and the second candidate label as the new first candidate label, and based on the new first candidate label, return to execute the step of inputting the first candidate label corresponding to the first word segmentation vector and the word segmentation sequence to be recognized into the recognition network for label recognition, and obtain the second candidate label corresponding to the second word segmentation vector, until the candidate labels corresponding to all the word segmentation vectors in the word segmentation sequence to be recognized are determined.

[0159] The determination subunit is used to determine multiple label links according to the candidate labels corresponding to all the word segmentation vectors.

[0160] In one embodiment, the determination subunit is specifically used to select a label link with the largest total probability value from multiple label links as a target label link; and recognize the text to be recognized according to the target label link to obtain a recognition result.

[0161] In one embodiment, the determination subunit is further specifically used to determine the label corresponding to each node on the target label link; convert the label corresponding to each node into a corresponding target word segmentation to obtain a recognition result.

[0162] In one embodiment, the first identification unit includes:

[0163] The context feature extraction subunit is used to input the word segmentation sequence to be identified into the self-attention subnetwork to extract context features and obtain context features.

[0164] The global feature extraction subunit is used to input the context features and the word sequence to be identified into the cross-attention subnetwork for global feature extraction to obtain global features.

[0165] The label recognition subunit is used to input the global features into the classification network for label recognition and obtain the first candidate label corresponding to the first word segmentation vector.

[0166] In one embodiment, the first identification unit further includes:

[0167] The feature dimensionality reduction extraction subunit is used to input the global features into the dimensionality reduction subnetwork for feature dimensionality reduction extraction to obtain dimensionality reduction features.

[0168] Correspondingly, the above-mentioned label recognition subunit is specifically used to input the dimensionality reduction feature into the classification network for label recognition, and obtain the first candidate label corresponding to the first word segmentation vector.

[0169] Each module in the above-mentioned text recognition device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0170] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0171] Input the text to be recognized into the word segmentation network for word segmentation processing to obtain the word segmentation sequence to be recognized;

[0172] The word segmentation sequence to be identified is input into the recognition network for label identification, and multiple label links corresponding to the word segmentation sequence to be identified are obtained; each node on each label link represents the label of each word segmentation vector in the word segmentation sequence to be identified;

[0173] The text to be recognized is recognized according to multiple label links to obtain a recognition result.

[0174] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0175] Input the word segmentation sequence to be identified into the recognition network for label recognition, and obtain the first candidate label corresponding to the first word segmentation vector;

[0176] The first candidate label corresponding to the first word segmentation vector and the word segmentation sequence to be identified are input into the recognition network for label identification to obtain the second candidate label corresponding to the second word segmentation vector;

[0177] A plurality of label links are determined according to the first candidate label, the second candidate label, the word segmentation sequence to be identified, and the identification network.

[0178] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0179] The first candidate label and the second candidate label are used as new first candidate labels, and based on the new first candidate label, the first candidate label corresponding to the first word segmentation vector and the word segmentation sequence to be identified are input into the recognition network for label identification to obtain the second candidate label corresponding to the second word segmentation vector, until the candidate labels corresponding to all word segmentation vectors in the word segmentation sequence to be identified are determined;

[0180] According to the candidate labels corresponding to all word segmentation vectors, multiple label links are determined.

[0181] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0182] Select the label link with the largest total probability value from multiple label links as the target label link;

[0183] The text to be recognized is recognized according to the target label link to obtain the recognition result.

[0184] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0185] Determine the label corresponding to each node on the target label link;

[0186] Convert the label corresponding to each node into the corresponding target word to obtain the recognition result.

[0187] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0188] Input the word sequence to be identified into the self-attention sub-network to extract context features and obtain context features;

[0189] Input the context features and the word sequence to be identified into the cross attention sub-network to extract global features and obtain global features;

[0190] The global features are input into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector.

[0191] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0192] The global features are input into the dimension reduction sub-network for feature dimension reduction extraction to obtain the dimension reduction features;

[0193] The global features are input into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector, including:

[0194] The reduced dimensionality features are input into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector.

[0195] The above embodiment provides a computer device, whose implementation principle and technical effect are similar to those of the above method embodiment, and will not be repeated here.

[0196] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0197] Input the text to be recognized into the word segmentation network for word segmentation processing to obtain the word segmentation sequence to be recognized;

[0198] The word segmentation sequence to be identified is input into the recognition network for label identification, and multiple label links corresponding to the word segmentation sequence to be identified are obtained; each node on each label link represents the label of each word segmentation vector in the word segmentation sequence to be identified;

[0199] The text to be recognized is recognized according to multiple label links to obtain a recognition result.

[0200] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0201] Input the word segmentation sequence to be identified into the recognition network for label recognition, and obtain the first candidate label corresponding to the first word segmentation vector;

[0202] The first candidate label corresponding to the first word segmentation vector and the word segmentation sequence to be identified are input into the recognition network for label identification to obtain the second candidate label corresponding to the second word segmentation vector;

[0203] A plurality of label links are determined according to the first candidate label, the second candidate label, the word segmentation sequence to be identified, and the identification network.

[0204] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0205] The first candidate label and the second candidate label are used as new first candidate labels, and based on the new first candidate label, the first candidate label corresponding to the first word segmentation vector and the word segmentation sequence to be identified are input into the recognition network for label identification to obtain the second candidate label corresponding to the second word segmentation vector, until the candidate labels corresponding to all word segmentation vectors in the word segmentation sequence to be identified are determined;

[0206] According to the candidate labels corresponding to all word segmentation vectors, multiple label links are determined.

[0207] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0208] Select the label link with the largest total probability value from multiple label links as the target label link;

[0209] The text to be recognized is recognized according to the target label link to obtain the recognition result.

[0210] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0211] Determine the label corresponding to each node on the target label link;

[0212] Convert the label corresponding to each node into the corresponding target word to obtain the recognition result.

[0213] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0214] Input the word sequence to be identified into the self-attention sub-network to extract context features and obtain context features;

[0215] Input the context features and the word sequence to be identified into the cross attention sub-network to extract global features and obtain global features;

[0216] The global features are input into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector.

[0217] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0218] The global features are input into the dimension reduction sub-network for feature dimension reduction extraction to obtain the dimension reduction features;

[0219] The global features are input into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector, including:

[0220] The reduced dimensionality features are input into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector.

[0221] The above embodiment provides a computer-readable storage medium, whose implementation principle and technical effect are similar to those of the above method embodiment, and will not be repeated here.

[0222] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0223] Input the text to be recognized into the word segmentation network for word segmentation processing to obtain the word segmentation sequence to be recognized;

[0224] The word segmentation sequence to be identified is input into the recognition network for label identification, and multiple label links corresponding to the word segmentation sequence to be identified are obtained; each node on each label link represents the label of each word segmentation vector in the word segmentation sequence to be identified;

[0225] The text to be recognized is recognized according to multiple label links to obtain a recognition result.

[0226] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0227] Input the word segmentation sequence to be identified into the recognition network for label recognition, and obtain the first candidate label corresponding to the first word segmentation vector;

[0228] The first candidate label corresponding to the first word segmentation vector and the word segmentation sequence to be identified are input into the recognition network for label identification to obtain the second candidate label corresponding to the second word segmentation vector;

[0229] A plurality of label links are determined according to the first candidate label, the second candidate label, the word segmentation sequence to be identified, and the identification network.

[0230] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0231] The first candidate label and the second candidate label are used as new first candidate labels, and based on the new first candidate label, the first candidate label corresponding to the first word segmentation vector and the word segmentation sequence to be identified are input into the recognition network for label identification to obtain the second candidate label corresponding to the second word segmentation vector, until the candidate labels corresponding to all word segmentation vectors in the word segmentation sequence to be identified are determined;

[0232] According to the candidate labels corresponding to all word segmentation vectors, multiple label links are determined.

[0233] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0234] Select the label link with the largest total probability value from multiple label links as the target label link;

[0235] The text to be recognized is recognized according to the target label link to obtain the recognition result.

[0236] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0237] Determine the label corresponding to each node on the target label link;

[0238] Convert the label corresponding to each node into the corresponding target word to obtain the recognition result.

[0239] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0240] Input the word sequence to be identified into the self-attention sub-network to extract context features and obtain context features;

[0241] Input the context features and the word sequence to be identified into the cross attention sub-network to extract global features and obtain global features;

[0242] The global features are input into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector.

[0243] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0244] The global features are input into the dimension reduction sub-network for feature dimension reduction extraction to obtain the dimension reduction features;

[0245] The global features are input into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector, including:

[0246] The reduced dimensionality features are input into the classification network for label recognition to obtain the first candidate label corresponding to the first word segmentation vector.

[0247] The above embodiment provides a computer program product, whose implementation principle and technical effect are similar to those of the above method embodiment, and will not be repeated here.

[0248] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0249] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0250] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A text recognition method, characterized in that: The method comprises: Input the text to be recognized into the word segmentation network for word segmentation processing to obtain the word segmentation sequence to be recognized; Input the word segmentation sequence to be identified into the recognition network for label identification, and obtain multiple label links corresponding to the word segmentation sequence to be identified; each node on each label link represents the label of each word segmentation vector in the word segmentation sequence to be identified; The text to be recognized is recognized according to the multiple label links to obtain a recognition result.

2. The method according to claim 1, characterized in that The step of inputting the to-be-recognized word segmentation sequence into the recognition network for label recognition to obtain a plurality of label links corresponding to the to-be-recognized word segmentation sequence includes: Inputting the word segmentation sequence to be identified into the recognition network for label identification, and obtaining a first candidate label corresponding to the first word segmentation vector; Inputting the first candidate label corresponding to the first word segmentation vector and the word segmentation sequence to be identified into the recognition network for label identification to obtain a second candidate label corresponding to the second word segmentation vector; The multiple label links are determined according to the first candidate label, the second candidate label, the to-be-recognized word segmentation sequence, and the recognition network.

3. The method according to claim 2, characterized in that The step of determining the plurality of label links according to the first candidate label, the second candidate label, the to-be-recognized word segmentation sequence, and the recognition network includes: The first candidate label and the second candidate label are used as new first candidate labels, and based on the new first candidate label, the first candidate label corresponding to the first word segmentation vector and the word segmentation sequence to be identified are input into the recognition network for label identification to obtain the second candidate label corresponding to the second word segmentation vector, until the candidate labels corresponding to all word segmentation vectors in the word segmentation sequence to be identified are determined; The multiple label links are determined according to the candidate labels corresponding to all the word segmentation vectors.

4. The method according to any one of claims 1 to 3, characterized in that: The step of recognizing the text to be recognized according to the multiple tag links to obtain a recognition result includes: Selecting a label link with the largest total probability value from the multiple label links as a target label link; The text to be recognized is recognized according to the target label link to obtain a recognition result.

5. The method according to claim 4, characterized in that The step of recognizing the text to be recognized according to the target tag link to obtain a recognition result includes: Determine the label corresponding to each node on the target label link; The labels corresponding to the nodes are converted into corresponding target participles to obtain the recognition results.

6. The method according to claim 4, characterized in that The recognition network includes a self-attention subnetwork, a cross-attention subnetwork and a classification subnetwork. The word segmentation sequence to be recognized is input into the recognition network for label recognition to obtain a first candidate label corresponding to a first word segmentation vector, including: Inputting the to-be-recognized word segmentation sequence into the self-attention subnetwork to extract context features, thereby obtaining context features; Inputting the context feature and the to-be-recognized word segmentation sequence into the cross-attention subnetwork to extract global features, thereby obtaining global features; The global feature is input into the classification network for label recognition to obtain a first candidate label corresponding to the first word segmentation vector.

7. The method according to claim 6, characterized in that The recognition network also includes a dimension reduction subnetwork, and the method further includes: Inputting the global features into the dimension reduction subnetwork to perform feature dimension reduction extraction to obtain dimension reduction features; The step of inputting the global feature into a classification network for label recognition to obtain a first candidate label corresponding to the first word segmentation vector includes: The dimensionality reduction feature is input into the classification network for label recognition to obtain a first candidate label corresponding to the first word segmentation vector.

8. A text recognition device, characterized in that: The device comprises: The word segmentation processing module is used to input the text to be recognized into the word segmentation network for word segmentation processing to obtain a sequence of word segments to be recognized; A label recognition module is used to input the word segmentation sequence to be recognized into the recognition network for label recognition, and obtain multiple label links corresponding to the word segmentation sequence to be recognized; each node on each label link represents the label of each word segmentation vector in the word segmentation sequence to be recognized; The text recognition module is used to recognize the text to be recognized according to the multiple label links to obtain a recognition result.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.