Unstructured statement parsing and processing method, device, equipment, and storage medium

By using text parse code and decoding, generating sentence vectors and implicit word feature vectors, predicting word confidence, the problem of low parsing accuracy of unstructured statements is solved, and efficient information standardization and structured data extraction are achieved.

CN115080701BActive Publication Date: 2025-08-01SHANGHAI GANGFU E COMMERCE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210790161.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-05
Publication Date
2025-08-01
Estimated Expiration
2042-07-05

AI Technical Summary

Technical Problem

In the prior art, the analysis accuracy of unstructured statements is low and the maintenance complexity is high, so it is impossible to effectively deal with the expression of multiple similar words and statements.

Method used

The pre-trained text analytical model is used for word segmentation processing, and the encoder generates sentence vectors and implicit word feature vectors. Combined with the decoder to predict word confidence through an attention mechanism, combine it into target statements and extract structured data.

Benefits of technology

It improves the accuracy of unstructured information parsing into structured data, reduces the limitations on information formats, and reduces the complexity of equipment maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115080701B_ABST
    Figure CN115080701B_ABST
Patent Text Reader

Abstract

The present application provides an unstructured statement parsing and processing method, apparatus, device, and storage medium. Among them, the method includes: performing word segmentation processing on the text to be parsed to obtain a plurality of word segmentation units, using the encoder of a pre-trained text parsing model to perform vector encoding processing on the plurality of word segmentation units to obtain a sentence vector, implicit word feature vectors, and hidden state information, using the decoder of the text parsing model to obtain the confidence of each word in the dictionary based on the sentence vector, implicit word feature vectors, and hidden state information, determining a plurality of predicted words according to the confidence of each word in the dictionary, determining a target sentence according to the confidence of a plurality of sentences combined by the plurality of predicted words, and extracting structured data corresponding to the text to be parsed from the target sentence. Through parsing and processing text information, unstructured information can be converted into structured text information, improving the efficiency and accuracy of extracting key text information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of language processing technologies, and in particular, to a method, apparatus, device, and storage medium for parsing and processing unstructured statements. Background Art

[0002] There are a wide variety of commodities in the steel trading industry, and the trading process is relatively complex. Most often, customers contact professional traders for price inquiries. Therefore, on the steel trading consulting platform, each trader needs to reply to a large number of price inquiry messages. How to improve the reply efficiency has become the focus of people's concern.

[0003] The existing technology is that after obtaining the customer's price inquiry information, first parse out the information in a fixed format through regular expressions, and then perform information matching on the parsed information to automatically determine the reply information, such as quotations, etc.

[0004] However, the regular expression parsing method of the existing technology requires maintaining a large number of regular expressions, and the maintenance complexity is too high. Moreover, the information format extracted by regular expressions is too fixed, so the parsing accuracy of unstructured statements is low. Summary of the Invention

[0005] The purpose of this application is to provide a method, apparatus, device, and storage medium for parsing and processing unstructured statements to solve the problem of low parsing accuracy of unstructured statements in the existing technology in view of the deficiencies in the above-mentioned existing technology.

[0006] To achieve the above purpose, the technical solutions adopted in the embodiments of this application are as follows:

[0007] In a first aspect, an embodiment of this application provides a method for parsing and processing unstructured statements, and the method includes:

[0008] Perform word segmentation processing on the text to be parsed to obtain a plurality of word segmentation units, where the text to be parsed is unstructured text;

[0009] Use the encoder of the pre-trained text parsing model to perform vector encoding processing on the plurality of word segmentation units to obtain a sentence vector, implicit word feature vectors, and hidden state information of the implicit word feature vectors, where the sentence vector is used to represent the global feature of the text to be parsed, and the implicit word feature vectors are used to represent the features of each word segmentation unit and the association relationship between each word segmentation unit;

[0010] Use the decoder of the text parsing model to obtain the confidence of each word in the dictionary based on the sentence vector, implicit word feature vectors, and the hidden state information, and determine a plurality of predicted words according to the confidence of each word in the dictionary;

[0011] Determine the target sentence according to the confidence levels of multiple sentences combined from the multiple predicted word combinations;

[0012] Extract the structured data corresponding to the text to be parsed from the target sentence.

[0013] Optionally, the decoder of the text parsing model uses the sentence vector, the implicit word feature vector, and the hidden state information to obtain the confidence levels of each word in the dictionary, and determines multiple predicted words according to the confidence levels of each word in the dictionary, including:

[0014] Input the sentence vector and the implicit word feature vector into the decoder, and the decoder uses the attention mechanism to predict the first confidence level of each word in the dictionary according to the sentence vector and the implicit word feature vector;

[0015] Select the preset number of words with the highest first confidence level as additional words, and add the additional words to the set of optional words;

[0016] The decoder uses the attention mechanism to predict the second confidence level of each word in the dictionary according to the sentence vector, the implicit word feature vector, the additional words, and the hidden state information, and selects the preset number of words with the highest second confidence level as new additional words, and add the new additional words to the set of optional words, and repeat this step until the set of optional words contains the preset end word or the number of words in the set of optional words reaches the preset number, and use the words in the set of optional words as the multiple predicted words.

[0017] Optionally, the decoder includes: a first normalization layer network, a first unidirectional long short-term memory artificial neural network, a second normalization layer network, a second unidirectional long short-term memory artificial neural network, a third normalization layer network, a third unidirectional long short-term memory artificial neural network, a multi-head attention layer network, an activation layer network, a fully connected layer network, and a multi-classification layer network connected in sequence;

[0018] The decoder uses the attention mechanism to predict the second confidence level of each word in the dictionary according to the sentence vector, the implicit word feature vector, the additional words, and the hidden state information, including:

[0019] Input the sentence vector, the implicit word feature vector, the appended words, and the hidden state information into the first normalization layer network, and successively process them by the first unidirectional long short-term memory artificial neural network, the second normalization layer network, the second unidirectional long short-term memory artificial neural network, the third normalization layer network, the third unidirectional long short-term memory artificial neural network, the multi-head attention layer network, the activation layer network, the fully connected layer network, and the multi-classification layer network to obtain the second confidence of each word in the dictionary.

[0020] Optionally, determining the target sentence according to the confidences of the multiple sentences combined from the multiple predicted words includes:

[0021] Combine the multiple predicted words to obtain the multiple sentences;

[0022] Determine the confidence of each sentence respectively;

[0023] Select the sentence with the highest confidence as the target sentence.

[0024] Optionally, the encoder includes: a fourth normalization layer network, a first bidirectional long short-term memory artificial neural network, a fifth normalization layer network, and a second bidirectional long short-term memory artificial neural network connected in sequence;

[0025] The vector encoding process of using the encoder of the pre-trained text parsing model for the multiple token units to obtain the sentence vector, the implicit word feature vector, and the hidden state information of the implicit word feature vector includes:

[0026] Encode the token units into token vectors;

[0027] Input the token vectors into the fourth normalization layer network, and successively process them by the fourth normalization layer network, the first bidirectional long short-term memory artificial neural network, the fifth normalization layer network, and the second bidirectional long short-term memory artificial neural network to obtain the sentence vector, the implicit word feature vector, and the hidden state information of the implicit word feature vector.

[0028] Optionally, before using the encoder of the pre-trained text parsing model to perform vector encoding processing on the multiple token units, it further includes:

[0029] Preprocess the initial corpus according to a preset regular expression to obtain the training text;

[0030] Perform tokenization on the training text to obtain multiple token units;

[0031] Use the encoder in the initial parsing model to perform vector encoding processing on the multiple word segmentation units to obtain a sentence vector, an implicit word feature vector, and hidden state information of the implicit word feature vector;

[0032] Use the decoder of the initial parsing model to obtain the confidence of each word in the dictionary based on the sentence vector, the implicit word feature vector, the hidden state information, and the pre-annotated implicit feature word vector, and determine multiple actual predicted words according to the confidence of each word in the dictionary;

[0033] According to the multiple actual predicted words, determine the loss information of the initial parsing model, and correct the initial parsing model according to the loss information to obtain a new initial parsing model, and repeat the step of using the encoder in the initial parsing model to perform vector encoding processing on the multiple word segmentation units to obtain a sentence vector, an implicit word feature vector, and hidden state information of the implicit word feature vector until the actual predicted words meet the preset conditions, and use the new initial parsing model as the text parsing model.

[0034] Optionally, after extracting the structured data corresponding to the text to be parsed from the target statement, it further includes:

[0035] Match the structured data with each feedback information in the feedback information set;

[0036] Use the feedback information with the highest matching degree as the feedback information of the text to be parsed.

[0037] In a second aspect, another embodiment of the present application provides an unstructured statement parsing processing device, and the device includes:

[0038] A word segmentation processing module, configured to perform word segmentation processing on the text to be parsed to obtain multiple word segmentation units, where the text to be parsed is an unstructured text;

[0039] An encoding module, configured to use the encoder of the text parsing model obtained by pre-training to perform vector encoding processing on the multiple word segmentation units to obtain a sentence vector, an implicit word feature vector, and hidden state information of the implicit word feature vector, where the sentence vector is used to represent the global feature of the text to be parsed, and the implicit word feature vector is used to represent the features of each word segmentation unit and the association relationship between each word segmentation unit;

[0040] A decoding module, configured to use the decoder of the text parsing model to obtain the confidence of each word in the dictionary based on the sentence vector, the implicit word feature vector, and the hidden state information, and determine multiple predicted words according to the confidence of each word in the dictionary;

[0041] A determination module, configured to determine a target statement according to the confidence levels of multiple statements combined from the multiple predicted words.

[0042] An extraction module, configured to extract structured data corresponding to the text to be parsed from the target statement.

[0043] Optionally, the decoding module is further configured to input the sentence vector and the implicit word feature vector into the decoder, and the decoder uses an attention mechanism to predict the first confidence levels of the words in the dictionary according to the sentence vector and the implicit word feature vector.

[0044] Select a preset number of words with the highest first confidence levels as additional words, and add the additional words to the set of optional words.

[0045] The decoder uses an attention mechanism to predict the second confidence levels of the words in the dictionary according to the sentence vector, the implicit word feature vector, the additional words, and the hidden state information, and select a preset number of words with the highest second confidence levels as new additional words, and add the new additional words to the set of optional words. Repeat this step until the set of optional words contains a preset end word or the number of words in the set of optional words reaches a preset number, and use the words in the set of optional words as the multiple predicted words.

[0046] Optionally, the decoding module is further configured to input the sentence vector, the implicit word feature vector, the additional words, and the hidden state information into the first normalization layer network, and process them in sequence by the first unidirectional long short-term memory artificial neural network, the second normalization layer network, the second unidirectional long short-term memory artificial neural network, the third normalization layer network, the third unidirectional long short-term memory artificial neural network, the multi-head attention layer network, the activation layer network, the fully connected layer network, and the multi-classification layer network to obtain the second confidence levels of the words in the dictionary.

[0047] Optionally, the determination module is further configured to combine the multiple predicted words to obtain the multiple statements; determine the confidence levels of each statement respectively; and select the statement with the highest confidence level as the target statement.

[0048] Optionally, the encoding module is further configured to encode the word segmentation unit into a word segmentation vector; input the word segmentation vector into the fourth normalization layer network, and process it in sequence by the fourth normalization layer network, the first bidirectional long short-term memory artificial neural network, the fifth normalization layer network, and the second bidirectional long short-term memory artificial neural network to obtain the sentence vector, the implicit word feature vector, and the hidden state information of the implicit word feature vector.

[0049] On the third aspect, another embodiment of the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of the above-mentioned unstructured statement parsing processing method.

[0050] In a fourth aspect, another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned unstructured statement parsing method are executed.

[0051] The beneficial effects of this application are:

[0052] In this application, the unstructured text to be parsed is first segmented and encoded to obtain sentence vectors, implicit word feature vectors, and hidden state information. The sentence vectors, implicit word feature vectors, and hidden state information are then decoded to determine multiple predicted words and their confidence levels. The reconstructed structured target sentence is then determined, and finally information is extracted from the target sentence to obtain structured data. By encoding, decoding, and extracting information from the text to be parsed, the restrictions on the format of the text to be parsed can be reduced, and the accuracy of parsing structured data from unstructured information can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0054] Figure 1 A flowchart of an unstructured statement parsing method provided by an embodiment of the present application is shown;

[0055] Figure 2 A flowchart of a method for determining predicted words provided by an embodiment of the present application is shown;

[0056] Figure 3 A schematic diagram of the architecture of a decoder in the unstructured sentence parsing method provided in an embodiment of the present application is shown;

[0057] Figure 4 A flowchart of a method for determining a target sentence provided by an embodiment of the present application is shown;

[0058] Figure 5Shows the schematic structural diagram of the encoder in the unstructured statement parsing processing method provided by the embodiments of the present application;

[0059] Figure 6 Shows the schematic flow chart of encoding a word segmentation unit provided by the embodiments of the present application;

[0060] Figure 7 Shows the flow chart of a decoder and encoder training method provided by the embodiments of the present application;

[0061] Figure 8 Shows the schematic structural diagram of an unstructured statement parsing processing device provided by the embodiments of the present application;

[0062] Figure 9 Shows the schematic structural diagram of an electronic device provided by the embodiments of the present application;

[0063] Figure 10 Shows the schematic structural diagram of a parsing service deployment provided by the embodiments of the present application. Detailed implementation manners

[0064] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. It should be understood that the accompanying drawings in the present application are only for the purposes of illustration and description, and are not used to limit the protection scope of the present application. In addition, it should be understood that the schematic drawings are not drawn to actual scale. The flowcharts used in the present application show the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowcharts may not be implemented in sequence, and steps without logical context may be reversed or implemented simultaneously. In addition, those skilled in the art may add one or more other operations to the flowcharts or remove one or more operations from the flowcharts under the guidance of the content of the present application.

[0065] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the accompanying drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application claimed, but only represents the selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative efforts belong to the scope of protection of the present application.

[0066] It should be noted that the term "including" will be used in the embodiments of the present application to indicate the existence of the subsequently stated features, but does not exclude the addition of other features.

[0067] The existing statement parsing and processing methods mainly use regular expressions to parse the information in a fixed format in the statement, and then match the parsed information to automatically determine the replied information.

[0068] However, using regular expressions for statement parsing requires the device to maintain a large number of regular expressions, increasing the cost of device maintenance. And due to the different language habits of people, there may be multiple similar words and multiple statement expressions. Since regular expressions can only extract information in a fixed format, when parsing this situation, the problem of low accuracy will occur.

[0069] Based on the above problems, the present application proposes an unstructured statement parsing and processing method, and the execution subject can be an electronic device with computing and processing capabilities. The present application can be applied to the scenario of automatic reply of an electronic device. The electronic device receives a consultation message sent by a consultant, applies the method of the present application to parse and process the consultation message to obtain the parsed consultation statement, then extracts information and matches the database according to the parsed consultation statement to obtain the corresponding reply statement, and finally sends the reply statement to the consultant. Through the unstructured statement parsing and processing method of the present application, the consultation messages with multiple similar words and multiple statement expressions can be standardized, thereby improving the parsing accuracy of unstructured consultation messages.

[0070] Next, in combination with Figure 1 , the specific process of the unstructured statement parsing and processing method of the present application will be described. As Figure 1 shown, the method includes:

[0071] S101: Perform word segmentation processing on the text to be parsed to obtain multiple word segmentation units, and the text to be parsed is unstructured text.

[0072] Optionally, the text to be parsed can be the text information to be parsed obtained by preprocessing the original corpus input by the user. Exemplarily, preprocessing the original corpus can be cleaning the original corpus according to a preset regular expression, filtering out information such as chatting, meaningless words, and symbols in the original corpus. For example, for a corpus like "

Automatic reply

/ smiley

/ smiley

[0073] Optionally, the word segmentation units can be multiple words and standardized numerical values obtained by performing minimum word segmentation processing on the text to be parsed. Exemplarily, assume the text to be parsed is: "What's the price of Volume 2.7 today", then the multiple words after minimum word segmentation processing can be: Volume, 2.70, today, what, price, where 2.7 is converted to 2.70 after standardization processing.

[0074] Performing word segmentation on the text to be parsed can make the subsequent steps more focused on meaningful words and can effectively improve the efficiency of parsing unstructured statements.

[0075] S102: Use the encoder of the pre-trained text parsing model to perform vector encoding on multiple word segmentation units to obtain a sentence vector, hidden word feature vectors, and hidden state information of the hidden word feature vectors. Among them, the sentence vector is used to represent the global features of the text to be parsed, and the hidden word feature vectors are used to represent the features of each word segmentation unit and the correlation between each word segmentation unit.

[0076] Optionally, all time steps of the multiple word segmentation units can be encoded to obtain hidden word feature vectors for all time steps.

[0077] Optionally, the sentence vector can be the intermediate semantics obtained after encoding multiple word segmentation units, and it is stored as a content vector. Exemplarily, the hidden state of the last time step can be used as the sentence vector to represent the global features of the sentence. A text to be parsed can output a sentence vector through the encoder of the text parsing model.

[0078] Optionally, the hidden word feature vectors can be a matrix of word vectors obtained by encoding each word segmentation unit. The hidden word feature vectors can represent the local features of the sentence. A matrix of word vectors can include multiple word vectors. A text to be parsed can output a matrix of word vectors through the encoder of the text parsing model.

[0079] Optionally, the hidden state information of the hidden word feature vectors can represent the hidden states of all previous time steps for each word vector in the hidden word feature vectors. Exemplarily, the hidden state of the word vector at the second time step can represent the word vectors at the first and second time steps, and the hidden state of the word vector at the fourth time step can represent all word vectors from the first to the fourth time steps.

[0080] It should be noted that, in order to improve the accuracy of the subsequent decoding steps, the encoding in this step can be based on all time steps, that is, the connection between each word segmentation unit and all previous word segmentation units can be established.

[0081] S103: Use the decoder of the text parsing model to obtain the confidence of each word in the dictionary based on the sentence vector, hidden word feature vectors, and hidden state information, and determine multiple predicted words according to the confidence of each word in the dictionary.

[0082] Optionally, the dictionary can be a word database composed of multiple word segmentation units obtained according to pre-set statements.

[0083] Optionally, the confidence level can be the probability of a word in the dictionary calculated based on sentence vectors, implicit word feature vectors, and hidden state information.

[0084] Optionally, the predicted word(s) can be one or more words with the highest similarity to the current input word vector obtained by the decoder. Exemplarily, the beam search algorithm can be used to retain the top 3 words with the highest preset confidence level as the predicted words.

[0085] S104: Determine the target sentence according to the confidence levels of multiple sentences combined from multiple predicted words.

[0086] Optionally, by combining multiple predicted words, multiple sentences can be obtained. According to the confidence levels of each predicted word in each sentence, the confidence level of this sentence can be obtained.

[0087] Optionally, the target sentence can be the sentence with the highest confidence level among multiple sentences determined according to the confidence level of the sentence. If the confidence levels of multiple sentences are the same and all are the highest, then these sentences can all be determined as the target sentence.

[0088] Optionally, the target sentence can be a structured sentence containing the key information of the text to be parsed.

[0089] S105: Extract the structured data corresponding to the text to be parsed from the target sentence.

[0090] Optionally, the structured data can be the key information preset by the electronic device in the text to be parsed. Exemplarily, in the scenario of steel price inquiry, the structured data preset by the electronic device may be the name, material, specification, etc. of the steel. Then the target sentence can be the restructured sentence of the text to be parsed, containing the name, material, and specification, and the extracted structured data can be the name, material, and specification.

[0091] In the embodiments of the present application, first, the unstructured text to be parsed is tokenized, and the tokens are encoded to obtain sentence vectors, implicit word feature vectors, and hidden state information. Decoding is performed according to the sentence vectors, implicit word feature vectors, and hidden state information to determine multiple predicted words and the confidence levels of the multiple predicted words, then determine the restructured structured target sentence, and finally perform information extraction from the target sentence to obtain the structured data. The sentence vectors, implicit word feature vectors, and hidden state information determined by encoding can generate multiple predicted words for the word vectors in the sentence during decoding, and determine the target sentence through the predicted words, realizing the language normalization of the text to be parsed. Through the encoding, decoding, and information extraction of the text to be parsed, the limitation on the information format of the text to be parsed can be reduced, a large number of regular expressions do not need to be maintained, and at the same time, the accuracy of parsing structured data from unstructured information is improved.

[0092] Next, the process of determining the predicted words in the above S103 will be described. As Figure 2 shown, the steps of the above S103 include:

[0093] S201: Input the sentence vector and the implicit word feature vector into the decoder. The decoder uses the attention mechanism to predict the first confidence level of each word in the dictionary according to the sentence vector and the implicit word feature vector.

[0094] Optionally, the first confidence level can be the probability of each word in the dictionary calculated according to the sentence vector and the implicit word feature vector, which is used to represent the similarity between the word in the dictionary and the implicit word feature vector.

[0095] Optionally, the attention mechanism can be a multi-head attention mechanism. By using the multi-head attention mechanism, weights can be calculated for the implicit word feature vector to determine which are the key words that need to be focused on.

[0096] S202: Select the preset number of words with the highest first confidence level as the additional words, and add the additional words to the set of optional words.

[0097] Optionally, the additional words can be the preset number of words with the highest first confidence level determined from the dictionary. Exemplarily, the first three words with the highest first confidence level in the dictionary can be selected as the first group of additional words.

[0098] Optionally, the set of optional words can be a set composed of multiple additional words.

[0099] S203: The decoder uses the attention mechanism to predict the second confidence level of each word in the dictionary according to the implicit word feature vector, the additional words, and the hidden state information, and select the preset number of words with the highest second confidence level as the new additional words, and add the new additional words to the set of optional words. Repeat this step until the set of optional words contains the preset end word or the number of words in the set of optional words reaches the preset number. The words in the set of optional words are used as multiple predicted words.

[0100] Optionally, the decoder can use the attention mechanism, take the first group of additional words obtained in the previous step as the input, and combine the implicit word feature vector and the hidden state information for decoding to obtain the weights of each word in the dictionary as the confidence levels corresponding to each word in the dictionary.

[0101] Optionally, the words with the highest second confidence level can be multiple words with the highest similarity to the current input word determined by the decoder in combination with the attention mechanism.

[0102] Optionally, the preset end word may be a preset end vector with an end flag. Exemplarily, the preset end word may be set to <end>, when the word is first included in the set of candidate words, it can be determined that the current decoding ends, and all the words in the current set of candidate words are used as predicted words.

[0103] Optionally, when the number of words in the set of candidate words reaches a preset number, it can also be determined that the current decoding ends. Exemplarily, when the number of words in the set of candidate words reaches 80, the 80 words in the set of candidate words can be determined as predicted words.

[0104] It should be noted that as long as either of the two conditions that the set of candidate words includes a preset end word or the number of words in the set of candidate words reaches a preset number is satisfied, it can be determined that the current decoding ends.

[0105] In the embodiments of the present application, by using the sentence vector, implicit word feature vector, and hidden state information determined by encoding and combining with the attention mechanism for confidence prediction, multiple predicted words corresponding to the word vectors of each part of the sentence can be obtained, avoiding information omission caused by only focusing on local information of the sentence.

[0106] Next, the decoder in the above steps and how to determine predicted words according to the decoder will be described. As Figure 3 shown, the decoder includes:

[0107] A first normalization layer network 301, a first unidirectional long short-term memory artificial neural network (Long Short-Term Memory, LSTM) 302, a second normalization layer network 303, a second unidirectional long short-term memory artificial neural network 304, a third normalization layer network 305, a third unidirectional long short-term memory artificial neural network 306, a multi-head attention layer network 307, an activation layer network 308, a fully connected layer network 309, and a multi-classification layer network 310 connected in sequence.

[0108] Optionally, the first normalization layer network 301 can be a neural network layer that performs vector normalization on the weights of the input sentence vector and implicit word feature vector. Exemplarily, the first normalization layer network 301 can be a Layer Normalization neural network layer.

[0109] It should be noted that since there must be a focus in a sentence, the weights of the words in the sentence can be calculated first to determine where the attention of the decoder should be concentrated. Exemplarily, the weights can be calculated by combining the input implicit word feature vector with the sentence vector, so as to determine the focus in the sentence and the decoding order of the words in the sentence. After calculating the weights, in order to unify the weight values of the words in the sentence, that is, the sum of the weight values of each part is 1, the first normalization network layer 301 can be used to unify the weight values to meet the condition that the sum of the weight values is 1, which is convenient for subsequent decoding operations.

[0110] Optionally, the first one-way long short-term memory artificial neural network 302 may be a single-head long short-term memory artificial neural network layer that predicts input words. After the first normalization network layer 301 normalizes the sentence vector and the implicit word feature vector, the first one-way long short-term memory artificial neural network 302 may combine the weights of each part of the sentence, decode the input word feature vector, obtain the additional word corresponding to the word feature vector, and add the additional word to the set of optional words.

[0111] Optionally, in the embodiments of the present application, it is necessary to decode the words corresponding to the sentence one by one. Therefore, the decoder may be set as a recurrent neural network, that is, a neural network including multiple normalization layers and long short-term memory artificial neural layers, so as to achieve the one-by-one parsing of words. Exemplarily, the first normalization layer network 301, the second normalization layer network 303, and the third normalization layer network 305 may all be LayerNormalization neural network layers, and the first one-way long short-term memory artificial neural network 302, the second one-way long short-term memory artificial neural network 304, and the third one-way long short-term memory artificial neural network 306 may be one-way long short-term memory artificial neural networks that only differ in the distribution position.

[0112] Next, the second confidence of the predicted words in the foregoing step S203 will be described in combination with the above neural network layers. The step S203 includes:

[0113] Input the sentence vector, the implicit word feature vector, the additional word, and the hidden state information into the first normalization layer network 301, and process them in turn by the first one-way long short-term memory artificial neural network 302, the second normalization layer network 303, the second one-way long short-term memory artificial neural network 304, the third normalization layer network 305, the third one-way long short-term memory artificial neural network 306, the multi-head attention layer network 307, the activation layer network 308, the fully connected layer network 309, and the multi-classification layer network 310 to obtain the second confidence of each word in the dictionary.

[0114] Optionally, the first normalization layer network 301, the second normalization layer network 303, and the third normalization layer network 305 may normalize the input sentence vector and implicit word feature vector to obtain sentence vectors and implicit word feature vectors with unified dimensions, which is convenient for the long short-term memory artificial neural network to predict and obtain multiple predicted words.

[0115] It should be noted that during decoding, each part of the sentence needs to be decoded using the sentence vector and the implicit word feature vector to generate corresponding predicted words. Therefore, after generating the first batch of predicted words, the input implicit word feature vector can be adjusted by combining with the multi-head attention layer network to change the key points of the sentence that the decoder focuses on.

[0116] Optionally, the multi-head attention layer network 307 can be first used to determine the key points that need to be focused on in the current step, and then the activation layer network 308 is used to update the input sentence vector and the implicit word feature vector, concentrating the attention on the next word to be decoded.

[0117] Optionally, after decoding the current input sentence vector and the implicit word feature vector, the prediction result can be input through the fully connected layer network 309. Optionally, the multi-classification layer network 310 can be used to determine the confidence of each word in the dictionary corresponding to the current input word.

[0118] The following is an explanation of the steps of the above S104 for determining the target sentence, as Figure 4 shown, the above S104 steps include:

[0119] S401: Combine multiple predicted words to obtain multiple sentences.

[0120] Optionally, combining multiple predicted words can be a free combination of all predicted words in the optional word set to obtain multiple sentences.

[0121] S402: Determine the confidence of each sentence respectively.

[0122] Optionally, the confidence of each sentence can be obtained by multiplying the confidence of each word in the sentence.

[0123] S403: Select the sentence with the highest confidence as the target sentence.

[0124] Optionally, there can be one or more sentences with the highest confidence, so the selected target sentence can be one or more.

[0125] Next, the decoder in the above steps will be described, as Figure 5 shown, the decoder includes:

[0126] The fourth normalization layer network 501, the first bidirectional long short-term memory artificial neural network 502, the fifth normalization layer network 503, and the second bidirectional long short-term memory artificial neural network 504 connected in sequence.

[0127] Optionally, the fourth normalization layer network 501 and the fifth normalization layer network 503 may be neural network layers that perform vector normalization on the weights of the input sentence vectors and implicit word feature vectors. Exemplarily, both the fourth normalization layer network 501 and the fifth normalization layer network 503 may be LayerNormalization neural network layers.

[0128] Optionally, the first bidirectional long short-term memory artificial neural network 502 and the second bidirectional long short-term memory artificial neural network 504 may calculate the hidden state information at each time step for the input sentence vectors and implicit word feature vectors, which is used as an input for the subsequent decoder.

[0129] Next, the steps of processing the word segmentation units based on the decoder are described as follows. Figure 6 As shown, the above step S102 includes:

[0130] S601: Encode the word segmentation units into word segmentation vectors.

[0131] Optionally, the word segmentation units may be encoded into word segmentation vectors based on time steps.

[0132] S602: Input the word segmentation vectors into the fourth normalization layer network, and successively process them through the fourth normalization layer network, the first bidirectional long short-term memory artificial neural network, the fifth normalization layer network, and the second bidirectional long short-term memory artificial neural network to obtain sentence vectors, implicit word feature vectors, and the hidden state information of the implicit word feature vectors.

[0133] Optionally, the encoded word segmentation vectors are first input into the normalization layer to unify the word segmentation vectors first, and then the vectors are encoded through the bidirectional long short-term memory artificial neural network to obtain the implicit word feature vectors corresponding to the word segmentation vectors. Each implicit word feature vector may include a hidden state information for expressing the relationship between the current implicit word feature vector and the implicit word feature vector of the previous time step.

[0134] Optionally, after encoding all the word segmentation vectors, the hidden state information of the last time step after encoding all the current word segmentation units may also be output through the recurrent neural network of the encoder as the sentence vector of all the current word segmentation units.

[0135] In the embodiments of the present application, by setting the recurrent neural networks of the encoder and the decoder, the input token units are vectorized by the encoder, and then the processed sentence vector, implicit word feature vector and hidden state information are used as the input of the decoder, so as to obtain multiple predicted words. Multiple sentences are determined according to the multiple predicted words, and the sentence with the highest confidence is determined as the target sentence, realizing the conversion of unstructured text information into structured text information and improving the accuracy of extracting key information from the subsequent text information.

[0136] The following is an explanation of the steps to obtain the decoder and the encoder. As Figure 7 shown, the training method of the text parsing model includes:

[0137] S701: Preprocess the initial corpus according to a preset regular expression to obtain the training text.

[0138] Optionally, the initial corpus can be the training corpus input by the user. Preprocessing the training corpus with a regular expression can be to clean the irrelevant symbols, modal particles, etc. in the training corpus using the regular expression.

[0139] Optionally, the training text can be the text obtained by preprocessing the training corpus. The training text can also include the target generation sentences, and the target generation sentences can be marked with identifiers.

[0140] S702: Perform tokenization processing on the training text to obtain multiple token units.

[0141] Optionally, performing tokenization processing on the training text can be to perform tokenization processing on each sentence in the training text to obtain multiple token units corresponding to each sentence.

[0142] Optionally, performing tokenization processing on the training text can also include performing tokenization processing on the marked target generation sentences in the training text to obtain multiple marked token units.

[0143] Optionally, after obtaining multiple token units, all the token units can be combined into a dictionary.

[0144] S703: Use the encoder in the initial parsing model to perform vector encoding processing on multiple token units to obtain a sentence vector, an implicit word feature vector, and the hidden state information of the implicit word feature vector.

[0145] Optionally, each time the multiple token units corresponding to a sentence can be processed. Inputting the multiple token units corresponding to the sentence into the encoder can obtain the sentence vector, the implicit word feature vector, and the hidden state information corresponding to the multiple token units of the sentence.

[0146] Optionally, the sentence vector may be the intermediate semantics obtained by encoding all the tokenized units corresponding to the sentence. The implicit word feature vector may be the word vector matrix obtained by encoding all the tokenized units. The hidden state information may be the state of the word vector corresponding to the previous time step at each current time step, used to represent the relationship between the current word vector and other word vectors in the context.

[0147] S704: Using the decoder of the initial parsing model, based on the sentence vector, the implicit word feature vector, the hidden state information, and the pre-annotated implicit feature word vector, obtain the confidence of each word in the dictionary, and determine multiple actual predicted words according to the confidence of each word in the dictionary.

[0148] Optionally, the pre-annotated implicit word feature vector may be the implicit word feature vector obtained by encoding the pre-annotated tokenized units.

[0149] Optionally, the decoder may obtain the confidence of each word in the dictionary based on the sentence vector, the implicit word feature vector, and the hidden state information. Since this step is for training the decoder, when inputting the implicit word feature vector, the pre-annotated implicit word feature vector can be added as noise to the training. Exemplarily, when inputting the implicit word feature vector, one can choose one from the implicit word feature vector and the pre-annotated implicit word feature vector to add controllable noise within a certain range to the training process, assisting the decoder to learn in a reasonable direction and improving the generalization of the decoder during training.

[0150] S705: According to multiple actual prediction results, determine the loss information of the initial parsing model, and correct the initial parsing model according to the loss information to obtain a new initial parsing model. Then repeat the step of using the encoder in the initial parsing model to perform vector encoding processing on the multiple tokenized units to obtain the sentence vector, the implicit word feature vector, and the hidden state information of the implicit word feature vector until the actual predicted words meet the preset conditions, and use the new initial parsing model as the text parsing model.

[0151] Optionally, the loss information may be the error value obtained by comparing the multiple actually obtained prediction results with the pre-annotated sentence.

[0152] Optionally, the loss information can be backpropagated in the neural network layers of the encoder and the decoder to correct the error value. Exemplarily, the cross-entropy loss function can be used to correct the error, and the cross-entropy loss function can be as shown in the following formula (1):

[0153]

[0154] Where: i represents the sample; M represents the number of categories, i.e., the dictionary size; yic represents the probability that the true category of sample i is c, taking 1 if so, otherwise taking 0; pic represents the predicted probability that the observed sample i belongs to category c.

[0155] Optionally, when the actually predicted words meet the preset conditions, it can be that an end identifier appears in the actually predicted words, or the total number of actually predicted words reaches the preset number. When the actually predicted words meet the preset conditions, it can be regarded as the end of the training of the current statement.

[0156] Optionally, the new initial parsing model can be a parsing model composed of a new encoder and decoder obtained after the training of the current statement ends and the encoder and decoder are both corrected for errors according to the loss information.

[0157] Next, the process after the above S105 step will be described. After extracting the structured data corresponding to the text to be parsed from the target statement, it can also include:

[0158] Match the structured data with each feedback information in the feedback information set.

[0159] Optionally, the feedback information set can be a set that is pre-set and includes multiple structured data and the feedback information corresponding to the multiple structured data.

[0160] Optionally, the feedback information set can be used to find the corresponding feedback information for each structured data. Exemplarily, in the steel trading inquiry scenario, assuming the structured data is [product = low alloy; material = 235; specification = 3 * 1250], the feedback information set can be an information set obtained by storing the product, material, specification, and corresponding prices of the steel in multiple warehouses in multiple databases. Taking [product = low alloy; material = 235; specification = 3 * 1250] as the input, multiple corresponding feedback information can be found in the feedback information set through a software process, such as: [price = 4550], [price = 4520], [price = 4530], and [price = 4510].

[0161] Use the feedback information with the highest matching degree as the feedback information of the text to be parsed.

[0162] Optionally, the matching degree can be the similarity between the structured data obtained by parsing and the structured data in the feedback information set. The higher the similarity, the higher the matching degree can be considered.

[0163] Optionally, since the structured data is parsed from unstructured text information, and the unstructured text information may not contain all the key elements, there may be a situation where key information is missing in the parsed text information. In this case, it can be replaced with a question mark. Exemplarily, as shown in Table 1, assuming the extracted structured data is [product=? material=? specification=2.75], since the only key information is specification=2.75, then this structured data can match multiple feedback messages. Among the multiple feedback messages, the one with the highest matching degree can be selected as the feedback message corresponding to the parsed text of this structured data.

[0164] Table 1 Text Parsing Table

[0165]

[0166]

[0167] In the embodiments of the present application, by performing data matching on the parsed structured data to obtain corresponding feedback messages, the efficiency of information extraction from text can be improved.

[0168] Optionally, the present application also provides a possible server deployment method for the text parsing model, as [[ID= shown. Exemplarily, at the forefront is a caching service that caches the parsing results corresponding to the input consultation statements. The expiration time can be, for example, 1 day. Then, Nginx is used for load balancing, connecting to two physical machines. Each machine starts two FLASK WEB processes, and each process exclusively occupies one RTX2070 GPU. Each GPU is bound to a parsing model to perform parsing services. The parsing services are distributedly deployed to the GPU hardware and connected to the caching service, which can improve the parsing efficiency.

[0169] Based on the same inventive concept, the embodiments of the present application also provide an unstructured statement parsing and processing device corresponding to the unstructured statement parsing and processing method. Since the principle of solving problems by the device in the embodiments of the present application is similar to that of the above unstructured statement parsing and processing method in the embodiments of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be elaborated.

[0170] Referring to ​ shown, which is a schematic diagram of an unstructured statement parsing and processing device provided by the embodiments of the present application. The device includes: a word segmentation processing module 801, an encoding module 802, a decoding module 803, a determination module 804, and an extraction module 805, where:

[0171] The word segmentation processing module 801 is used to perform word segmentation processing on the text to be parsed to obtain multiple word segmentation units, and the text to be parsed is unstructured text.

[0172] The encoding module 802 is configured to perform vector encoding processing on multiple tokenized units by using the encoder of a pre-trained text parsing model, so as to obtain a sentence vector, implicit word feature vectors, and hidden state information of the implicit word feature vectors. The sentence vector is used to represent the global features of the text to be parsed, and the implicit word feature vectors are used to represent the features of each tokenized unit and the correlation between each tokenized unit.

[0173] The decoding module 803 is configured to, based on the sentence vector, implicit word feature vectors, and hidden state information, use the decoder of the text parsing model to obtain the confidence of each word in the dictionary, and determine multiple predicted words according to the confidence of each word in the dictionary.

[0174] The determination module 804 is configured to determine a target sentence according to the confidence of multiple sentences combined by multiple predicted words.

[0175] The extraction module 805 is configured to extract the structured data corresponding to the text to be parsed from the target sentence.

[0176] Optionally, the decoding module is further configured to input the sentence vector and the implicit word feature vectors into the decoder. The decoder uses the attention mechanism to predict the first confidence of each word in the dictionary according to the sentence vector and the implicit word feature vectors; select a preset number of words with the highest first confidence as additional words, and add the additional words to the set of optional words; the decoder uses the attention mechanism to predict the second confidence of each word in the dictionary according to the sentence vector, the implicit word feature vectors, the additional words, and the hidden state information, and select a preset number of words with the highest second confidence as new additional words, and add the new additional words to the set of optional words. Repeat this step until the set of optional words contains a preset end word or the number of words in the set of optional words reaches a preset number, and use the words in the set of optional words as multiple predicted words.

[0177] Optionally, the decoding module is further configured to input the sentence vector, implicit word feature vectors, additional words, and hidden state information into the first normalization layer network, and successively process them by a first unidirectional long short-term memory artificial neural network, a second normalization layer network, a second unidirectional long short-term memory artificial neural network, a third normalization layer network, a third unidirectional long short-term memory artificial neural network, a multi-head attention layer network, an activation layer network, a fully connected layer network, and a multi-classification layer network to obtain the second confidence of each word in the dictionary.

[0178] Optionally, the determination module is further configured to combine multiple predicted words to obtain multiple sentences; respectively determine the confidence of each sentence; and select the sentence with the highest confidence as the target sentence.

[0179] Optionally, the encoding module is further configured to encode the word segmentation units into word segmentation vectors; input the word segmentation vectors into a fourth normalization layer network, and successively process them through the fourth normalization layer network, a first bidirectional long short-term memory artificial neural network, a fifth normalization layer network, and a second bidirectional long short-term memory artificial neural network to obtain sentence vectors, implicit word feature vectors, and hidden state information of the implicit word feature vectors.

[0180] For the processing flow of each module in the device and the interaction flow between modules, reference can be made to the relevant descriptions in the above method embodiments, which will not be elaborated here.

[0181] In the embodiment of the present application, by setting the recurrent neural networks of the encoder and the decoder, the input word segmentation units are vectorized by the encoder, and then the processed sentence vectors, implicit word feature vectors, and hidden state information are used as the input of the decoder, so as to obtain multiple predicted words, determine multiple sentences according to the multiple predicted words, and determine the sentence with the highest confidence as the target sentence, realizing the conversion of unstructured text information into structured text information and improving the accuracy of extracting key information from subsequent text information.

[0182] The embodiment of the present application also provides an electronic device, as ​ shown, which is a schematic structural diagram of a computer device provided by the embodiment of the present application, including: a processor 91, a memory 92, and a bus. The memory 92 stores machine-readable instructions executable by the processor 91 (such as, ​ the execution instructions corresponding to the word segmentation processing module, encoding module, decoding module, determination module, and extraction module in the device), when the electronic device runs, the processor 91 communicates with the memory 92 through the bus, and when the machine-readable instructions are executed by the processor 91, the steps of the above unstructured statement parsing processing method are executed.

[0183] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the steps of the above unstructured statement parsing processing method are executed.

[0184] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the method embodiments, and will not be elaborated herein. In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some communication interfaces, and the indirect couplings or communication connections of the devices or modules can be in electrical, mechanical, or other forms.

[0185] In addition, each functional unit in the various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0186] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all should be covered by the protection scope of the present application.< / end>

Claims

1. A method for parsing and processing unstructured statements, characterized in that, Including: Performing word segmentation on the text to be parsed to obtain a plurality of word segmentation units, where the text to be parsed is unstructured text; Using the encoder of a pre-trained text parsing model to perform vector encoding processing on the plurality of word segmentation units to obtain a sentence vector, a hidden word feature vector, and hidden state information of the hidden word feature vector, where the sentence vector is used to represent the global feature of the text to be parsed, and the hidden word feature vector is used to represent the features of each word segmentation unit and the correlation between each word segmentation unit; Using the decoder of the text parsing model to obtain the confidence of each word in the dictionary based on the sentence vector, the hidden word feature vector, and the hidden state information, and determining a plurality of predicted words according to the confidence of each word in the dictionary; Determining a target sentence according to the confidence of a plurality of sentences combined by the plurality of predicted words; Extracting the structured data corresponding to the text to be parsed from the target sentence; The encoder includes: a fourth normalization layer network, a first bidirectional long short-term memory artificial neural network, a fifth normalization layer network, and a second bidirectional long short-term memory artificial neural network connected in sequence; The step of using the encoder of a pre-trained text parsing model to perform vector encoding processing on the plurality of word segmentation units to obtain a sentence vector, a hidden word feature vector, and hidden state information of the hidden word feature vector includes: Encoding the word segmentation unit into a word segmentation vector; Inputting the word segmentation vector into the fourth normalization layer network, and sequentially processing it by the fourth normalization layer network, the first bidirectional long short-term memory artificial neural network, the fifth normalization layer network, and the second bidirectional long short-term memory artificial neural network to obtain the sentence vector, the hidden word feature vector, and the hidden state information of the hidden word feature vector.

2. The method according to claim 1, wherein The step of using the decoder of the text parsing model to obtain the confidence of each word in the dictionary based on the sentence vector, the hidden word feature vector, and the hidden state information, and determining a plurality of predicted words according to the confidence of each word in the dictionary includes: Inputting the sentence vector and the hidden word feature vector into the decoder, and the decoder uses an attention mechanism to predict the first confidence of each word in the dictionary according to the sentence vector and the hidden word feature vector; Selecting a preset number of words with the highest first confidence as additional words, and adding the additional words to the set of optional words; The decoder uses an attention mechanism to predict the second confidence of each word in the dictionary according to the sentence vector, the hidden word feature vector, the additional words, and the hidden state information, and selects a preset number of words with the highest second confidence as new additional words, and adds the new additional words to the set of optional words. Repeat this step until the set of optional words contains a preset end word or the number of words in the set of optional words reaches a preset number, and use the words in the set of optional words as the plurality of predicted words.

3. The method according to claim 2, wherein The decoder includes: a first normalization layer network, a first unidirectional long short-term memory artificial neural network, a second normalization layer network, a second unidirectional long short-term memory artificial neural network, a third normalization layer network, a third unidirectional long short-term memory artificial neural network, a multi-head attention layer network, an activation layer network, a fully connected layer network, and a multi-classification layer network, which are connected in sequence; The decoder uses the attention mechanism to predict the second confidence of each word in the dictionary according to the sentence vector, the implicit word feature vector, the appended word, and the hidden state information, including: Input the sentence vector, the implicit word feature vector, the appended word, and the hidden state information into the first normalization layer network, and process them in sequence by the first unidirectional long short-term memory artificial neural network, the second normalization layer network, the second unidirectional long short-term memory artificial neural network, the third normalization layer network, the third unidirectional long short-term memory artificial neural network, the multi-head attention layer network, the activation layer network, the fully connected layer network, and the multi-classification layer network to obtain the second confidence of each word in the dictionary.

4. The method according to claim 1, characterized in that, Determining the target sentence according to the confidence of the multiple sentences combined by the multiple predicted words includes: Combining the multiple predicted words to obtain the multiple sentences; Determining the confidence of each sentence respectively; Selecting the sentence with the highest confidence as the target sentence.

5. The method according to any one of claims 1 to 4, characterized in that Before using the encoder of the pre-trained text parsing model to perform vector encoding processing on the multiple token units, it further includes: Preprocessing the initial corpus according to a preset regular expression to obtain a training text; Performing tokenization processing on the training text to obtain multiple token units; Using the encoder in the initial parsing model to perform vector encoding processing on the multiple token units to obtain a sentence vector, an implicit word feature vector, and the hidden state information of the implicit word feature vector; Using the decoder of the initial parsing model to obtain the confidence of each word in the dictionary based on the sentence vector, the implicit word feature vector, the hidden state information, and the pre-annotated implicit feature word vector, and determining multiple actual predicted words according to the confidence of each word in the dictionary; Determining the loss information of the initial parsing model according to the multiple actual predicted words, and correcting the initial parsing model according to the loss information to obtain a new initial parsing model, and repeating the step of using the encoder in the initial parsing model to perform vector encoding processing on the multiple token units to obtain a sentence vector, an implicit word feature vector, and the hidden state information of the implicit word feature vector until the actual predicted words meet the preset conditions, and using the new initial parsing model as the text parsing model.

6. The method according to any one of claims 1 to 4, characterized in that, After extracting the structured data corresponding to the text to be parsed from the target sentence, it further includes: Matching the structured data with each feedback information in the feedback information set; Taking the feedback information with the highest matching degree as the feedback information of the text to be parsed.

7. An unstructured statement parsing and processing device, characterized in that Including: A word segmentation processing module for performing word segmentation processing on the text to be parsed to obtain a plurality of word segmentation units, where the text to be parsed is unstructured text; An encoding module for performing vector encoding processing on the plurality of word segmentation units using an encoder of a pre-trained text parsing model to obtain a sentence vector, an implicit word feature vector, and hidden state information of the implicit word feature vector, where the sentence vector is used to represent the global feature of the text to be parsed, and the implicit word feature vector is used to represent the features of each word segmentation unit and the correlation between each word segmentation unit; A decoding module for using a decoder of the text parsing model to obtain the confidence of each word in the dictionary based on the sentence vector, the implicit word feature vector, and the hidden state information, and determining a plurality of predicted words according to the confidence of each word in the dictionary; A determination module for determining a target sentence according to the confidence of a plurality of sentences combined by the plurality of predicted words; An extraction module for extracting structured data corresponding to the text to be parsed from the target sentence; The encoder includes: a fourth normalization layer network, a first bidirectional long short-term memory artificial neural network, a fifth normalization layer network, and a second bidirectional long short-term memory artificial neural network connected in sequence; The encoding module is used for: Encoding the word segmentation unit into a word segmentation vector; Inputting the word segmentation vector into the fourth normalization layer network, and successively processing it by the fourth normalization layer network, the first bidirectional long short-term memory artificial neural network, the fifth normalization layer network, and the second bidirectional long short-term memory artificial neural network to obtain the sentence vector, the implicit word feature vector, and the hidden state information of the implicit word feature vector.

8. An electronic device, characterized in that, Including: A processor, a storage medium, and a bus. The storage medium stores program instructions executable by the processor. When the electronic device runs, the processor communicates with the storage medium through the bus. The processor executes the program instructions to perform the steps of the unstructured statement parsing processing method according to any one of claims 1 to 6 when executed.

9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is run by the processor, it performs the steps of the unstructured statement parsing processing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Sensitive information detection method and device for unstructured text

    CN112052675A

  • Text processing method, device and equipment and computer readable storage medium

    CN112487136A