Emotion determination method, device, computer equipment and storage medium for multi-round question and answer

By processing the question-and-answer text in segments and using the attention mechanism and bidirectional LSTM model to update the word correlation in the matrix, the problems of high hardware overhead and low accuracy in existing technologies are solved, and efficient emotion recognition is achieved.

CN111694935BActive Publication Date: 2025-10-03PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010340290.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-26
Publication Date
2025-10-03
Estimated Expiration
2040-04-26

AI Technical Summary

Technical Problem

Existing technologies for interview emotion recognition require processing large amounts of entire paragraphs of language content, resulting in high hardware overhead and an inability to effectively consider the semantic connections between paragraph contexts, resulting in insufficient accuracy in emotion judgment.

Method used

The question-and-answer text is divided into question text segments and answer text segments, which are encoded into matrices using the trained model. The word correlation in the matrix is ​​updated using the attention mechanism and bidirectional LSTM model, and the sentiment probability is determined through linear transformation, taking into account the correlation between questions and answers.

Benefits of technology

It reduces the amount of calculation, improves the efficiency and accuracy of emotion recognition, and can judge the emotions of interviewees faster and more accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111694935B_ABST
    Figure CN111694935B_ABST
Patent Text Reader

Abstract

The embodiments of the present application belong to the field of semantic recognition in artificial intelligence, and relate to a method for determining emotions in multiple rounds of question and answer, comprising dividing a question and answer text into several groups of question text segments and several answer text segments; inputting all the question text segments and answer text segments into a trained model, encoding each group of the question text segments and answer text segments into a matrix, wherein the words in the question text segments and the answer text segments are represented by rows or columns in the array; combining all the question text segments with each answer text segment to form a question and answer pair; updating all the data represented in the matrix based on the correlation between the words in the question text segment and the words in the answer text segment pair in the question and answer pair; splicing all the updated matrices and performing a linear transformation to determine the probability of matching any emotion type; taking the emotion with the highest probability as the respondent emotion, and storing the respondent emotion in a blockchain network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of semantic recognition technology, and in particular to a method, device, computer equipment, and storage medium for determining emotions in multiple rounds of question and answer. Background Art

[0002] In business, many decisions require communication and negotiation. This extensive negotiation process, necessary to achieve communication between both parties, can lead to physical and mental fatigue and low work efficiency. One use case is during corporate recruitment interviews, where interviewers must continuously communicate with multiple candidates over a period of time. This immense workload can lead to low recruitment efficiency. This has spurred the development of intelligent interviewing technology. Leveraging AI's advances in semantic recognition, this technology collects communication information between interviewers and AI interviewers, performs semantic analysis, and determines the interviewer's emotions, assisting the interviewer in determining whether the candidate is qualified for the job.

[0003] Existing solutions for judging user emotions during question-and-answer sessions involve inputting entire paragraphs of language content into a model for emotion recognition. This requires processing a very large set of data simultaneously to obtain semantic meaning, resulting in a large amount of computation, high hardware overhead, and low efficiency. Furthermore, the system fails to take into account the semantic connections between paragraph contexts, and the accuracy of emotion judgment needs to be further improved. Summary of the Invention

[0004] The purpose of the embodiments of the present application is to propose a method that can accurately and quickly judge the emotions of the interviewer by combining the context of the question and answer text.

[0005] To solve the above technical problems, the present application provides a method for determining emotions in a multi-round question-and-answer process, which adopts the following technical solutions:

[0006] A method for determining emotions in a multi-round question-and-answer process comprises the following steps: receiving a question-and-answer text, dividing the question-and-answer text into at least two question text segments and at least two answer text segments; inputting all the question text segments and answer text segments into a trained model, encoding each group of the question text segments and answer text segments into a matrix, wherein the words in the question text segments and the answer text segments are represented by rows or columns in the array; combining all the encoded question text segments with each answer text segment in pairs to form a question-and-answer pair; updating the words representing the question text matrix or the answer text matrix based on the correlation between the words in the question text segment and the words in the answer text segment pair in the question-and-answer pair; splicing all the updated question text matrices and answer text matrices into a spliced ​​matrix, and converting the rows or columns of the spliced ​​matrix into a number corresponding to a preset emotion category through a linear transformation, so as to determine the probability of conforming to a preset emotion category through each row or column of the spliced ​​matrix; taking the emotion category with the greatest probability as the respondent emotion and outputting the respondent emotion.

[0007] Furthermore, the step of updating the words in the question text matrix or the answer text matrix based on the correlation between the words in the question text segment and the words in the answer text segment pair in the question-answer pair specifically includes: performing dot products on the words in the question text segment of a question-answer pair with each word in the corresponding answer text segment through an attention mechanism to obtain a set of relationship values ​​between each word in the question text segment and each word in the corresponding answer text segment; or performing dot products on the words in an answer text segment with each word in the corresponding question text segment to obtain a set of relationship values ​​between each word in the answer text segment and each word in the corresponding answer text segment. A set of relationship values ​​for each word in the corresponding question text segment; mapping the relationship values ​​according to the ratio of the relationship values ​​corresponding to each word; taking a weighted sum of all words in the answer text segment according to the mapped set of relationship values ​​to update the words in the question text segment corresponding to the set of relationship values; or taking a weighted sum of all words in the question text segment according to the mapped set of relationship values ​​to update the words in the answer text segment corresponding to the set of relationship values; looping through all words in all question-answer pairs to update the words in all relative question text segments or answer text segments.

[0008] Furthermore, mapping the relationship values ​​according to the ratio of the relationship values ​​corresponding to each word specifically includes: processing the set of relationship values ​​through softmax mapping so that the set of relationship values ​​are between 0 and 1 and the sum is 1.

[0009] Furthermore, after the step of inputting all the question text segments and answer text segments into the trained model, encoding each group of the question text segments and answer text segments into matrices respectively, wherein the words in the question text segments and answer text segments are represented by rows or columns in the array, and before combining all the question text segments with each answer text segment to form a question-answer pair, the method also includes: in the trained model, obtaining the preceding hidden layer and the succeeding hidden layer of each word through a bidirectional LSTM model, and replacing the corresponding words in the question text segment and the answer text segment through the spliced ​​preceding hidden layer and the succeeding hidden layer.

[0010] Furthermore, all the updated matrices are spliced ​​together and linearly transformed to determine the probability of meeting the preset emotion category, specifically including: splicing the matrices corresponding to all updated question-answer pairs to obtain a spliced ​​matrix, wherein the vectors corresponding to the words are arranged in sequence in the spliced ​​matrix; multiplying the spliced ​​matrix by a preset first matrix to obtain an emotion matrix with a number of rows or columns corresponding to the emotion category; adding a preset second matrix to the emotion matrix to offset and update the emotion matrix, wherein the number of rows and columns of the second matrix is ​​adapted to the first matrix; according to the correspondence between each row of the emotion matrix and the emotion category, summing up all the elements in the row to determine the probability of the corresponding emotion; or according to the correspondence between each column of the emotion matrix and the emotion category, summing up all the elements in the column to determine the probability of the corresponding emotion.

[0011] Furthermore, the training method of the model specifically includes: inputting several question text segments, answer text segments and corresponding emotion classifications into the initial model; determining the preceding hidden layer and the following hidden layer of each word in the question text segment and the answer text segment through the bidirectional LSTM model layer, and splicing the preceding hidden layer and the following hidden layer to replace the word; combining all the question text segments that have completed the word replacement with any of the answer text segments into question-answer pairs; updating the vectors representing all representative words of the question text matrix or the answer text matrix according to the correlation between the words in the question text segment and the words in the answer text segment pair in the question-answer pair through the attention mechanism layer; splicing all the updated matrices and performing linear transformation to determine the probability of meeting the preset emotion category; taking the emotion classification as the true value, calculating the cross-entropy loss of the probability of the emotion category; iteratively updating the initial model according to the cross-entropy loss until the cross-entropy loss converges, and using the updated initial model as the trained model.

[0012] Furthermore, the step of encoding each group of question text segments and answer text segments into matrices specifically includes: processing each word in each group of question text segments and answer text segments into a low-dimensional vector through embedding; and combining the vectors of the words in a question text segment or an answer text segment into a matrix representing the question text segment or the answer text segment.

[0013] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0014] A multi-round question-answering emotion determination device, comprising:

[0015] a segmentation module, configured to receive a question-answer text and segment the question-answer text into at least two question text segments and at least two answer text segments;

[0016] an encoding module, configured to input all the question text segments and answer text segments into a trained model, and encode each group of the question text segments and answer text segments into a matrix, wherein words in the question text segments and answer text segments are represented by rows or columns in the matrix;

[0017] The combination module is used to combine all the encoded question text segments with each answer text segment to form question-answer pairs;

[0018] An updating module, configured to update the words in the question text matrix or the answer text matrix according to the correlation between the words in the question text segment and the words in the answer text segment pair in the question-answer pair;

[0019] a probability module, configured to concatenate all the updated question text matrices and answer text matrices into a concatenated matrix, and convert the rows or columns of the concatenated matrix into a number corresponding to the preset number of emotion types through a linear transformation, so as to determine the probability of conforming to a preset emotion type through each row or column of the concatenated matrix; and

[0020] The selection module is used to select the emotion type with the highest probability as the respondent's emotion and output the respondent's emotion.

[0021] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the emotion determination method for multiple rounds of question and answer are implemented.

[0022] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0023] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for determining emotions in a multi-round question-and-answer session.

[0024] Compared with the prior art, the embodiment of the present application has the following beneficial effects: by segmenting the text according to questions and answers, and distinguishing between question text segments and answer text segments, according to the correlation between the words in the question text segment and the answer text segment, as well as the correlation between the words in the question and answer text segment and the question text segment, the content of all question text segments and answer text segments is updated multiple times according to the original data. The updated data is spliced ​​and linearly transformed to determine the possibility of the user being in the corresponding emotion in multiple dimensions, and the user's current emotion is determined based on the dimension with the greatest possibility. This solution extracts questions and answers according to paragraphs, and updates the data based on the correlation between questions and all answers, and answers and all questions, and makes emotion judgments. In this way, all text data and the correlation between questions and answers are taken into account. Compared with direct learning of the entire paragraph, the amount of calculation is smaller, and the accuracy of emotion confirmation is higher. This solution can improve the efficiency of emotion recognition of interviewers. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0026] Figure 1 A flowchart of an embodiment of a method for determining emotions in a multi-round question-and-answer process according to the present application;

[0027] Figure 2 yes Figure 1 A flowchart of a specific implementation of step S500;

[0028] Figure 3 yes Figure 1 A flowchart of a specific implementation of step S600;

[0029] Figure 4 This is a flowchart of a specific implementation method of model training in a multi-round question-answering emotion determination method;

[0030] Figure 5 This is a schematic structural diagram of an embodiment of a multi-round question-and-answer emotion determination device according to the present application;

[0031] Figure 6 yes Figure 5The schematic diagram of the structure of a specific embodiment of the module 500 is shown;

[0032] Figure 7 This is a schematic structural diagram of an embodiment of a multi-round question-and-answer emotion determination device according to the present application;

[0033] Figure 8 yes Figure 7 The schematic diagram of the structure of a specific embodiment of the module 800 is shown;

[0034] Figure 9 It is a structural diagram of an embodiment of a computer device according to the present application.

[0035] Reference numerals:

[0036] 100 - segmentation module, 200 - encoding module, 300 - word adjustment module, 400 - combination module, 500 - update module, 501 - relationship value sub-module, 502 - mapping sub-module, 503 - update sub-module, 600 - probability module, 700 - selection module, 800 - model training module, 801 - information input sub-module, 802 - context processing sub-module, 803 - combined text sub-module, 804 - update and replacement sub-module, 805 - probability analysis sub-module, 806 - parameter acquisition sub-module. DETAILED DESCRIPTION

[0037] Unless otherwise defined, all technical and scientific terms used herein have the same meanings as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of the application are for the purpose of describing specific embodiments only and are not intended to limit this application. The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0038] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

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

[0040] refer to Figure 1 , shows a flow chart of an embodiment of a method for determining emotions in a multi-round question-answering process according to the present application. The method for determining emotions in a multi-round question-answering process comprises the following steps:

[0041] Step S100: receiving a question-and-answer text, and dividing the question-and-answer text into at least two question text segments and at least two answer text segments.

[0042] In existing solutions, the question-and-answer text is input as a whole and then used by the model to learn and judge the data. This results in a large amount of data processing. On this basis, the question and answer are two types of data output from the interview system and the user, respectively, and they interact with each other. The entire question-and-answer text is segmented into several question text segments and several answer text segments based on the questions the system outputs to the user and the user's responses to the questions. One question text segment corresponds to a set of questions issued by the system, and one answer text segment corresponds to a single answer returned by the user. This allows the question content to be separated from the answer content, and the questions or answers can be split based on their content, facilitating the subsequent processing of the correlation between different questions and different answers.

[0043] Step S200: Input all the question text segments and answer text segments into the trained model, and encode each group of the question text segments and answer text segments into a matrix, wherein the words in the question text segments and answer text segments are represented by rows or columns in the array.

[0044] Specifically, computers are usually unable to directly process natural language and information. In order to process natural language, basic units such as words in natural language can be represented by digitally encoding natural language. During the encoding process, words can be represented by a set of numerical values. In the embodiment provided in this application, words are represented by a set of vectors, which is conducive to the subsequent correlation determination between words. In this embodiment, each word in each group of question text segments and answer text segments is processed into a low-dimensional vector through embedding; the vectors of words in a question text segment or an answer text segment are combined into a matrix representing the question text segment or the answer text segment.

[0045] This method determines the probability that the user belongs to any emotion category by judging the correlation between the question text segment and the answer text segment. Prior to this, the data needs to be standardized and formed into a certain format and encoding before subsequent operations can be performed. Therefore, the question text segment and the answer text segment need to be encoded. One embodiment is to encode the question text segment and the answer text segment through embedding encoding. Through embedding, each word is processed into a low-dimensional vector. Each word in the question text segment and the answer text segment is represented by a vector of the same dimension. The vectors of the words in a question text segment or an answer text segment are combined into a matrix representing the question text segment or the answer text segment.

[0046] Step S400: All the encoded question text segments are combined with each answer text segment to form question-answer pairs.

[0047] The correlation between the question text segment and the answer text segment is reflected in the comprehensive correlation between a question text segment and any other answer text segment. In the process of asking questions for multiple rounds of question and answer texts, it is necessary to pair the question text segment and each answer into question-answer pairs, and in the subsequent process, the correlation of the question text segment and the answer text segment in each question-answer pair must be judged separately.

[0048] Step S500: updating the words representing the question text matrix or the answer text matrix according to the correlation between the words in the question text segment and the words in the answer text segment pair in the question-answer pair.

[0049] In each question-answer pair, the columns corresponding to the words in the matrix are adjusted in a weighted manner according to the correlation between the words in the question text segment and each word in the answer text segment, as well as the correlation between the words in the answer text segment and each word in the question text segment in each question-answer pair, so as to update the vectors of all representative words in the matrix representing the question text segment and the answer text segment.

[0050] Specifically, a set of correlation values ​​is generated based on the relationship between a word in the question text and each word in the corresponding answer text. These correlation values ​​are then added together to obtain the relationship value between the word and the corresponding answer text. The relationship value of each word and the corresponding answer text is used as a weight and multiplied by the vector corresponding to the word to adjust the vectors of all representative words in the question text. Similarly, the correlation value of each word in the answer text and the corresponding question text is used as a weight to adjust the vectors of all representative words in the answer text.

[0051] Step S600: All the updated question text matrices and answer text matrices are spliced ​​into a spliced ​​matrix, and the rows or columns of the spliced ​​matrix are converted into a number corresponding to the preset emotion types through linear transformation, so as to determine the probability of conforming to a preset emotion type through each row or each column of the spliced ​​matrix.

[0052] By updating the matrices corresponding to the question text and answer text for all question-answer pairs, we can obtain several question text segment matrices reflecting the relationship with the answer text segment, as well as several answer text segment matrices reflecting the relationship with the question text segment. Each group of question text segments in the original text has several matrices corresponding to several answer texts, and each group of answer text segments also has several matrices corresponding to several question texts. These matrices are spliced ​​together to form a complete set of data for analyzing user emotions. This complete set of data can fully reflect the relationship between each question text segment and each answer text segment, and can focus attention on key words. This set of matrices is linearly transformed based on the parameters obtained from training, so that the dimensions of the transformed matrices correspond to the number of preset emotion categories. Based on the corresponding row or column in the matrix of each preset emotion category, the probability that the received question and answer text belongs to that preset emotion category is determined.

[0053] Step S700: taking the emotion type with the highest probability as the respondent's emotion and outputting the respondent's emotion.

[0054] According to the probability of the matrix reflecting the preset emotion categories after the linear transformation, the emotion category with the highest probability is determined as the user's emotion classification.

[0055] In one embodiment, after taking the emotion type with the highest probability as the respondent's emotion, the question and answer text and the respondent's emotion are stored correspondingly in the blockchain network node. Through blockchain storage, data information can be shared between different platforms, and data tampering can also be prevented.

[0056] Blockchain is a new application model for computer technologies, including distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a series of data blocks linked using cryptographic methods. Each block contains information about a batch of online transactions, used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product and service layer, and the application service layer.

[0057] The method steps from step S200 to step S700 are implemented in the trained model. This solution extracts questions and answers by paragraph, updates data based on the correlation between questions and all answers, and between answers and all questions, and performs sentiment judgment. This takes into account all text data and the correlation between questions and answers. Compared to directly learning the entire paragraph, it requires less computation and achieves higher accuracy in sentiment identification. This solution can improve the efficiency of interviewer emotion recognition.

[0058] Further, such as Figure 2 As shown, the step of updating all data in the matrix according to the correlation between the words in the question text segment and the words in the answer text segment in the question-answer pair specifically includes:

[0059] Step S501: Through the attention mechanism, dot products are performed on the words in the question text segment of a question-answer pair with each word in the corresponding answer text segment to obtain a set of relationship values ​​between each word in the question text segment and each word in the corresponding answer text segment; or dot products are performed on the words in an answer text segment with each word in the corresponding question text segment to obtain a set of relationship values ​​between each word in the answer text segment and each word in the corresponding question text segment.

[0060] By multiplying the vector corresponding to the word with the vectors of all the words in the corresponding question text segment or answer text segment, a set of numerical values ​​is obtained. These numerical values ​​reflect the relationship between the word and all the words in the relative question text or answer text, which are the above-mentioned relationship values.

[0061] Step S502: mapping the relationship values ​​according to the ratio of the relationship values ​​corresponding to each word;

[0062] Through a set of mappings, the relationship values ​​are adjusted proportionally to values ​​between 0 and 1, and the sum of the relationship values ​​of a word and the words in the corresponding question text segment or answer text segment is 1. This can uniformly represent all question-answer pairs, and accurately and effectively determine the correlation between all words and the words in the corresponding question text and answer text. Among them, softmax is a classification algorithm that maps the transmission values ​​of a group of categories to a range of 0 to 1 as probabilities, and the sum of them is 1, so that each group of categories can obtain weighted acquisition opportunities.

[0063] Step S503: Based on the mapped set of relationship values, weighted sum is taken for all words in the answer text segment to update the words in the question text segment that are corresponding to the set of relationship values; or based on the mapped set of relationship values, weighted sum is taken for all words in the question text segment to update the words in the answer text segment that are corresponding to the set of relationship values.

[0064] Specifically, in one embodiment, a word q1 is extracted from the question text, and the answer text contains multiple words (a1, a2, a3, a4, a5, a6)

[0065] The word q1 in the question text is dot-producted with each word in the answer text

[0066] The six values ​​S1, S2, S3, S4, S5, and S6 are the correlation values, corresponding to a1...a6 one by one.

[0067] Then S1a1+S2a2+S3a3+S4a4+S5a5+S6a6=q1`, use q1` to replace q1

[0068] Using the aforementioned relationship values ​​as weights, a weighted sum is taken of all words in the answer and question segments to determine the relevance of the word to all words in the corresponding answer and question segments. This is then used to update the word, reflecting the attention of the answer and question texts. After weighting the sum of the words based on their relationship with each word in the question, a vector is generated. The length of this vector matches the vector representing the word, and this vector replaces the original vector representing the word.

[0069] Step S504: Loop through all words in all question-answer pairs to update the words in all corresponding question text segments or answer text segments.

[0070] This process is repeated for all words in all question-answer pairs to update them and identify the focus of the overall text. This solution adjusts and updates word data based on their relevance to the question-answer text within the question-answer pair, improving the relevance of the question-answer text to the interview discussion and enhancing the efficiency of sentiment assessment.

[0071] Relevance is reflected through the correlation value and relationship value between the question text and the answer text. On the one hand, the correlation value represents the correlation between a word in the question text and a word in the answer text, and the correlation value is obtained by superimposing the relationship values. The correlation value represents the correlation between a word in the question text and the entire answer text. The above correlation value is used as a weight to weight the word in the above question text to reflect the correlation between this word and the answer text. Similarly, based on the correlation between the word in the answer text and the question text, the word in the question and answer text is weighted to reflect the star power between the word in the answer text and the question text.

[0072] Furthermore, after the step of inputting all the question text segments and answer text segments into the trained model and encoding each group of the question text segments and answer text segments into a matrix, wherein the words in the question text segments and the answer text segments are represented by rows or columns in the matrix, and before combining all the question text segments with each answer text segment to form a question-answer pair, the method further includes:

[0073] Step S300: In the trained model, the preceding hidden layer and the succeeding hidden layer of each word are obtained through the bidirectional LSTM model, and the corresponding words in the question text segment and the answer text segment are replaced by the spliced ​​preceding hidden layer and the succeeding hidden layer.

[0074] Specifically, all updated matrices corresponding to the question-answer pairs are concatenated to obtain a concatenated matrix, wherein the vectors corresponding to the words are arranged sequentially in the concatenated matrix;

[0075] In the process of making emotion judgments through question text segments and answer text segments, the contextual relationship in the corresponding matrix cannot be taken into account. Through the LSTM model, the matrices in the question text segments and the answer text segments are processed accordingly, and some interference information can be forgotten in the vector corresponding to each word, and some useful information can be added, so that the vector corresponding to the text can record the influence of other vectors in the matrix. In the embodiment of the present application, a bidirectional LSTM model is used, which can output the preceding hidden layer and the succeeding hidden layer corresponding to each word. The output preceding hidden layer and the succeeding hidden layer are spliced ​​and subsequently processed instead of the original text, which can further take into account the relationship between the word and the context.

[0076] The model trained in this application includes two hidden layers, of which LSTM is a layer of the model used in the embodiment of this application. It is a nonlinear time-recurrent neural network. Compared with general recurrent neural networks, in the process of processing semantic problems, LSTM can perform semantic recognition by combining the semantic content of the context, especially in the semantic recognition of long texts, it can mine the correlation between the previous and next questions to control the accuracy of semantic recognition. Other neural networks will produce errors in the process of processing text and speech because they cannot associate the context. This is more obvious for the use environment of continuous question and answer. A bidirectional LSTM model is used in the embodiment of this application, which can output the preceding hidden layer and the following hidden layer corresponding to each word, and splice the preceding hidden layer and the following hidden layer output to replace the original text for subsequent processing, which can further take into account the relationship between the word and the context. This solution can record the data of words in the context of the question text or the answer text, and improve the accuracy of judging the emotions of the interviewees by words.

[0077] Another layer included in the trained model of this application is an attention mechanism layer, which is used to update the vector corresponding to each word in the question text and the answer text based on the attention between the question text and the answer text.

[0078] Further, such as Figure 3 As shown, step S600 concatenates all the updated question text matrices and answer text matrices into a concatenated matrix, and converts the rows or columns of the concatenated matrix into a number that matches the preset emotion categories through a linear transformation, so as to determine the probability of conforming to a preset emotion category through each row or column of the concatenated matrix, specifically including:

[0079] Step S601 concatenates all updated matrices corresponding to question-answer pairs to obtain a concatenated matrix, wherein the vectors corresponding to the words are arranged sequentially in the concatenated matrix.

[0080] In this embodiment, after processing each word through softmax mapping, each word is represented by a low-dimensional vector, and the question text and the answer text are composed of a matrix of several vectors corresponding to the word. The matrix processed by the LSTM model and the attention mechanism is spliced ​​to form a matrix with the same number of rows or columns as the dimension of the vector corresponding to the word, that is, the matrix corresponding to each word occupies a positive row or an entire column.

[0081] Step S602 multiplies the preset first matrix by the concatenated matrix to obtain an emotion matrix whose number of rows or columns corresponds to the emotion type.

[0082] During the linear transformation process, the first matrix is ​​multiplied by the splicing matrix to narrow the value range of the matrix. In one embodiment, in order to minimize the size of the matrix after the multiplication, the first matrix only contains a vector with one dimension corresponding to the emotion type. In the final emotion matrix, each row or column corresponds to a preset emotion.

[0083] Step S603 adds a preset second matrix to the emotion matrix to offset and update the emotion matrix, wherein the number of rows and columns of the second matrix is ​​adapted to the first matrix.

[0084] The emotion matrix is ​​offset by adding the second matrix to the emotion matrix, and the emotion matrix is ​​adjusted, which is conducive to making the emotion matrix smoother.

[0085] Step S604 determines the probability of the corresponding emotion by summing up all elements in the row according to the correspondence between each row of the emotion matrix and the emotion type; or determines the probability of the corresponding emotion by summing up all elements in the column according to the correspondence between each column of the emotion matrix and the emotion type.

[0086] Preset emotion categories are mapped to rows or columns in the emotion matrix. By summing the elements in the corresponding row or column, the probability of the question and answer text belonging to the corresponding emotion is calculated. This solution can integrate the correlation between the question and answer text in the question and answer text, improving the accuracy of the emotion probability determination.

[0087] Further, such as Figure 4 As shown, the training method of the model specifically includes:

[0088] Step Sa: Input several question text segments, answer text segments and corresponding emotion classifications into the initial model.

[0089] The model training process first inputs several sets of text segments and emotion classification data. The model is trained using a pre-prepared set of question texts, answer texts, and emotion categories. The emotion categories corresponding to the question texts and answer texts are known. The question texts and answer texts are input into the model for calculation to obtain the calculated emotion categories, which are compared with the known emotion categories. The parameters in the model are then adjusted, and the question texts and answer texts are recalculated. The calculated emotion categories are then compared with the known emotion categories. Once the model output results match the actual situation, the model can be put into actual operation and use. During the training process, multiple sets of combinations of question texts, answer texts, and known emotion categories are preset. The model is trained using multiple sets of data to ensure that the parameters in the model are reasonable and the training accuracy of the model is guaranteed.

[0090] Step Sb: Determine the preceding hidden layer and the following hidden layer of each word in the question text segment and the answer text segment through a bidirectional LSTM (Long Short-Term Memory) model layer, and replace the word by splicing the preceding hidden layer and the following hidden layer.

[0091] LSTM is a layer of the model used in the real-time example of this application. It is a nonlinear time-recurrent neural network. Compared with general recurrent neural networks, in the process of processing semantic problems, LSTM can perform semantic recognition by combining the semantic content of the context, especially in the semantic recognition of long texts. It can mine the correlation between the previous and next questions to control the accuracy of semantic recognition. Other neural networks will produce errors in the process of processing text and speech because they cannot associate the context. This is more obvious for the use environment of continuous question answering. The bidirectional LSTM model used in the embodiment of this application can output the preceding hidden layer and the following hidden layer corresponding to each word. The output preceding hidden layer and the following hidden layer are spliced ​​and replaced with the original text for subsequent processing, which can further take into account the relationship between the word and the context.

[0092] Step Sc: All the question text segments that have completed the word replacement are respectively combined with any of the answer text segments in pairs to form question-answer pairs.

[0093] The question text segment and each answer are paired together to form a question-answer pair, and in the subsequent process, the relevance of the question text segment and the answer text segment in each question-answer pair is judged.

[0094] Step Sd: Update the vectors representing all representative words in the matrix according to the correlation between the words in the question text segment and the words in the answer text segment in the question-answer pair through the attention mechanism layer.

[0095] Attention is a mechanism that aims to identify key areas of focus for data analysis by combining correlations between individual parts of the data and the rest of the data. The approach involves determining the correlation between a particular part of the data (text, speech, or image) and other parts, using weights to represent the correlations between that part and the rest. This weighting is then applied to the data to extract the most noteworthy components. There are many ways to implement this mechanism.

[0096] In this solution, in each question-answer pair, the columns corresponding to the words in the matrix are adjusted in a weighted manner based on the correlation between the words in the question text segment and each word in the answer text segment, as well as the correlation between the words in the answer text segment and each word in the question text segment, to update the vectors of all representative words in the matrix representing the question text segment and the answer text segment. Specifically, after the aforementioned operations, the question text segment and the answer text segment in each question-answer pair are each represented by a matrix. The two matrices have the same number of columns or rows. If the number of columns is the same, each row in the matrix represents a word in the question text and the answer text (specifically, through a bidirectional LSTM, it is actually represented by the preceding hidden layer and the following hidden layer of each word), and vice versa. Perform dot products between the vector representing a word in the question text and the vector representing each word in the answer text. If there are n words in the answer text, n numerical values ​​are obtained. These n values ​​represent the correlation between a word in the question text and each word in the answer text. Considering the operational uniformity between words and words, and between texts, this embodiment maps these numerical values ​​to a value whose sum is equal to 1 through softmax mapping.

[0097] Next, the corresponding words in the answer text are weighted using the n values ​​mentioned above. The resulting n weighted vectors are then added together to create a new vector, which replaces the vector representing a word in the question text. This completes the process of updating the vector representing a word in the matrix based on the correlation between the question and answer texts. By performing this replacement on all vectors representing a word in both the question and answer texts, all data in the matrix is ​​replaced.

[0098] Step Se: concatenate all the updated matrices and perform linear transformation to determine the probability of matching any emotion type.

[0099] By updating the matrices corresponding to the question text and answer text for all question-answer pairs, we can obtain several question text segment matrices reflecting the relationship with the answer text segment, as well as several answer text segment matrices reflecting the relationship with the question text segment. Each group of question text segments in the original text corresponds to several matrices, and each group of answer text segments also corresponds to several matrices. These matrices are spliced ​​together to form a complete set of data for analyzing user emotions. This complete set of data can fully reflect the relationship between each question text segment and each answer text segment, and can focus attention on key words. On this basis, through linear transformation, the spliced ​​matrix is ​​converted into a dimension that meets the preset number of emotion categories. The linear transformation method for the spliced ​​matrix is ​​to multiply it by a preset matrix, the dimension of which corresponds to the number of emotion categories in the emotion classification, and then add a preset offset to obtain the final matrix reflecting the emotion category.

[0100] Specifically, each word in the matrix is ​​represented by a vector, so the matrices corresponding to the question text and the answer text formed by these vectors have the same number of rows or columns. The two sets of matrices are combined into one matrix, and the matrix corresponding to the question text and the matrix corresponding to the answer text are spliced ​​into a complete matrix, using the vectors representing the words as rows or columns.

[0101] Because the above-mentioned complete matrix is ​​very large, if the subsequent calculations are performed directly, the amount of calculation will be large. In order not to affect the accuracy of the subsequent calculations and to reduce the amount of calculation of the subsequent calculations, it is necessary to perform a linear transformation on this complete linear matrix. Specifically, it is multiplied by a first preset matrix whose rank number corresponds to the number of emotion types to greatly reduce its size, and then offset and added with a second preset matrix. The second matrix serves as an offset, and its number of rows and columns is adapted to the first preset matrix. The first matrix and the second matrix are preset parameters of the model, which are determined by pre-training. After a round of training, the first matrix and the second matrix will be adjusted, and the training process will be iterated until the linear transformation of the spliced ​​matrix by the first matrix and the second matrix can accurately reflect the emotion types corresponding to a set of question text segments and answer text segments.

[0102] Step Sf: Taking the emotion classification as the true value, calculate the cross entropy loss of the probability of the emotion category.

[0103] The concatenated matrix after linear transformation can reflect the judgment of emotions in a round of training. The true value of the emotion classification corresponding to the text is set to 1, and the true value of other emotions is 0. The cross-entropy loss is calculated to determine the accuracy of this round of judgment, and the parameter adjustment is determined based on the cross-entropy loss value.

[0104]

[0105] Please refer to the above formula, where p(x) is the true value of the text corresponding to a certain emotion, and q(x) is the model's prediction probability that the text corresponds to p(x). Because there are multiple preset emotions, X is the set of all preset emotion types, and x belongs to one of these emotion types. The specific cross-entropy loss is calculated by determining the cross-entropy loss of the text for each emotion based on the true value of the text and the corresponding predicted probability. The cross-entropy loss for each emotion is then summed to determine the model's cross-entropy loss for the emotion.

[0106] Step Sg: According to the cross entropy loss, the initial model is iteratively updated until the cross entropy loss converges, and the updated initial model is used as the trained model.

[0107] According to the cross-entropy loss value, the preset parameters in the model are adjusted, including the parameter values ​​in the LSTM model, the preset matrix multiplied by the concatenation matrix, and the added offset. Then, the next round of training is carried out until the cross-entropy loss value converges. Ideally, when the cross-entropy loss infinitely approaches 0, the model's emotion judgment is most accurate. After adjusting the parameters summarized by the model, the cross-entropy will approach the true value when the model judges the type of emotion, that is, the cross-entropy loss approaches zero. When the cross-entropy loss no longer decreases after multiple rounds of training, it is determined that the cross-entropy loss has converged and the current model has been trained to the maximum accuracy it can provide. This solution can be trained based on the relationship between words and context, as well as the relationship between question text and answer text, and the model parameters are highly accurate.

[0108] Furthermore, the emotion classification includes several preset emotion categories, with the probability of one emotion category set to 100% and the probabilities of the remaining emotion categories set to 0%. This solution can train the model by combining multiple preset emotions. By assigning the probability of an emotion to the probability corresponding to the question text segment and the answer text segment, the model parameters are converged to the greatest extent possible, achieving high accuracy.

[0109] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When executed, the program can include the processes in the above-described method embodiments. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0110] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0111] Further references Figure 5 , as a response to the above Figure 1The present application provides an embodiment of a device for determining emotions in a multi-round question-answering process. Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0112] like Figure 4 As shown, the emotion determination device for multi-round question-answering in this embodiment includes: a segmentation module 100, an encoding module 200, a combination module 400, an update module 500, a probability module 600, and a selection module 700. Among them:

[0113] The segmentation module 100 is configured to receive a question-and-answer text and segment the question-and-answer text into at least two question text segments and at least two answer text segments.

[0114] The encoding module 200 is used to input all the question text segments and answer text segments into the trained model, and encode each group of the question text segments and answer text segments into a matrix, wherein the words in the question text segments and the answer text segments are represented by rows or columns in the array.

[0115] The combining module 400 is used to combine all the encoded question text segments with each answer text segment to form question-answer pairs.

[0116] The updating module 500 is used to update the words in the matrix representing the question text according to the correlation between the words in the question text segment and the words in the answer text segment in the question-answer pair.

[0117] The probability module 600 is used to splice all the updated question text matrices and answer text matrices into a spliced ​​matrix, and convert the rows or columns of the spliced ​​matrix into a number that is consistent with the preset emotion types through linear transformation, so as to determine the probability of each row or column of the spliced ​​matrix meeting a preset emotion type.

[0118] The selection module 700 is used to select the emotion with the highest probability as the respondent's emotion and output the respondent's emotion.

[0119] Specifically, the text is segmented according to questions and answers through the segmentation module, and the question text segment and the answer text segment are distinguished. According to the correlation between the words in the question text segment and the answer text segment, as well as the correlation between the words in the question and answer text segment and the question text segment, the content of all the question text segments and the answer text segment is updated multiple times through the update module based on the original data. The updated data is spliced ​​and linearly transformed through the probability module to determine the possibility of the user being in the corresponding emotion in multiple dimensions, and the user's current emotion is determined based on the dimension with the greatest probability through the selection module. This solution extracts questions and answers according to paragraphs, and updates the data based on the correlation between questions and all answers, and answers and all questions, and makes emotion judgments. In this way, all text data and the correlation between questions and answers are taken into account. Compared with direct learning of the entire paragraph, the amount of calculation is smaller and the accuracy of emotion confirmation is higher. This solution can improve the efficiency of emotion recognition of interviewers.

[0120] Further, such as Figure 6 The update module 500 further specifically includes:

[0121] The relationship value submodule 501 is used to perform dot products on the words in the question text segment of a question-answer pair with each word in the corresponding answer text segment through the attention mechanism to obtain a set of relationship values ​​between each word in the question text segment and each word in the corresponding answer text segment; or to perform dot products on the words in an answer text segment with each word in the corresponding question text segment to obtain a set of relationship values ​​between each word in the answer text segment and each word in the corresponding question text segment.

[0122] The mapping submodule 502 is configured to map the relationship values ​​according to the ratio of the relationship values ​​corresponding to each word; and

[0123] The updating submodule 503 is used to perform a weighted summation of all the words in the answer text segment according to the mapped set of relationship values ​​to update the words in the question text segment that are corresponding to the set of relationship values; or to perform a weighted summation of all the words in the question text segment according to the mapped set of relationship values ​​to update the words in the answer text segment that are corresponding to the set of relationship values; and is also used to loop through all the words in all question-answer pairs to update the words in all relative question text segments or answer text segments.

[0124] This solution can adjust and update word data based on the relevance between words and question-answer texts in question-answer pairs, thereby improving the relevance of question-answer texts with interview discussions and enhancing the efficiency of sentiment judgment.

[0125] Furthermore, the emotion determination device for multiple rounds of question and answer also includes: a word adjustment module 300, which is used to: obtain the preceding hidden layer and the following hidden layer of each word in the trained model through a bidirectional LSTM model, and replace the corresponding words in the question text segment and the answer text segment. To solve the above technical problems, the embodiment of the present application also provides a computer device. For details, please refer to Figure 6 , Figure 6 This is a basic structural block diagram of the computer device in this embodiment.

[0126] This solution can combine the data of words recorded in the context of question text or answer text to improve the accuracy of judging the interviewer's emotions through words.

[0127] Further, such as Figure 7 、 Figure 8 As shown, the emotion determination device for multiple rounds of question and answer further includes: a model training module 800, which specifically includes:

[0128] The information input submodule 801 is used to input a number of question text segments, answer text segments and corresponding emotion classifications into the initial model.

[0129] The context processing submodule 802 uses a bidirectional LSTM (Long Short-Term Memory) model to determine the preceding hidden layer and the following hidden layer of each word in the question text segment and the answer text segment, and replaces the word by splicing the preceding hidden layer and the following hidden layer.

[0130] The text combination submodule 803 is used to combine all the question text segments that have completed the word replacement with any of the answer text segments into question-answer pairs.

[0131] The update replacement submodule 804 is used to update the vectors representing all representative words in the matrix according to the correlation between the words in the question text segment and the words in the answer text segment pair in the question-answer pair through the attention mechanism layer.

[0132] The probability analysis submodule 805 is used to concatenate all the updated matrices and perform linear transformation to determine the probability of matching any emotion type.

[0133] The parameter acquisition submodule 806 is used to calculate the cross-entropy loss of the probability of the emotion type by taking the emotion classification as the true value; and iteratively update the initial model according to the cross-entropy loss until the cross-entropy loss converges, and use the updated initial model as the trained model.

[0134] This solution can be trained based on the relationship between words and context, as well as the relationship between question text and answer text, and the model parameters are highly accurate.

[0135] refer to Figure 9 In order to solve the above technical problems, the present application also provides a computer device that adopts the following technical solution:

[0136] A computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the above-mentioned method for determining emotions in a multi-round question-and-answer session. This solution can improve the efficiency of emotion recognition for interviewers.

[0137] The computer device 6 includes a memory 61, a processor 62, and a network interface 63 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 6 with components 61-63, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0138] The computer device may be a desktop computer, notebook computer, PDA, cloud server, etc. The computer device may interact with the user via a keyboard, mouse, remote control, touchpad, or voice control device.

[0139] The memory 61 includes at least one type of readable storage medium, including flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, a magnetic disk, an optical disk, etc. In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as the hard disk or memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash memory card, etc. equipped on the computer device 6. Of course, the memory 61 may also include both the internal storage unit of the computer device 6 and its external storage device. In this embodiment, the memory 61 is generally used to store the operating system and various application software installed on the computer device 6, such as the program code of the emotion determination method for multi-round question and answer. In addition, the memory 61 can also be used to temporarily store various types of data that have been output or are to be output.

[0140] In some embodiments, the processor 62 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 62 is generally used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is used to execute program code stored in the memory 61 or process data, such as executing the program code of the multi-round question-and-answer emotion determination method.

[0141] The network interface 63 may include a wireless network interface or a wired network interface. The network interface 63 is generally used to establish a communication connection between the computer device 6 and other electronic devices.

[0142] This application also provides another embodiment, namely, a computer-readable storage medium storing a program for a method for determining emotions during multiple rounds of questioning and answering. The program is executable by at least one processor to cause the at least one processor to perform the steps of the method for determining emotions during multiple rounds of questioning and answering. This solution can improve the efficiency of interviewer emotion recognition.

[0143] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0144] Obviously, the embodiments described above are only some of the embodiments of the present application, rather than all of the embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions described in the aforementioned specific embodiments, or to make equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the present application specification and the accompanying drawings, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present application.

Claims

1. A method for determining emotions in a multi-round question-answering process, characterized in that: The steps include: receiving a question-and-answer text, and dividing the question-and-answer text into at least two question text segments and at least two answer text segments; Inputting all the question text segments and answer text segments into the trained model, encoding each group of the question text segments and answer text segments into a matrix, wherein the words in the question text segments and answer text segments are represented by rows or columns in the matrix; Combine all the encoded question text segments with each answer text segment to form question-answer pairs; Update the words in the question text matrix or the answer text matrix according to the correlation between the words in the question text segment and the words in the answer text segment pair in the question-answer pair; Splicing all the updated question text matrices and answer text matrices into a spliced ​​matrix, and converting the rows or columns of the spliced ​​matrix into a number that is consistent with the preset number of emotion types through a linear transformation, so as to determine the probability of conforming to a preset emotion type through each row or each column of the spliced ​​matrix; The emotion type with the highest probability is taken as the respondent emotion and the respondent emotion is output.

2. The emotion determination method for multi-round question and answer according to claim 1, characterized in that: The step of updating the words in the question text matrix or the answer text matrix according to the correlation between the words in the question text segment and the words in the answer text segment pair in the question-answer pair specifically includes: Through the attention mechanism, dot products are performed on the words in the question text segment of a question-answer pair with each word in the corresponding answer text segment to obtain a set of relationship values ​​between each word in the question text segment and each word in the corresponding answer text segment; or dot products are performed on the words in an answer text segment with each word in the corresponding question text segment to obtain a set of relationship values ​​between each word in the answer text segment and each word in the corresponding question text segment; Mapping the relationship values ​​according to the ratio of the relationship values ​​corresponding to each word; According to the mapped set of relationship values, weighted summing is performed on all words in the answer text segment to update the words in the question text segment corresponding to the set of relationship values; or according to the mapped set of relationship values, weighted summing is performed on all words in the question text segment to update the words in the answer text segment corresponding to the set of relationship values; Loop through all the words in all question-answer pairs to update the words in all corresponding question text segments or answer text segments.

3. The emotion determination method for multi-round question-answering according to claim 1, characterized in that: After taking the emotion type with the highest probability as the respondent's emotion, the method further includes: storing the question and answer text and the respondent's emotion in a blockchain network node.

4. The emotion determination method for multi-round question-answering according to claim 1, characterized in that: After the step of inputting all the question text segments and answer text segments into the trained model and encoding each group of the question text segments and answer text segments into a matrix, wherein the words in the question text segments and the answer text segments are represented by rows or columns in the matrix, and before combining all the encoded question text segments with each answer text segment to form a question-answer pair, the method further includes: In the trained model, the preceding hidden layer and the following hidden layer of each word are obtained through the bidirectional LSTM model, and the corresponding words in the question text segment and the answer text segment are replaced by the spliced ​​preceding hidden layer and the following hidden layer.

5. The emotion determination method for multi-round question-answering according to claim 1, characterized in that: The step of splicing all the updated question text matrices and answer text matrices into a spliced ​​matrix, and converting the rows or columns of the spliced ​​matrix into a number that matches the number of preset emotion types through a linear transformation, so as to determine the probability of conforming to a preset emotion type through each row or each column of the spliced ​​matrix, specifically includes: Concatenate all updated question-answer pairs’ corresponding matrices to obtain a concatenated matrix, where the vectors corresponding to the words are arranged sequentially in the concatenated matrix. Obtain an emotion matrix whose number of rows or columns corresponds to the emotion type by multiplying the preset first matrix by the splicing matrix; Adding a preset second matrix to the emotion matrix to offset and update the emotion matrix, wherein the number of rows and columns of the second matrix is ​​adapted to the first matrix; According to the correspondence between each row of the emotion matrix and the emotion type, all elements in the row are summed to determine the probability of the corresponding emotion; or according to the correspondence between each column of the emotion matrix and the emotion type, all elements in the column are summed to determine the probability of the corresponding emotion.

6. The emotion determination method for multi-round question-answering according to any one of claims 1 to 5, characterized in that: The training method of the model specifically includes: Input several question text segments, answer text segments and corresponding sentiment classifications into the initial model; Determine the preceding hidden layer and the following hidden layer of each word in the question text segment and the answer text segment through the bidirectional LSTM model layer, and replace the word by splicing the preceding hidden layer and the following hidden layer; Combining all the question text segments that have completed the word replacement with any of the answer text segments in pairs to form question-answer pairs; Through the attention mechanism layer, the vectors representing all representative words in the question text matrix or the answer text matrix are updated according to the correlation between the words in the question text segment and the words in the answer text segment in the question-answer pair; All updated matrices are concatenated and linearly transformed to determine the probability of matching the preset emotion category; Taking the emotion classification as the true value, calculate the cross entropy loss of the probability of the emotion category; The initial model is iteratively updated according to the cross entropy loss until the cross entropy loss converges, and the updated initial model is used as the trained model.

7. The emotion determination method for multi-round question-answering according to any one of claims 1 to 5, characterized in that: The step of encoding each group of question text segments and answer text segments into matrices specifically includes: By embedding, each word in each group of the question text segment and the answer text segment is processed into a low-dimensional vector; The vectors of the words in a question text segment or an answer text segment are combined into a matrix representing the question text segment or the answer text segment.

8. A multi-round question-answering emotion determination device, characterized in that: include: a segmentation module, configured to receive a question-answer text and segment the question-answer text into at least two question text segments and at least two answer text segments; an encoding module, configured to input all the question text segments and answer text segments into a trained model, and encode each group of the question text segments and answer text segments into a matrix, wherein the words in the question text segments and answer text segments are represented by rows or columns in the matrix; The combination module is used to combine all the encoded question text segments with each answer text segment to form question-answer pairs; An updating module, configured to update the words in the question text matrix or the answer text matrix according to the correlation between the words in the question text segment and the words in the answer text segment pair in the question-answer pair; A probability module is used to splice all the updated question text matrices and answer text matrices into a spliced ​​matrix, and convert the rows or columns of the spliced ​​matrix into a number that is consistent with the preset number of emotion types through a linear transformation, so as to determine the probability of conforming to a preset emotion type through each row or each column of the spliced ​​matrix; and The selection module is used to select the emotion type with the highest probability as the respondent's emotion and output the respondent's emotion.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the emotion determination method for multi-round question and answer according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the emotion determination method for multi-round question-and-answer according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Multi-mode based emotion recognition method

    CN108805089A

  • An emotion-based customer service quality supervision algorithm

    CN109710934A