Entity recognition method, device, equipment and storage medium
By processing the voice sequence processing of chat voice data and the multi -layer processing of physical recognition models, extract and identify the physical keywords, solve the problem of low physical recognition efficiency in the customer service business, and realize the efficient physical identification and communication process.
Patent Information
- Application Number
- CN202210834144.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-14
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-07-14
AI Technical Summary
During the customer service business process, entity identification efficiency is low and identity information needs to be repeatedly checked, resulting in low communication efficiency.
By obtaining the chat voice data set, the voice sequence processing is performed to extract the target voice dataset, and the characteristic voice recognition model is used for feature extraction, coding and decoding, and the target text is obtained. Then, use the convolutional layer, circulation layer, and transcription layer in the physical identification model to extract and predict the physical keywords of the entity, and find the corresponding physical data from the preset entity library.
It has improved the efficiency and accuracy of physical identification, reduced the communication steps between customer service staff and customers, and improved the communication efficiency in the process of customer service business.
Smart Images

Figure CN115223572B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to an entity recognition method, device, equipment and storage medium. Background Art
[0002] In the traditional customer service process, customer service personnel usually inquire about the user's identity information and identify the entity category corresponding to the identity information, and then input the identity information corresponding to the identified entity category into the business system before conducting business processing. However, during the communication process between customer service personnel and customers, it is necessary to repeatedly check the entity category corresponding to the identity information, which makes the efficiency of entity identification low. Customer service personnel also need to manually input the user's identity information, resulting in low communication efficiency during the customer service process. Summary of the invention
[0003] The present invention provides an entity recognition method, device, equipment and storage medium, the main purpose of which is to improve the efficiency of entity recognition and the communication efficiency in the process of customer service business handling.
[0004] To achieve the above object, the present invention provides an entity recognition method, comprising:
[0005] Acquire a chat voice data set, and perform voice sequence processing on the chat voice data set to obtain a target voice data set;
[0006] Using the feedforward attention mechanism layer of the trained speech recognition model to extract features from the target speech data set to obtain a speech feature vector set, using the encoding layer of the trained speech recognition model to encode the speech feature vector set to obtain a speech feature association matrix, and using the decoding layer of the trained speech recognition model to decode the speech feature association matrix to obtain a target text of the target speech data set;
[0007] Using the convolutional layer in the trained entity recognition model to extract the feature sequence of the target text to obtain a character vector set, using the recurrent layer in the entity recognition model to predict the character tag set of the character vector set, and using the transcription layer in the entity recognition model to integrate the character tag set to obtain entity keywords;
[0008] The entity data corresponding to the entity keyword is searched from a preset entity library.
[0009] Optionally, predicting the character label set of the character vector set by using the recurrent layer in the entity recognition model includes:
[0010] Calculating the state value of the character vector set using the input gate in the recurrent layer;
[0011] Calculating the activation value of the character vector set using the forget gate in the recurrent layer;
[0012] Calculate a state update value of the character vector set according to the state and activation value;
[0013] The character label set of the state update value is calculated using the output gate in the recurrent layer to obtain the character label set of the character vector set.
[0014] Optionally, the step of integrating the character tag set using the transcription layer in the entity recognition model to obtain entity keywords includes:
[0015] Using the transcription layer to obtain all path probabilities of the character tag set, and searching for the maximum path probability corresponding to each character tag from the multiple path probabilities;
[0016] Each of the maximum path probabilities is combined to obtain the entity keyword of the character tag set.
[0017] Optionally, searching for entity data corresponding to the entity keyword from a preset entity library includes:
[0018] Taking the entity keyword as a query object, creating a query statement for the query object in the entity library;
[0019] The keyword category corresponding to the entity keyword is obtained, the entity category consistent with the keyword category is searched in the entity library using the query statement, and the keyword category is entity-associated with the entity category to obtain the entity data.
[0020] Optionally, the feedforward attention mechanism layer of the trained speech recognition model is used to extract features from the target speech data set to obtain a speech feature vector set, including:
[0021] Converting the target speech data set into a two-dimensional spectrogram of time and frequency;
[0022] A feedforward attention mechanism layer is used to perform a convolution operation on the converted two-dimensional spectrogram to obtain a speech feature vector set.
[0023] Optionally, the decoding layer of the trained speech recognition model is used to decode the speech feature association matrix to obtain a target text of a target speech data set, including:
[0024] Decoding the speech feature correlation matrix using the fully connected layer in the decoding layer to obtain a decoded speech matrix;
[0025] The activation function in the decoding layer is used to output the target text of the decoded speech matrix.
[0026] Optionally, encoding the speech feature vector set using the encoding layer of the trained speech recognition model to obtain a speech feature association matrix includes:
[0027] Converting the speech feature vector set into a speech feature vector matrix;
[0028] Using a preset multi-head attention mechanism, the speech feature vector matrix is split into a center conversion matrix, a correlation conversion matrix and a weight conversion matrix;
[0029] Performing dot multiplication of the speech feature vector matrix with the center conversion matrix, the association conversion matrix and the weight conversion matrix respectively to obtain a center vector matrix, an association vector matrix and a weight vector matrix;
[0030] The center vector matrix, the association vector matrix and the weight vector matrix are combined, and the combination result is input into a preset activation function to obtain a speech feature association matrix output by the activation function.
[0031] In order to solve the above problem, the present invention further provides an entity recognition device, the device comprising:
[0032] A voice sequence processing module is used to obtain a chat voice data set, perform voice sequence processing on the chat voice data set, and obtain a target voice data set;
[0033] A speech recognition module, used to extract features of the target speech data set using the feedforward attention mechanism layer of the trained speech recognition model to obtain a speech feature vector set, encode the speech feature vector set using the encoding layer of the trained speech recognition model to obtain a speech feature association matrix, and decode the speech feature association matrix using the decoding layer of the trained speech recognition model to obtain a target text of the target speech data set;
[0034] An entity recognition module, used to extract a feature sequence of the target text using a convolutional layer in a trained entity recognition model to obtain a character vector set, predict a character tag set of the character vector set using a recurrent layer in the entity recognition model, and integrate the character tag set using a transcription layer in the entity recognition model to obtain entity keywords;
[0035] The entity data query module is used to search for entity data corresponding to the entity keyword from a preset entity library.
[0036] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0037] a memory storing at least one computer program; and
[0038] The processor executes the computer program stored in the memory to implement the entity recognition method described above.
[0039] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned entity recognition method.
[0040] In the embodiment of the present invention, firstly, by performing speech sequence processing on the chat speech data set to obtain the target speech data set, the background noise and human voice in the chat speech data set can be removed, and the speech containing only human voice can be extracted; secondly, by performing feature extraction, encoding and decoding operations on the target speech data set through the feedforward attention mechanism layer, encoding layer and decoding layer of the trained speech recognition model, the target text corresponding to the target speech data set can be accurately identified to improve the efficiency and accuracy of subsequent entity recognition; finally, by using the trained entity keyword recognition model to convolve, circulate and transcribe the target text to obtain the entity keyword, and searching the entity data corresponding to the entity keyword from the preset entity library, the customer service can avoid manual direct recognition of the entity keyword, improve the recognition efficiency of the entity keyword in the target text, and avoid the step of repeatedly checking the user's identity information during the communication between the customer service staff and the customer, thereby improving the communication efficiency in the process of customer service business handling. Therefore, the entity recognition method, device, equipment and storage medium proposed in the embodiment of the present invention can improve the efficiency of entity recognition and the communication efficiency in the process of customer service business handling. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram of a flow chart of an entity recognition method provided by an embodiment of the present invention;
[0042] Figure 2 A detailed flowchart of a step in an entity recognition method provided by an embodiment of the present invention;
[0043] Figure 3 A detailed flowchart of a step in an entity recognition method provided by an embodiment of the present invention;
[0044] Figure 4 A schematic diagram of a module of an entity identification device provided by an embodiment of the present invention;
[0045] Figure 5 A schematic diagram of the internal structure of an electronic device for implementing an entity recognition method provided by an embodiment of the present invention;
[0046] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0047] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0048] The embodiment of the present invention provides an entity recognition method. The execution subject of the entity recognition method includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the entity recognition method can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
[0049] Reference Figure 1 FIG. 1 is a flow chart of an entity recognition method provided by an embodiment of the present invention. In the embodiment of the present invention, the entity recognition method includes the following steps S1-S4:
[0050] S1. Acquire a chat voice data set, and perform voice sequence processing on the chat voice data set to obtain a target voice data set.
[0051] In the embodiment of the present invention, the chat voice data set refers to the voice conversation data between the user and the customer service, wherein the chat voice data may include sensitive information such as the user's name, ID number, zip code, etc.
[0052] In the embodiment of the present invention, since the chat voice is a non-stationary time-varying signal, it carries various information, such as background noise, human voice, etc., by performing voice sequence processing on the chat voice data set to obtain a target voice data set, the chat voice containing only human voice can be extracted.
[0053] In detail, the voice sequence processing of the chat voice data set to obtain the target voice data set includes:
[0054] The speech sequence of the chat speech data set is pre-emphasized, and the pre-emphasized speech sequence is framed using a windowing method to filter out background sounds in the conversation speech sequence to obtain a target speech data set containing only human voices, thereby reducing the interference of background sounds.
[0055] In one embodiment of the present invention, performing a pre-emphasis operation can enhance the high resolution of voice data.
[0056] Preferably, the windowing method is: Hamming windowing method.
[0057] S2. Use the feedforward attention mechanism layer of the trained speech recognition model to extract features of the target speech data set to obtain a speech feature vector set, use the encoding layer of the trained speech recognition model to encode the speech feature vector set to obtain a speech feature association matrix, and use the decoding layer of the trained speech recognition model to decode the speech feature association matrix to obtain the target text of the target speech data set.
[0058] In an embodiment of the present invention, the trained speech recognition model may be a Transformer model, and the speech recognition model includes: a feedforward attention mechanism layer, an encoding layer, and a decoding layer.
[0059] The embodiment of the present invention uses the feedforward attention mechanism layer of the trained speech recognition model to perform feature extraction on the target speech data set to obtain a speech feature vector set, which can accurately extract the main features of the target speech data set; uses the encoding layer of the trained speech recognition model to encode the speech feature vector set to obtain a speech feature association matrix, which can further strengthen the learning of the main features in the target speech data set and eliminate some useless features; uses the decoding layer of the trained speech recognition model to decode the speech feature association matrix to obtain the target text of the target speech data set, which can accurately identify the target text corresponding to the target speech data set, so as to improve the efficiency and accuracy of subsequent entity recognition.
[0060] In detail, the feedforward attention mechanism layer of the trained speech recognition model is used to extract features from the target speech data set to obtain a speech feature vector set, including:
[0061] The target speech data set is converted into a two-dimensional spectrogram of time and frequency; a convolution operation is performed on the converted two-dimensional spectrogram using a feedforward attention mechanism layer to obtain a speech feature vector set.
[0062] In an optional embodiment of the present invention, performing a convolution operation on the converted two-dimensional spectrogram refers to extracting features for time and frequency respectively, and predicting the time transformation of different frequencies when the user speaks, so as to obtain more accurate acoustic features.
[0063] Furthermore, the speech feature vector set is encoded using the encoding layer of the trained speech recognition model to obtain a speech feature association matrix, including:
[0064] The speech feature vector set is converted into a speech feature vector matrix; the speech feature vector matrix is split into a center conversion matrix, an association conversion matrix and a weight conversion matrix using a preset multi-head attention mechanism; the speech feature vector matrix is point multiplied with the center conversion matrix, the association conversion matrix and the weight conversion matrix respectively to obtain a center vector matrix, an association vector matrix and a weight vector matrix; the center vector matrix, the association vector matrix and the weight vector matrix are combined, and the combination result is input into a preset activation function to obtain a speech feature association matrix output by the activation function.
[0065] In the embodiment of the present invention, the speech feature correlation matrix is calculated by the following formula:
[0066]
[0067] Among them, Softmax refers to the preset activation function, Q refers to the central transformation matrix, K T refers to the associated transformation matrix, d k refers to the dimension of the association conversion matrix, V refers to the weight conversion matrix, and Z refers to the speech feature association matrix.
[0068] In the embodiment of the present invention, the method of decoding the speech feature association matrix using the decoding layer of the trained speech recognition model to obtain the target text of the target speech data set includes:
[0069] The speech feature association matrix is decoded by using the fully connected layer in the decoding layer to obtain a decoded speech matrix; and the target text of the decoded speech matrix is outputted by using the activation function in the decoding layer.
[0070] Among them, the decoded speech matrix can be output using the following formula to obtain the target text:
[0071]
[0072] Among them, s′ represents the target text, s represents the decoded speech matrix, and e represents an infinite non-repeating decimal.
[0073] S3. Use the convolutional layer in the trained entity recognition model to extract the feature sequence of the target text to obtain a character vector set, use the recurrent layer in the entity recognition model to predict the character tag set of the character vector set, and use the transcription layer in the entity recognition model to integrate the character tag set to obtain entity keywords.
[0074] In the embodiment of the present invention, the entity keyword refers to entity keywords such as name, age, ID number, etc., which are identified in the conversation text between the customer service and the user. For example, if the target text is "My name is Zhang San", then the entity keyword can be identified as "name Zhang San" based on the two characters of the name.
[0075] In an embodiment of the present invention, the trained entity recognition model may be a deep learning model of a CRNN structure, and the CRNN structure includes: a convolutional layer (CNN) + a recurrent layer (LSTM) + a transcription layer (CTC).
[0076] The embodiment of the present invention utilizes the convolutional layer in the trained entity recognition model to extract the feature sequence of the target text to obtain a character vector set, utilizes the recurrent layer in the entity recognition model to predict the character tag set of the character vector set, and utilizes the transcription layer in the entity recognition model to integrate the character tag set to obtain entity keywords. This can avoid customer service personnel from manually directly identifying entity keywords, improve the recognition efficiency of entity keywords in the target text, and avoid the step of repeatedly checking the user's identity information during communication between customer service personnel and customers, thereby improving the communication efficiency during customer service business processing.
[0077] Among them, the convolution layer includes a convolution sublayer and a pooling layer. The convolution sublayer can be used to extract features of the target text to obtain a feature map; and then the pooling layer is used to extract the feature sequence vector in the feature map to obtain a character vector set.
[0078] In one embodiment of the present invention, the recurrent layer is mainly composed of a variant of RNN, LTSM. Since RNN has a gradient vanishing problem and cannot obtain more context information, LSTM replaces RNN to better extract context information, wherein the recurrent layer includes an input gate, a forget gate and an output gate.
[0079] For details, refer to Figure 2 As shown, the use of the recurrent layer in the entity recognition model to predict the character tag set of the character vector set includes the following steps S31-34:
[0080] S31, using the input gate in the recurrent layer to calculate the state value of the character vector set;
[0081] S32, calculating the activation value of the character vector set using the forget gate in the recurrent layer;
[0082] S33, calculating a state update value of the character vector set according to the state and activation value;
[0083] S34. Calculate the character label set of the state update value using the output gate in the recurrent layer to obtain the character label set of the character vector set.
[0084] In an embodiment of the present invention, the input gate can control the number of character vector sets entering and exiting and the number of character vector sets passing through the gate; the forget gate is used to control the number of character vector sets flowing from the previous moment to the current moment; the state update value refers to the character vector set that passes through the forget gate as the state update value if it is not chosen to be forgotten by the forget gate; the output gate can output the character label set of the character vector set.
[0085] In the embodiment of the present invention, the transcription layer is mainly composed of CTC (Connectionist Temporal Classification), which mainly functions to convert the predicted character tag set in LSTM into marked entity keywords.
[0086] Further, the step of integrating the character tag set using the transcription layer in the entity recognition model to obtain entity keywords includes:
[0087] The transcription layer is used to obtain all path probabilities of the character tag set, and the maximum path probability corresponding to each character tag is found from the multiple path probabilities; each maximum path probability is combined to obtain the entity keyword of the character tag set.
[0088] In the embodiment of the present invention, the entity keyword can be obtained by the following formula:
[0089]
[0090] In the embodiment of the present invention, P(π|x) is the path probability of all character tags, B(π) is the path set of all character tags, π is the maximum path probability corresponding to each character tag, and y is the entity keyword corresponding to the character tag.
[0091] S4. Searching for entity data corresponding to the entity keyword from a preset entity library.
[0092] In the embodiment of the present invention, the entity data refers to text for entity keywords. For example, if the entity keyword is name, the corresponding entity data may be Zhang San; if the entity keyword is mobile phone number, the corresponding entity data may be 18600000000, etc. The preset entity library refers to a database storing entity keywords and entity data.
[0093] In the embodiment of the present invention, searching for entity data corresponding to the entity keyword from a preset entity library can directly extract user identity information from a chat voice data set, thereby improving communication efficiency during customer service business processing.
[0094] As an embodiment of the present invention, refer to Figure 3 As shown, searching the entity data corresponding to the entity keyword from the preset entity library includes the following steps S41-S42:
[0095] S41, using the entity keyword as a query object, creating a query statement for the query object in the entity library;
[0096] S42: Obtain a keyword category corresponding to the entity keyword, use the query statement to search for an entity category consistent with the keyword category in the entity library, and associate the keyword category with the entity category to obtain the entity data.
[0097] The query object is the entity keyword, and its main function is to facilitate the subsequent search of the entity category and entity data corresponding to the query object in the entity library through the query object. The query statement is a statement created based on the query object, and its main function is to search for the entity data corresponding to the query object from the entity library.
[0098] In one embodiment of the present invention, the keyword category refers to the category corresponding to the entity keyword, such as name category, insurance category, vehicle model category, etc. When the keyword category is found to be consistent with the category in the entity library, it can be associated through a preset association algorithm (such as Apriori algorithm) to extract entity data.
[0099] In addition, after searching the preset entity library for the entity data corresponding to the entity keyword, the method further includes: synchronizing the entity data to a preset business system.
[0100] In the embodiment of the present invention, the entity data is synchronized to the preset business system, and the customer service staff does not need to manually input the user's identity information, so as to improve the communication efficiency between the customer service staff and the user.
[0101] In the embodiment of the present invention, firstly, by performing speech sequence processing on the chat speech data set to obtain the target speech data set, the background noise and human voice in the chat speech data set can be removed, and the speech containing only human voice can be extracted; secondly, by performing feature extraction, encoding and decoding operations on the target speech data set through the feedforward attention mechanism layer, encoding layer and decoding layer of the trained speech recognition model, the target text corresponding to the target speech data set can be accurately identified to improve the efficiency and accuracy of subsequent entity recognition; finally, by using the trained entity keyword recognition model to convolve, circulate and transcribe the target text to obtain the entity keyword, and searching the entity data corresponding to the entity keyword from the preset entity library, the customer service can avoid manual direct recognition of the entity keyword, improve the recognition efficiency of the entity keyword in the target text, and avoid the step of repeatedly checking the identity information of the user during the communication between the customer service staff and the customer, thereby improving the communication efficiency in the process of customer service business handling. Therefore, the entity recognition method proposed in the embodiment of the present invention can improve the efficiency of entity recognition and the communication efficiency in the process of customer service business handling.
[0102] The entity recognition device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the entity recognition device can include a speech sequence processing module 101, a speech recognition module 102, an entity recognition module 103, an entity data query module 104, and a user visualization module 105. The module of the present invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, and is stored in the memory of the electronic device.
[0103] In this embodiment, the functions of each module / unit are as follows:
[0104] The speech sequence processing module 101 is used to obtain a chat speech data set, perform speech sequence processing on the chat speech data set, and obtain a target speech data set.
[0105] In the embodiment of the present invention, the chat voice data set refers to the voice conversation data between the user and the customer service, wherein the chat voice data may include sensitive information such as the user's name, ID number, zip code, etc.
[0106] In the embodiment of the present invention, since the chat voice is a non-stationary time-varying signal, it carries various information, such as background noise, human voice, etc., by performing voice sequence processing on the chat voice data set to obtain a target voice data set, the chat voice containing only human voice can be extracted.
[0107] In detail, the voice sequence processing module 101 performs voice sequence processing on the chat voice data set to obtain a target voice data set by performing the following operations, including:
[0108] The speech sequence of the chat speech data set is pre-emphasized, and the pre-emphasized speech sequence is framed using a windowing method to filter out background sounds in the conversation speech sequence to obtain a target speech data set containing only human voices, thereby reducing the interference of background sounds.
[0109] In one embodiment of the present invention, performing a pre-emphasis operation can enhance the high resolution of voice data.
[0110] Preferably, the windowing method is: Hamming windowing method.
[0111] The speech recognition module 102 is used to use the feedforward attention mechanism layer of the trained speech recognition model to extract features of the target speech data set to obtain a speech feature vector set, use the encoding layer of the trained speech recognition model to encode the speech feature vector set to obtain a speech feature association matrix, and use the decoding layer of the trained speech recognition model to decode the speech feature association matrix to obtain a target text of the target speech data set.
[0112] In an embodiment of the present invention, the trained speech recognition model may be a Transformer model, and the speech recognition model includes: a feedforward attention mechanism layer, an encoding layer, and a decoding layer.
[0113] The embodiment of the present invention uses the feedforward attention mechanism layer of the trained speech recognition model to perform feature extraction on the target speech data set to obtain a speech feature vector set, which can accurately extract the main features of the target speech data set; uses the encoding layer of the trained speech recognition model to encode the speech feature vector set to obtain a speech feature association matrix, which can further strengthen the learning of the main features in the target speech data set and eliminate some useless features; uses the decoding layer of the trained speech recognition model to decode the speech feature association matrix to obtain the target text of the target speech data set, which can accurately identify the target text corresponding to the target speech data set, so as to improve the efficiency and accuracy of subsequent entity recognition.
[0114] In detail, the speech recognition module 102 performs the following operations to extract features from the target speech data set using the feedforward attention mechanism layer of the trained speech recognition model to obtain a speech feature vector set, including:
[0115] The target speech data set is converted into a two-dimensional spectrogram of time and frequency; a convolution operation is performed on the converted two-dimensional spectrogram using a feedforward attention mechanism layer to obtain a speech feature vector set.
[0116] In an optional embodiment of the present invention, performing a convolution operation on the converted two-dimensional spectrogram refers to extracting features for time and frequency respectively, and predicting the time transformation of different frequencies when the user speaks, so as to obtain more accurate acoustic features.
[0117] Furthermore, the speech feature vector set is encoded using the encoding layer of the trained speech recognition model to obtain a speech feature association matrix, including:
[0118] The speech feature vector set is converted into a speech feature vector matrix; the speech feature vector matrix is split into a center conversion matrix, an association conversion matrix and a weight conversion matrix using a preset multi-head attention mechanism; the speech feature vector matrix is point multiplied with the center conversion matrix, the association conversion matrix and the weight conversion matrix respectively to obtain a center vector matrix, an association vector matrix and a weight vector matrix; the center vector matrix, the association vector matrix and the weight vector matrix are combined, and the combination result is input into a preset activation function to obtain a speech feature association matrix output by the activation function.
[0119] In the embodiment of the present invention, the speech feature correlation matrix is calculated by the following formula:
[0120]
[0121] Among them, Softmax refers to the preset activation function, Q refers to the central transformation matrix, K T refers to the associated transformation matrix, d k refers to the dimension of the association conversion matrix, V refers to the weight conversion matrix, and Z refers to the speech feature association matrix.
[0122] In the embodiment of the present invention, the method of decoding the speech feature association matrix using the decoding layer of the trained speech recognition model to obtain the target text of the target speech data set includes:
[0123] The speech feature association matrix is decoded by using the fully connected layer in the decoding layer to obtain a decoded speech matrix; and the target text of the decoded speech matrix is outputted by using the activation function in the decoding layer.
[0124] Among them, the decoded speech matrix can be output using the following formula to obtain the target text:
[0125]
[0126] Among them, s′ represents the target text, s represents the decoded speech matrix, and e represents an infinite non-repeating decimal.
[0127] The entity recognition module 103 is used to use the convolutional layer in the trained entity recognition model to extract the feature sequence of the target text to obtain a character vector set, use the recurrent layer in the entity recognition model to predict the character tag set of the character vector set, and use the transcription layer in the entity recognition model to integrate the character tag set to obtain entity keywords.
[0128] In the embodiment of the present invention, the entity keyword refers to entity keywords such as name, age, ID number, etc., which are identified in the conversation text between the customer service and the user. For example, if the target text is "My name is Zhang San", then the entity keyword can be identified as "name Zhang San" based on the two characters of the name.
[0129] In an embodiment of the present invention, the trained entity recognition model may be a deep learning model of a CRNN structure, and the CRNN structure includes: a convolutional layer (CNN) + a recurrent layer (LSTM) + a transcription layer (CTC).
[0130] The embodiment of the present invention utilizes the convolutional layer in the trained entity recognition model to extract the feature sequence of the target text to obtain a character vector set, utilizes the recurrent layer in the entity recognition model to predict the character tag set of the character vector set, and utilizes the transcription layer in the entity recognition model to integrate the character tag set to obtain entity keywords. This can avoid customer service personnel from manually directly identifying entity keywords, improve the recognition efficiency of entity keywords in the target text, and avoid the step of repeatedly checking the user's identity information during communication between customer service personnel and customers, thereby improving the communication efficiency during customer service business processing.
[0131] Among them, the convolution layer includes a convolution sublayer and a pooling layer. The convolution sublayer can be used to extract features of the target text to obtain a feature map; and then the pooling layer is used to extract the feature sequence vector in the feature map to obtain a character vector set.
[0132] In one embodiment of the present invention, the recurrent layer is mainly composed of a variant of RNN, LTSM. Since RNN has a gradient vanishing problem and cannot obtain more context information, LSTM replaces RNN to better extract context information, wherein the recurrent layer includes an input gate, a forget gate and an output gate.
[0133] In detail, the entity recognition module 103 predicts the character label set of the character vector set using the recurrent layer in the entity recognition model by performing the following operations, including:
[0134] Calculating the state value of the character vector set using the input gate in the recurrent layer;
[0135] Calculating the activation value of the character vector set using the forget gate in the recurrent layer;
[0136] Calculate a state update value of the character vector set according to the state and activation value;
[0137] The character label set of the state update value is calculated using the output gate in the recurrent layer to obtain the character label set of the character vector set.
[0138] In an embodiment of the present invention, the input gate can control the number of character vector sets entering and exiting and the number of character vector sets passing through the gate; the forget gate is used to control the number of character vector sets flowing from the previous moment to the current moment; the state update value refers to the character vector set that passes through the forget gate as the state update value if it is not chosen to be forgotten by the forget gate; the output gate can output the character label set of the character vector set.
[0139] In the embodiment of the present invention, the transcription layer is mainly composed of CTC (Connectionist Temporal Classification), which mainly functions to convert the predicted character tag set in LSTM into marked entity keywords.
[0140] Further, the step of integrating the character tag set using the transcription layer in the entity recognition model to obtain entity keywords includes:
[0141] The transcription layer is used to obtain all path probabilities of the character tag set, and the maximum path probability corresponding to each character tag is found from the multiple path probabilities; each maximum path probability is combined to obtain the entity keyword of the character tag set.
[0142] In the embodiment of the present invention, the entity keyword can be obtained by the following formula:
[0143]
[0144] In the embodiment of the present invention, P(π|x) is the path probability of all character tags, B(π) is the path set of all character tags, π is the maximum path probability corresponding to each character tag, and y is the entity keyword corresponding to the character tag.
[0145] The entity data query module 104 is used to search for entity data corresponding to the entity keyword from a preset entity library.
[0146] In the embodiment of the present invention, the entity data refers to text for entity keywords. For example, if the entity keyword is name, the corresponding entity data may be Zhang San; if the entity keyword is mobile phone number, the corresponding entity data may be 18600000000, etc. The preset entity library refers to a database storing entity keywords and entity data.
[0147] In the embodiment of the present invention, searching for entity data corresponding to the entity keyword from a preset entity library can directly extract user identity information from a chat voice data set, thereby improving communication efficiency during customer service business processing.
[0148] As an embodiment of the present invention, the entity data query module 104 searches for entity data corresponding to the entity keyword from a preset entity library by performing the following operations, including:
[0149] Taking the entity keyword as a query object, creating a query statement for the query object in the entity library;
[0150] The keyword category corresponding to the entity keyword is obtained, the entity category consistent with the keyword category is searched in the entity library using the query statement, and the keyword category is entity-associated with the entity category to obtain the entity data.
[0151] The query object is the entity keyword, and its main function is to facilitate the subsequent search of the entity category and entity data corresponding to the query object in the entity library through the query object. The query statement is a statement created based on the query object, and its main function is to search for the entity data corresponding to the query object from the entity library.
[0152] In one embodiment of the present invention, the keyword category refers to the category corresponding to the entity keyword, such as name category, insurance category, vehicle model category, etc. When the keyword category is found to be consistent with the category in the entity library, it can be associated through a preset association algorithm (such as Apriori algorithm) to extract entity data.
[0153] In addition, after searching the preset entity library for the entity data corresponding to the entity keyword, the method further includes: synchronizing the entity data to a preset business system.
[0154] In the embodiment of the present invention, the entity data is synchronized to the preset business system, and the customer service staff does not need to manually input the user's identity information, so as to improve the communication efficiency between the customer service staff and the user.
[0155] In the embodiment of the present invention, firstly, by performing speech sequence processing on the chat speech data set to obtain the target speech data set, the background noise and human voice in the chat speech data set can be removed, and the speech containing only human voice can be extracted; secondly, by performing feature extraction, encoding and decoding operations on the target speech data set through the feedforward attention mechanism layer, encoding layer and decoding layer of the trained speech recognition model, the target text corresponding to the target speech data set can be accurately identified to improve the efficiency and accuracy of subsequent entity recognition; finally, by using the trained entity keyword recognition model to convolve, circulate and transcribe the target text to obtain the entity keyword, and searching the entity data corresponding to the entity keyword from the preset entity library, the customer service can avoid manual direct recognition of the entity keyword, improve the recognition efficiency of the entity keyword in the target text, and avoid the step of repeatedly checking the identity information of the user during the communication between the customer service staff and the customer, thereby improving the communication efficiency in the process of customer service business handling. Therefore, the entity recognition device proposed in the embodiment of the present invention can improve the efficiency of entity recognition and the communication efficiency in the process of customer service business handling.
[0156] like Figure 5 , which is a schematic diagram of the structure of an electronic device for implementing the entity recognition method of the present invention.
[0157] The electronic device may include a processor 10 , a memory 11 , a communication bus 12 , and a communication interface 13 , and may also include a computer program stored in the memory 11 and executable on the processor 10 , such as an entity recognition program.
[0158] Wherein, the memory 11 includes at least one type of medium, and the medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, local disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 can also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 can also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of the entity recognition program, etc., but also can be used to temporarily store data that has been output or is to be output.
[0159] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules (such as entity recognition programs, etc.) stored in the memory 11, and calls data stored in the memory 11 to execute various functions of the electronic device and process data.
[0160] The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The communication bus 12 is configured to realize connection and communication between the memory 11 and at least one processor 10, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0161] Figure 5 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0162] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0163] Optionally, the communication interface 13 may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices.
[0164] Optionally, the communication interface 13 may also include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0165] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0166] The entity recognition program stored in the memory 11 in the electronic device is a combination of multiple computer programs, and when running in the processor 10, it can achieve:
[0167] Acquire a chat voice data set, and perform voice sequence processing on the chat voice data set to obtain a target voice data set;
[0168] Using the feedforward attention mechanism layer of the trained speech recognition model to extract features from the target speech data set to obtain a speech feature vector set, using the encoding layer of the trained speech recognition model to encode the speech feature vector set to obtain a speech feature association matrix, and using the decoding layer of the trained speech recognition model to decode the speech feature association matrix to obtain a target text of the target speech data set;
[0169] Using the convolutional layer in the trained entity recognition model to extract the feature sequence of the target text to obtain a character vector set, using the recurrent layer in the entity recognition model to predict the character tag set of the character vector set, and using the transcription layer in the entity recognition model to integrate the character tag set to obtain entity keywords;
[0170] The entity data corresponding to the entity keyword is searched from a preset entity library.
[0171] Specifically, the specific implementation method of the processor 10 for the above computer program can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0172] Furthermore, if the module / unit integrated in the electronic device 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 medium. The computer-readable medium can be non-volatile or volatile. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM).
[0173] The embodiment of the present invention may further provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program may implement:
[0174] Acquire a chat voice data set, and perform voice sequence processing on the chat voice data set to obtain a target voice data set;
[0175] Using the feedforward attention mechanism layer of the trained speech recognition model to extract features from the target speech data set to obtain a speech feature vector set, using the encoding layer of the trained speech recognition model to encode the speech feature vector set to obtain a speech feature association matrix, and using the decoding layer of the trained speech recognition model to decode the speech feature association matrix to obtain a target text of the target speech data set;
[0176] Using the convolutional layer in the trained entity recognition model to extract the feature sequence of the target text to obtain a character vector set, using the recurrent layer in the entity recognition model to predict the character tag set of the character vector set, and using the transcription layer in the entity recognition model to integrate the character tag set to obtain entity keywords;
[0177] The entity data corresponding to the entity keyword is searched from a preset entity library.
[0178] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.
[0179] In the several embodiments provided by the present invention, it should be understood that the disclosed media, devices, apparatuses and methods can be implemented in other ways. For example, the apparatus embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0180] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0181] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0182] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0183] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0184] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0185] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.
[0186] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. An entity recognition method, characterized in that: The method comprises: Acquire a chat voice data set, and perform voice sequence processing on the chat voice data set to obtain a target voice data set; Using the feedforward attention mechanism layer of the trained speech recognition model to extract features from the target speech data set to obtain a speech feature vector set, using the encoding layer of the trained speech recognition model to encode the speech feature vector set to obtain a speech feature association matrix, and using the decoding layer of the trained speech recognition model to decode the speech feature association matrix to obtain a target text of the target speech data set; Using the convolutional layer in the trained entity recognition model to extract the feature sequence of the target text to obtain a character vector set, using the recurrent layer in the entity recognition model to predict the character tag set of the character vector set, and using the transcription layer in the entity recognition model to integrate the character tag set to obtain entity keywords; Searching for entity data corresponding to the entity keyword from a preset entity library; The method of using the recurrent layer in the entity recognition model to predict the character tag set of the character vector set includes: using the input gate in the recurrent layer to calculate the state value of the character vector set; using the forget gate in the recurrent layer to calculate the activation value of the character vector set; calculating the state update value of the character vector set according to the state value and the activation value; using the output gate in the recurrent layer to calculate the character tag set of the state update value, and obtaining the character tag set of the character vector set; The step of integrating the character tag set using the transcription layer in the entity recognition model to obtain entity keywords includes: obtaining all path probabilities of the character tag set using the transcription layer, searching for the maximum path probability corresponding to each character tag from a plurality of the path probabilities; and merging each of the maximum path probabilities to obtain the entity keyword of the character tag set; The searching for entity data corresponding to the entity keyword from a preset entity library includes: taking the entity keyword as a query object and creating a query statement for the query object in the entity library; obtaining a keyword category corresponding to the entity keyword, using the query statement to search for an entity category in the entity library that is consistent with the keyword category, and performing entity association between the keyword category and the entity category to obtain the entity data.
2. The entity recognition method according to claim 1, characterized in that: The feedforward attention mechanism layer of the trained speech recognition model is used to extract features from the target speech data set to obtain a speech feature vector set, including: Converting the target speech data set into a two-dimensional spectrogram of time and frequency; A feedforward attention mechanism layer is used to perform a convolution operation on the converted two-dimensional spectrogram to obtain a speech feature vector set.
3. The entity recognition method according to claim 1, characterized in that: The method of decoding the speech feature association matrix using the decoding layer of the trained speech recognition model to obtain the target text of the target speech data set includes: Decoding the speech feature correlation matrix using the fully connected layer in the decoding layer to obtain a decoded speech matrix; The activation function in the decoding layer is used to output the target text of the decoded speech matrix.
4. The entity recognition method according to claim 1, characterized in that: The method of encoding the speech feature vector set using the encoding layer of the trained speech recognition model to obtain a speech feature association matrix includes: Converting the speech feature vector set into a speech feature vector matrix; Using a preset multi-head attention mechanism, the speech feature vector matrix is split into a center conversion matrix, a correlation conversion matrix and a weight conversion matrix; Performing dot multiplication of the speech feature vector matrix with the center conversion matrix, the association conversion matrix and the weight conversion matrix respectively to obtain a center vector matrix, an association vector matrix and a weight vector matrix; The center vector matrix, the association vector matrix and the weight vector matrix are combined, and the combination result is input into a preset activation function to obtain a speech feature association matrix output by the activation function.
5. An entity recognition device, used to implement the entity recognition method according to claim 1, characterized in that: The device comprises: A voice sequence processing module is used to obtain a chat voice data set, perform voice sequence processing on the chat voice data set, and obtain a target voice data set; A speech recognition module, used to extract features of the target speech data set using the feedforward attention mechanism layer of the trained speech recognition model to obtain a speech feature vector set, encode the speech feature vector set using the encoding layer of the trained speech recognition model to obtain a speech feature association matrix, and decode the speech feature association matrix using the decoding layer of the trained speech recognition model to obtain a target text of the target speech data set; An entity recognition module, used to extract a feature sequence of the target text using a convolutional layer in a trained entity recognition model to obtain a character vector set, predict a character tag set of the character vector set using a recurrent layer in the entity recognition model, and integrate the character tag set using a transcription layer in the entity recognition model to obtain entity keywords; The entity data query module is used to search for entity data corresponding to the entity keyword from a preset entity library.
6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the entity recognition method according to any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the entity recognition method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Audio separation method, device, electronic equipment and computer readable storage medium
CN110473566A
Recognition equipment of video identity and recognitionmethod ofvideo identity
CN110827832A