A method and apparatus for switching modes in human-computer interaction

The method analyzes historical dialogue sentences to determine when to switch from automated to human service in human-machine interaction systems, addressing inefficiencies by assessing dialogue complexity and association, thereby improving service quality and customer satisfaction.

CN113901182BActive Publication Date: 2025-03-18ALIBABA GROUP HOLDING LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010638466.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-06
Publication Date
2025-03-18
Estimated Expiration
2040-07-06

AI Technical Summary

Technical Problem

Current human-machine interaction systems struggle to accurately determine when to switch from automated chatbots to human customer service to meet customer needs effectively, leading to inefficiencies and dissatisfaction in customer service.

Method used

A method and apparatus for human-machine interaction mode switching, which analyzes historical dialogue sentences by encoding them, generating global interaction codes, determining dialogue position vectors, calculating dialogue difficulty weights, and forming a comprehensive expression matrix to decide when to switch from machine to human interaction, based on dialogue complexity and association analysis.

Benefits of technology

This approach enables more accurate and timely switching from automated to human service, enhancing customer service efficiency and satisfaction by assessing dialogue complexity and association, ensuring high-quality interactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113901182B_ABST
    Figure CN113901182B_ABST
Patent Text Reader

Abstract

The present invention discloses a mode switching method and device for human-computer interaction, and relates to the field of computer artificial intelligence technology. The main purpose of the present invention is to determine the timing of switching from robot customer service to human customer service by evaluating the complexity of the dialogue process, so as to improve the efficiency and satisfaction of customer service. The main technical scheme of the present invention is: obtaining historical dialogue sentences of human-computer interaction, the historical dialogue sentences include multiple sentences; encoding the multiple sentences respectively to obtain multiple sentence codes; obtaining global interaction codes according to the multiple sentence codes; generating a dialogue position vector according to the global interaction code; determining a dialogue difficulty weight according to the dialogue position vector; obtaining a dialogue comprehensive expression matrix according to the global interaction code and the dialogue difficulty weight; determining to switch from machine dialogue to human according to the dialogue comprehensive expression matrix.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer artificial intelligence technology, and in particular to a method and device for switching modes of human-computer interaction. Background Art

[0002] As a very popular and promising application, the human-computer dialogue system is gradually being used in many fields. Relying on relevant technologies such as speech recognition and natural language understanding, the human-computer dialogue system aims to provide users with various services in the form of voice interaction, such as consultation, guidance, daily chat, etc., which will directly change the existing service provision methods in the future.

[0003] At present, chatbots have been widely used in the customer service industry to serve customer calls, pre-sales and after-sales services. However, due to the complexity of human conversations, automatic chatbots cannot meet all customer needs. Human customer service is still needed to replace chatbots when they cannot provide effective services to improve customer satisfaction with the service. However, during the conversation between customers and chatbots, how to accurately know and switch to human customer service to improve customer service efficiency and satisfaction has become an urgent problem to be solved. Summary of the invention

[0004] In view of the above problems, the present invention proposes a mode switching method and device for human-computer interaction, the main purpose of which is to determine the timing of switching from robot dialogue to manual dialogue by evaluating the complexity of the dialogue process, so as to improve the efficiency and satisfaction of customer service.

[0005] In order to achieve the above object, the present invention mainly provides the following technical solutions:

[0006] In one aspect, the present invention provides a method for switching a mode of human-computer interaction, which specifically includes:

[0007] Acquire historical dialogue sentences of human-computer interaction, wherein the historical dialogue sentences include a plurality of sentences;

[0008] Encoding the multiple sentences respectively to obtain multiple sentence codes;

[0009] Obtaining a global interaction code according to the multiple sentence codes;

[0010] generating a dialogue position vector according to the global interaction encoding;

[0011] Determining a dialogue difficulty weight according to the dialogue position vector;

[0012] Obtaining a comprehensive dialogue expression matrix according to the global interaction coding and the dialogue difficulty weight;

[0013] According to the comprehensive expression matrix of the dialogue, it is determined to switch from machine dialogue to manual dialogue.

[0014] On the other hand, the present invention provides a mode switching device for human-computer interaction, specifically comprising:

[0015] An acquisition unit, used for acquiring historical dialogue sentences of human-computer interaction, wherein the historical dialogue sentences include a plurality of sentences;

[0016] A sentence encoding unit, used to encode the multiple sentences obtained by the acquisition unit respectively to obtain multiple sentence codes;

[0017] A dialogue encoding unit, used for obtaining a global interaction encoding according to the multiple sentence encodings obtained by the sentence encoding unit;

[0018] A generating unit, configured to generate a dialogue position vector according to the global interaction encoding obtained by the dialogue encoding unit;

[0019] a determining unit, configured to determine a dialogue difficulty weight according to the dialogue position vector obtained by the generating unit;

[0020] a synthesis unit, configured to obtain a dialogue comprehensive expression matrix according to the global interaction encoding obtained by the dialogue encoding unit and the dialogue difficulty weight obtained by the determination unit;

[0021] The switching unit is used to determine the switch from machine dialogue to manual dialogue according to the comprehensive dialogue expression matrix obtained by the synthesis unit.

[0022] On the other hand, the present invention provides a processor, which is used to run a program, wherein the program executes the above-mentioned mode switching method of human-computer interaction when running.

[0023] By means of the above technical scheme, the present invention provides a mode switching method and device for human-computer interaction, which is to analyze each dialogue sentence according to the historical content of the human-computer dialogue during the human-computer interaction process to determine whether it is necessary to switch the robot dialogue to a manual dialogue. Specifically, the present invention encodes the historical dialogue sentences of the human-computer interaction, and then generates a global interaction code based on the entire dialogue according to the sentence code, and uses the global interaction code to determine the dialogue difficulty weight according to the position of different sentences in the dialogue, thereby obtaining a dialogue comprehensive expression matrix, and determining whether to switch the robot dialogue to a manual one by analyzing the dialogue comprehensive expression matrix. It can be seen that the present invention comprehensively determines the switching timing through the analysis of sentence coding and dialogue difficulty, and determines the overall complexity of the dialogue through the position of the sentence in the dialogue, so as to judge whether the robot can make an effective response, thereby more accurately judging whether it is necessary to switch to manual service at present, so as to ensure high-quality service to customers.

[0024] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0026] Figure 1 A flow chart of a method for switching modes of human-computer interaction proposed in an embodiment of the present invention is shown;

[0027] Figure 2 A flowchart showing a dialogue sentence encoding process proposed in an embodiment of the present invention is shown;

[0028] Figure 3 A flowchart of a dialogue sentence encoding process according to an embodiment of the present invention is shown;

[0029] Figure 4 A flowchart of a dialogue sentence relevance matching process proposed in an embodiment of the present invention is shown;

[0030] Figure 5 A flowchart of a dialogue sentence relevance matching process according to an embodiment of the present invention is shown;

[0031] Figure 6 A flow chart of a human-machine handover prediction process proposed in an embodiment of the present invention is shown;

[0032] Figure 7 A flowchart of a human-machine handover prediction process according to an embodiment of the present invention is shown;

[0033] Figure 8 A block diagram showing a composition of a mode switching device for human-computer interaction proposed in an embodiment of the present invention is shown;

[0034] Fig. 9 A block diagram showing the composition of another mode switching device for human-computer interaction proposed in an embodiment of the present invention. DETAILED DESCRIPTION

[0035] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.

[0036] The embodiment of the present invention provides a method for switching the mode of human-computer interaction, which is mainly used to analyze the content of the human-computer dialogue in real time during the human-computer interaction process, promptly discover the situation where the robot cannot effectively serve the customer and switch the dialogue to the manual service mode. The currently used human-computer switching methods are mainly divided into two categories, one is a method based on keywords and manual judgment, and the other is a method based on sentiment analysis and intention recognition.

[0037] The first method is mainly based on the existing business accumulation, and switches to manual service by pre-setting designated keywords and matching rules. At the same time, the manual customer actively determines whether to intervene in the current conversation. This method requires adding or adjusting relevant keywords and matching rules at any time according to business programming. Although a large number of obvious requests for manual service can be identified, this method is not flexible enough. Some novel expressions or scenarios that do not appear in the matching rules will not be identified, allowing the robot to give wrong answers and affect the customer's service experience.

[0038] The second method is to use the conversation content and context information to train machine learning or deep learning models to judge the emotions and intentions of the customer conversation. When the customer shows negative emotions or the intention recognition is unstable during the conversation, the robot service is switched to manual service. However, this judgment method based on sentiment analysis and intention recognition has a lag, and manual service is used to remedy the situation when the customer is already dissatisfied, which is not conducive to improving customer service satisfaction.

[0039] Based on the brief description and analysis of the above human-computer switching method, it can be seen that the existing human-computer switching method cannot effectively identify the switching timing in the human-computer interaction process. Therefore, the human-computer interaction mode switching method proposed in the embodiment of the present invention is a solution to solve this problem and is based on the complexity of the dialogue sentences and the correlation between the sentences in the dialogue process to identify the human-computer switching timing. Specifically, the implementation steps of this method are as follows: Figure 1 As shown, including:

[0040] Step 101: Obtain historical dialogue sentences of human-computer interaction.

[0041] The embodiment of the present invention monitors and analyzes the human-computer interaction process, and obtains historical dialogue sentences in the dialogue process, wherein the historical dialogue sentences include all sentences spoken by the customer and the chat robot, that is, the dialogue sentences spoken by the customer and the dialogue sentences spoken by the chat robot, so that the historical dialogue sentences contain multiple sentences.

[0042] Step 102: Encode the multiple sentences respectively to obtain multiple sentence codes.

[0043] When judging the switching opportunity, the embodiment of the present invention performs real-time analysis on all the acquired historical dialogue sentences and gives a judgment result on whether to switch. In the real-time analysis, the acquired historical dialogue sentences need to be sentence encoded. The conventional sentence encoding method is to segment the dialogue sentences, and then vectorize the segmented words to obtain a vector sequence. In this step, when encoding the historical dialogue sentences, the complexity information of the sentences is added to the conventional encoding method to generate sentence encoding with complexity representation.

[0044] Among them, the complexity of a dialogue sentence refers to the difficulty of the system understanding its semantics after encoding a sentence, or the semantic accuracy of the sentence encoding. The complexity can be quantified by parameters such as the length of the sentence itself (i.e., the number of participles) and the positional relationship of each participle in the sentence. For example, the semantics expressed in a sentence can only be clearly expressed when the number of participles in a sentence is within a certain range. Too many or too few participles will increase the difficulty of the system to understand the sentence, thereby affecting the accuracy of the subsequent analysis of the switching timing.

[0045] This step is to add the information of sentence complexity when encoding each sentence. The specific method of adding is not limited to concatenating the vector corresponding to the sentence complexity in the conventional sentence vector sequence (that is, after calculating the complexity of the entire sentence, adding the result to the vector sequence to obtain the sentence encoding), or adding the corresponding complexity weight to each word segmentation vector of the sentence to generate a new vector sequence (that is, generating a new sentence encoding based on the word segmentation in the sentence to represent the complexity of the sentence).

[0046] Step 103: Obtain a global interaction code based on multiple sentence codes.

[0047] The global interaction coding is a dialogue coding for the entire dialogue, which is obtained based on the input order of multiple sentences and the association between sentences. The global interaction coding can effectively match the association between sentences in the dialogue.

[0048] Step 104: Generate a dialogue position vector according to the global interaction coding.

[0049] This step determines the position of each sentence in the conversation based on the global interaction encoding, and represents the position of each sentence with a vector, thereby obtaining a conversation position vector. In practical applications, as the number of conversation sentences increases, the conversation position vector will change accordingly.

[0050] Step 105: Determine a dialogue difficulty weight according to the dialogue position vector.

[0051] The dialogue difficulty weight is used to measure the complexity of a dialogue consisting of multiple sentences. The higher the complexity, the less accurate the response information output by the robot dialogue. Generally, the dialogue difficulty weight increases with the length of the dialogue position vector, that is, the more sentences there are in the dialogue, the higher the corresponding dialogue difficulty weight.

[0052] Step 106: Obtain a comprehensive dialogue expression matrix based on the global interaction coding and dialogue difficulty weight.

[0053] The comprehensive dialogue expression matrix is ​​obtained by adding the dialogue difficulty weight to the global interaction encoding to represent the correlation between each sentence in the dialogue.

[0054] Step 107: Determine the switch from machine dialogue to manual dialogue based on the comprehensive dialogue expression matrix.

[0055] Since the conversation comprehensive expression matrix represents the correlation between each sentence in the conversation, when analyzing whether to switch to manual service, this embodiment is determined based on the correlation analysis. For example, when the content of the sentence replied by the robot is obviously irrelevant to the question asked by the customer, it is necessary to switch to manual service; or when the customer or the robot repeatedly says the same sentence, it may be that the customer is not satisfied with the robot's reply or the robot does not know how to reply to the customer, in which case it is also necessary to switch to manual service.

[0056] Generally, the lower the correlation between sentences, the greater the need to switch to manual service. However, it may also be a new question raised by the customer. Therefore, the switching timing cannot be identified only by the global interaction coding of the dialogue. In the embodiment of the present invention, the dialogue difficulty weight is combined with the global interaction coding, and the complexity of the entire dialogue is measured by the dialogue comprehensive expression matrix to predict whether the dialogue needs to switch from robot dialogue to manual.

[0057] When it is determined to switch to manual service, a switching request is sent to the manual customer service staff, who will continue to provide follow-up services to the customer.

[0058] Through the above Figure 1It can be seen from the steps in the illustrated embodiment that when predicting the time of human-machine switching, the embodiment of the present invention analyzes the correlation of all dialogue sentences in the entire dialogue process, and predicts in combination with the difficulty of the dialogue, and all the dialogue sentences analyzed are sentence codes represented after encoding based on sentence complexity information. It can be seen that the embodiment of the present invention considers the complexity of the sentence segmentation level and the complexity of the sentences in the dialogue respectively, so that the dialogue content expressed by both parties in the human-machine interaction process is more abundant, so that it can more accurately discover and judge whether the robot can effectively provide dialogue services to customers, and use this as a basis for judging the switching of manual services, so as to achieve the purpose of more accurately discovering the time of human-machine switching, and achieve the purpose of improving customer service efficiency while applying robot services to ensure that customers are provided with high-quality services and improve customer service satisfaction.

[0059] Furthermore, for the above Figure 1 It can be seen from the human-computer interaction mode switching method that the embodiment of the present invention mainly includes three parts for identifying the human-computer switching opportunity, which correspond to steps 102, 103 and 104-107, namely, the encoding part of the sentence, the matching part of the correlation between the sentences in the dialogue process, and the prediction part of whether to switch to manual service. The following will explain the preferred implementation methods of the embodiment of the present invention one by one for these three parts:

[0060] First, with respect to the sentence coding part of step 102, the preferred implementation manner of the embodiment of the present invention is as follows: Figure 2 As shown, the specific steps include:

[0061] Step 201: Generate a word vector matrix representing the first sentence according to the word segmentation result of the first sentence and the position of each word segmentation.

[0062] The first sentence is any sentence among multiple historical dialogue sentences.

[0063] This step is to perform necessary preprocessing on the first sentence, such as sentence cleaning and word segmentation, and then vectorize each word by looking up the vector dictionary according to the word segmentation result. At the same time, generate the corresponding position vector according to the position corresponding to each word, add the word vector to the corresponding position vector, and thus form the word vector matrix corresponding to the first sentence.

[0064] Step 202: Determine the first sentence encoding of the first sentence according to the context relationship in the word vector matrix.

[0065] The contextual relationship in the word vector matrix refers to the front-back position relationship between each word segment in the first sentence. In this step, the first sentence encoding can be generated based on the contextual relationship by using a bidirectional LSTM model to encode the word vector matrix, concatenating the state of the last moment of the forward and backward directions to obtain the first sentence encoding corresponding to the first sentence.

[0066] Step 203: Determine the second sentence code of the first sentence according to the sentence complexity weights corresponding to the positions of the respective word segments.

[0067] The second sentence encoding in this step is based on sentence complexity encoding. The specific encoding is based on the sentence complexity weights corresponding to each word segmentation and the word vector matrix. The specific process is as follows:

[0068] First, based on the attention mechanism, the sentence complexity weight matrix is ​​determined by each word in the word vector matrix and the corresponding position of the word. The sentence complexity weight matrix is ​​learned through the attention mechanism model, the input of the attention mechanism model is the word vector matrix, and the output is the sentence complexity weight matrix, which focuses on the word in the first sentence and the corresponding position.

[0069] Afterwards, the second sentence encoding is determined based on the contextual relationship in the word vector matrix and the sentence complexity weight matrix. Specifically, the output state of each moment in the bidirectional LSTM model is multiplied by the sentence complexity weight matrix to obtain the second sentence encoding.

[0070] Step 204: Generate a sentence code corresponding to the first sentence according to the first sentence code and the second sentence code.

[0071] Among them, the first sentence encoding and the second sentence encoding obtained through the above steps are both obtained based on the word vector matrix, and are generally vector sequences. The sentence encoding obtained in this step is the splicing of the first sentence encoding and the second sentence encoding, that is, the two vector sequences are spliced ​​to obtain a new set of splicing vectors, and then the splicing vectors are processed by a feedforward neural network to obtain the sentence encoding corresponding to the first sentence. This step is to merge the first sentence encoding and the second sentence encoding through a feedforward neural network to obtain a sentence encoding with complexity representation.

[0072] Furthermore, when using a feedforward neural network to fuse the first sentence code with the second sentence code, more dimensional information can be added to increase the accuracy of the first sentence representation, thereby improving the accuracy of the subsequent matching and recognition steps. In the human-computer interaction scenario, other dimensional information also includes the role of the first sentence (customer, customer service), sentiment score, etc. Therefore, when generating a splicing vector, you can also first obtain the role vector of the first sentence and / or the sentiment score of the first sentence obtained based on the sentiment dictionary, and then splice the role vector and / or sentiment score with the first sentence code and the second sentence code according to preset rules to obtain a splicing vector, and then pass it through a feedforward neural network to obtain a sentence code with richer content representation.

[0073] The above is a preferred implementation of the sentence encoding part. The specific encoding process can be referred to Figure 3 The flowchart shown in the figure, where W represents the word segmentation in the dialogue sentence, and the word vector and the corresponding position vector 1 are generated by each word segmentation, and the two are added to obtain the word vector matrix E u , using the bidirectional LSTM model to process E u After that, we get the first sentence code s t , learn E through the attention mechanism model u , get the sentence complexity weight matrix α u , the state of the bidirectional LSTM model at each moment is compared with α u Multiply to get the second sentence code a t , and then s t with a t The role vector and sentiment score of the dialogue sentence are concatenated and input into the feedforward neural network to finally obtain the sentence encoding v corresponding to the dialogue sentence. t .

[0074] Second, with respect to the relevance matching part of step 103, the preferred implementation of the embodiment of the present invention is as follows: Figure 4 As shown, the specific steps include:

[0075] Step 301: Obtain a first dialogue encoding matrix based on encoding of multiple sentences.

[0076] The step is to encode the sentences of multiple historical dialogue sentences based on the sentence encoding, and to form a matrix of the sentence encodings of each dialogue sentence according to the sentence order in the dialogue process, namely, the first dialogue encoding matrix.

[0077] Step 302: Determine a relevance weight matrix based on multiple sentence codes.

[0078] Among them, the relevance weight matrix is ​​used to quantify the degree of relevance between multiple statements.

[0079] The statement encoding in this step uses Figure 2The specific method of determining the correlation weight matrix using the first sentence encoding and the second sentence encoding obtained in the illustrated embodiment is: using the first sentence encoding corresponding to the plurality of sentences to obtain the third dialogue encoding matrix; at the same time, using the second sentence encoding corresponding to the plurality of sentences to obtain the fourth dialogue encoding matrix; then, using the third dialogue encoding matrix and the fourth dialogue encoding matrix to generate the correlation weight matrix, specifically, the third dialogue encoding matrix is ​​multiplied by the fourth dialogue encoding matrix, and the vector values ​​in the matrix are normalized to obtain the matrix. The purpose of multiplying the third dialogue encoding matrix by the fourth dialogue encoding matrix is ​​to calculate the similarity of encoding the entire dialogue using two encoding methods, that is, to determine the correlation between different dialogue sentences in the dialogue. Generally, it is believed that the greater or smaller the similarity, the lower the correlation between the corresponding two sentences.

[0080] Step 303: Determine a second dialogue encoding matrix using the first dialogue encoding matrix and the relevance weight matrix.

[0081] This step is to use the relevance weight matrix to add weight values ​​to the vectors in the first dialogue coding matrix, so as to obtain a dialogue coding matrix with relevance information, that is, the second dialogue coding matrix.

[0082] Step 304: determine the global interaction coding according to the first dialogue coding matrix and the second dialogue coding matrix.

[0083] This step is to merge, subtract, and bitwise multiply the first dialogue coding matrix and the second dialogue coding matrix to obtain the first interaction matrix, the second interaction matrix, and the third interaction matrix, and then use the neural network to encode the first interaction matrix, the second interaction matrix, and the third interaction matrix to obtain the global interaction code.

[0084] The purpose of merging the two dialogue encoding matrices is to retain more representation information, and the purpose of subtracting and bitwise multiplying the two dialogue encoding matrices is to compare the similarity of the two dialogue encoding matrices. In addition, the neural network used in this step is preferably a bidirectional LSTM model, and of course other recursive neural network models can also be used, such as a gated recursive neuron GRU and a simple recursive neuron SRU.

[0085] The above is a preferred implementation of the relevance matching part. The specific matching process can be referred to Figure 5 The flowchart shown in the figure shows that the encoding of the sentences in all conversations is aggregated into three encoding matrices. The first conversation encoding matrix V u It is based on sentence encoding v t The third dialogue encoding matrix V is obtained s is based on the first sentence encoding s t The fourth dialogue encoding matrix V is obtaineda is based on the second sentence encoding a t Get, V s With V a Multiply them together to get the correlation weight matrix β, and apply β to V u Then generate the second dialogue encoding matrix V' u , V u With V' u After merging, subtracting, and bitwise multiplication, the results are input into the bidirectional LSTM model to obtain the global interaction code V m .

[0086] Third, with respect to the human-machine switching prediction part of steps 104-107, the preferred implementation of the embodiment of the present invention is as follows: Figure 6 As shown, the specific steps include:

[0087] Step 401: Determine a dialogue difficulty weight matrix according to the position of the dialogue sentence in the dialogue.

[0088] Specifically, the dialogue difficulty weight matrix is ​​determined by the position of the dialogue sentence in the dialogue based on the attention mechanism, that is, as the number of sentences in the dialogue increases, the difficulty weights of the dialogue sentences at different positions are determined by the attention mechanism model according to the number of dialogue sentences, and then the dialogue difficulty weight matrix is ​​obtained after normalization. It is generally believed that the more dialogue sentences there are, the greater the difficulty of the dialogue. The principle of determining the weight is consistent with the principle of determining the sentence complexity weight in the dialogue sentence mentioned above. The difference is that this step determines the complexity weight for each sentence in the entire dialogue, while the sentence complexity weight is based on the segmentation in the dialogue sentence and the complexity weight of the segmentation at the corresponding position.

[0089] Step 402: multiply the global interaction code by the dialogue difficulty weight matrix to obtain a dialogue comprehensive expression matrix.

[0090] This step is to configure the corresponding complexity weight for each dialogue sentence in the global interaction encoding through the dialogue difficulty weight matrix.

[0091] Step 403: Use a neural network to classify and predict the comprehensive expression matrix of the dialogue to determine whether to switch to manual service.

[0092] Among them, the neural network can process the comprehensive expression matrix of the dialogue by the CRF model, and its output result is the classification prediction result, including switching to manual service and maintaining robot service.

[0093] The above is a preferred implementation of the human-machine switching prediction part. The specific processing flow can be referred to Figure 7 The flowchart shown in Figure 1 shows the global interaction encoding V m and position vector 2 is based on Figure 5 The output result of the bidirectional LSTM model in is obtained. The position vector 2 is the dialogue position vector determined according to the number of dialogue sentences in the dialogue. The attention mechanism model is used to learn the position information expressed by the position vector 2 and determine the dialogue difficulty weight matrix α D , V m With α D After multiplication, the comprehensive expression matrix V of the dialogue is generated D Finally, the CRF model is used to D Perform classification prediction and determine whether to switch robot service to manual service based on the prediction results.

[0094] Through the above Figure 2-7 From the descriptions corresponding to the steps of the illustrated embodiment, it can be seen that a mode switching method for human-computer interaction proposed in an embodiment of the present invention utilizes the complexity of word segmentation in a dialogue sentence and the complexity between dialogue sentences in a dialogue as parameters in a prediction process, so that the dialogue sentences and the sentences have richer expression content, and can more accurately represent the semantic state of the dialogue. At the same time, by analyzing the correlation between sentences, the correlation between dialogue sentences is determined, which is used as a reference condition for judging whether to execute human-computer switching, thereby increasing the accuracy of the prediction.

[0095] The above-mentioned embodiments are applicable to human-computer interaction scenarios in various fields, such as customer service robots in e-commerce platforms, customer service hotlines in the communication field, and robot sales systems in offline retail scenarios. Through the mode switching method proposed in the embodiment of the present invention, it can be ensured that while using the robot dialogue service, the dialogue between the robot and the customer is effectively monitored. When it is found that the robot has difficulties or errors in answering customer questions, it is promptly switched to manual service. In this way, a small number of manual customer service can be used to provide services to a large number of customers, improve customer service efficiency, and avoid the problem of low service satisfaction caused by full robot dialogue.

[0096] Furthermore, as a response to the above Figure 1-7 In order to realize the method shown in the figure, the embodiment of the present invention provides a mode switching device for human-computer interaction. The main purpose of the device is to determine the timing of switching from robot customer service to human customer service by evaluating the complexity of the dialogue process, so as to improve the efficiency and satisfaction of customer service. For the sake of ease of reading, this device embodiment will no longer repeat the details of the aforementioned method embodiment, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. The device is as follows Figure 8 As shown, specifically including:

[0097] An acquisition unit 51 is used to acquire historical dialogue sentences of human-computer interaction, wherein the historical dialogue sentences include a plurality of sentences;

[0098] A sentence encoding unit 52, used to encode the multiple sentences obtained by the acquisition unit 51 respectively to obtain multiple sentence codes;

[0099] A dialogue encoding unit 53, used for obtaining a global interaction encoding according to the multiple sentence encodings obtained by the sentence encoding unit 52;

[0100] A generating unit 54, configured to generate a dialogue position vector according to the global interaction coding obtained by the dialogue coding unit 53;

[0101] A determination unit 55, configured to determine a dialogue difficulty weight according to the dialogue position vector obtained by the generation unit 54;

[0102] A synthesis unit 56, configured to obtain a dialogue comprehensive expression matrix according to the global interaction coding obtained by the dialogue coding unit 53 and the dialogue difficulty weight obtained by the determination unit 55;

[0103] The switching unit 57 is used to determine the switch from machine dialogue to manual dialogue according to the dialogue comprehensive expression matrix obtained by the synthesis unit 56.

[0104] Further, such as Fig. 9 As shown, the sentence encoding unit 52 includes:

[0105] A generating module 521, configured to generate a word vector matrix representing the first sentence according to the word segmentation result of the first sentence and the position of each word segmentation;

[0106] A first determination module 522, configured to determine a first sentence encoding of the first sentence according to a context relationship in the word vector matrix obtained by the generation module 521;

[0107] A second determination module 523, configured to determine a second sentence code of the first sentence according to a sentence complexity weight corresponding to a position of each word segment;

[0108] The encoding module 524 is used to generate a sentence code corresponding to the first sentence according to the first sentence code obtained by the first determining module 522 and the second sentence code obtained by the second determining module 523.

[0109] Further, the second determining module 523 is specifically used for:

[0110] Determine a sentence complexity weight matrix based on the attention mechanism by each word segmentation in the word vector matrix and the position corresponding to the word segmentation;

[0111] The second sentence encoding is determined according to the contextual relationship in the word vector matrix and the sentence complexity weight matrix.

[0112] Furthermore, the encoding module 524 is specifically used for:

[0113] Concatenate the first sentence code and the second sentence code to obtain a concatenated vector;

[0114] The concatenated vector is processed using a feedforward neural network to obtain the sentence encoding.

[0115] Furthermore, the encoding module 524 is also used for:

[0116] Obtaining a role vector of the first sentence and / or a sentiment score of the first sentence obtained based on a sentiment dictionary;

[0117] The role vector and / or sentiment score is concatenated with the first sentence code and the second sentence code to obtain the concatenated vector.

[0118] Further, such as Fig. 9 As shown, the determining unit 53 includes:

[0119] A first generating module 531, configured to obtain a first dialogue encoding matrix according to the plurality of sentence encodings;

[0120] A determination module 532, configured to determine a relevance weight matrix based on the plurality of sentence codes, wherein the relevance weight matrix is ​​used to quantify the relevance between the plurality of sentences;

[0121] A second generation module 533 is used to determine a second dialogue encoding matrix using the first dialogue encoding matrix obtained by the first generation module 531 and the correlation weight matrix obtained by the determination module 532;

[0122] The encoding module 534 is used to determine the global interaction encoding according to the first dialogue encoding matrix obtained by the first generation module 531 and the second dialogue encoding matrix obtained by the second generation module 533.

[0123] Furthermore, the determining module 532 is specifically configured to:

[0124] Using the first sentence codes corresponding to the plurality of sentences, a third dialogue coding matrix is ​​obtained;

[0125] Using the second sentence codes corresponding to the plurality of sentences, a fourth dialogue coding matrix is ​​obtained;

[0126] The relevance weight matrix is ​​generated by using the third dialogue encoding matrix and the fourth dialogue encoding matrix.

[0127] Furthermore, the encoding module 534 is specifically used for:

[0128] Merging the first dialogue encoding matrix with the second dialogue encoding matrix to obtain a first interaction matrix;

[0129] Subtracting the first dialogue encoding matrix from the second dialogue encoding matrix to obtain a second interaction matrix;

[0130] Multiplying the first dialogue encoding matrix and the second dialogue encoding matrix bit by bit to obtain a third interaction matrix;

[0131] The first interaction matrix, the second interaction matrix and the third interaction matrix are encoded by using a neural network to obtain the global interaction code.

[0132] In addition, an embodiment of the present invention further provides a processor, which is used to run a program, wherein when the program is run, the human-computer interaction mode switching method provided by any one of the above embodiments is executed.

[0133] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0134] It is understandable that the related features in the above methods and devices can be referenced to each other. In addition, the "first", "second" and the like in the above embodiments are used to distinguish the embodiments, but do not represent the advantages and disadvantages of the embodiments.

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

[0136] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific languages ​​is for disclosing the preferred embodiment of the present invention.

[0137] In addition, the memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0138] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0139] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0140] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0141] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0142] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0143] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0144] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0145] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0146] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0147] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for switching modes of human-computer interaction, the method comprising: Acquire historical dialogue sentences of human-computer interaction, wherein the historical dialogue sentences include a plurality of sentences; Encoding the multiple sentences respectively to obtain multiple sentence codes; Obtaining a global interaction code according to the multiple sentence codes, wherein the global interaction code is a dialogue code of the historical dialogue sentences, and the global interaction code is obtained based on an input order of the multiple sentences and an association relationship between the multiple sentences; generating a dialogue position vector according to the global interaction code, wherein the dialogue position vector is generated based on positions of the plurality of sentences in the dialogue determined by the global interaction code; Determining a conversation difficulty weight according to the conversation position vector, wherein the conversation difficulty weight is determined based on the length of the conversation position vector; Obtaining a dialogue comprehensive expression matrix according to the global interaction coding and the dialogue difficulty weight, wherein the dialogue comprehensive expression matrix is ​​used to measure the complexity of the human-computer interaction; According to the comprehensive expression matrix of the dialogue, it is determined to switch from machine dialogue to manual dialogue.

2. The method according to claim 1, characterized in that: The multiple statements are encoded respectively to obtain multiple statement codes, including: Generate a word vector matrix representing the first sentence according to the word segmentation result of the first sentence and the position of each word segmentation; Determine a first sentence encoding of the first sentence according to the context relationship in the word vector matrix; Determining a second sentence encoding of the first sentence according to sentence complexity weights corresponding to positions of each word segment; A sentence code corresponding to the first sentence is generated according to the first sentence code and the second sentence code.

3. The method according to claim 2, characterized in that Determining a second sentence encoding of the first sentence according to sentence complexity weights corresponding to positions of each word segmentation includes: Determine a sentence complexity weight matrix based on the attention mechanism by each word segmentation in the word vector matrix and the position corresponding to the word segmentation; The second sentence encoding is determined according to the contextual relationship in the word vector matrix and the sentence complexity weight matrix.

4. The method according to claim 2, characterized in that: Generating a statement code corresponding to the first statement according to the first statement code and the second statement code includes: Concatenate the first sentence code and the second sentence code to obtain a concatenated vector; The concatenated vector is processed using a feedforward neural network to obtain the sentence encoding.

5. The method according to claim 4, characterized in that The first sentence encoding is concatenated with the second sentence encoding to obtain a concatenated vector, including: Obtaining a role vector of the first sentence and / or a sentiment score of the first sentence obtained based on a sentiment dictionary; The role vector and / or sentiment score is concatenated with the first sentence code and the second sentence code to obtain the concatenated vector.

6. The method according to claim 2, characterized in that According to the multiple statement codes, a global interaction code is obtained, including: Obtaining a first dialogue encoding matrix according to the plurality of sentence encodings; Determine a relevance weight matrix based on the plurality of sentence codes, wherein the relevance weight matrix is ​​used to quantify the relevance between the plurality of sentences; Determine a second dialogue encoding matrix using the first dialogue encoding matrix and the relevance weight matrix; The global interaction coding is determined according to the first dialogue coding matrix and the second dialogue coding matrix.

7. The method according to claim 6, characterized in that Determining a relevance weight matrix based on the plurality of sentence codes includes: Using the first sentence codes corresponding to the plurality of sentences, a third dialogue coding matrix is ​​obtained; Using the second sentence codes corresponding to the plurality of sentences, a fourth dialogue coding matrix is ​​obtained; The relevance weight matrix is ​​generated by using the third dialogue encoding matrix and the fourth dialogue encoding matrix.

8. The method according to claim 6, characterized in that Determining the global interaction coding according to the first dialogue coding matrix and the second dialogue coding matrix includes: Merging the first dialogue encoding matrix with the second dialogue encoding matrix to obtain a first interaction matrix; Subtracting the first dialogue encoding matrix from the second dialogue encoding matrix to obtain a second interaction matrix; Multiplying the first dialogue encoding matrix and the second dialogue encoding matrix bit by bit to obtain a third interaction matrix; The first interaction matrix, the second interaction matrix and the third interaction matrix are encoded by using a neural network to obtain the global interaction code.

9. A mode switching device for human-computer interaction, the device comprising: An acquisition unit, used for acquiring historical dialogue sentences of human-computer interaction, wherein the historical dialogue sentences include a plurality of sentences; A sentence encoding unit, used to encode the multiple sentences obtained by the acquisition unit respectively to obtain multiple sentence codes; A dialogue encoding unit, configured to obtain a global interaction code according to the multiple sentence codes obtained by the sentence encoding unit, wherein the global interaction code is a dialogue code of the historical dialogue sentences, and the global interaction code is obtained based on the input order of the multiple sentences and the association relationship between the multiple sentences; a generating unit, configured to generate a dialogue position vector according to the global interaction coding obtained by the dialogue coding unit, wherein the dialogue position vector is generated based on the positions of the multiple sentences in the dialogue determined by the global interaction coding; a determining unit, configured to determine a dialogue difficulty weight according to the dialogue position vector obtained by the generating unit, wherein the dialogue difficulty weight is determined based on the length of the dialogue position vector; A synthesis unit, configured to obtain a dialogue comprehensive expression matrix according to the global interaction encoding obtained by the dialogue encoding unit and the dialogue difficulty weight obtained by the determination unit, wherein the dialogue comprehensive expression matrix is ​​used to measure the complexity of the human-computer interaction; The switching unit is used to determine the switch from machine dialogue to manual dialogue according to the comprehensive dialogue expression matrix obtained by the synthesis unit.

10. A processor, characterized in that: The processor is used to run a program, wherein the program, when running, executes the human-computer interaction mode switching method described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Coding method, device and equipment, and storage medium

    CN110147533A

  • Service method and system of intelligent i-Service customer service robot, terminal

    CN110532552A