Interactive processing method and device
By obtaining interaction historical information and using the intent identification model to determine the interaction intention, combining the matching degree calculation of the intent description words and candidate information database, the problem of mismatch between the response information and the intent in intelligent interaction is solved, and the interaction efficiency and effect are improved.
Patent Information
- Application Number
- CN202011282527.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-16
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2040-11-16
AI Technical Summary
In intelligent interaction, the interaction response information may not match the user's interaction intention, affecting the efficiency and effect of intelligent interaction.
By obtaining interaction history information, using the preset intent recognition model to determine the interaction intention, and generating interaction response information based on the interaction history information and intention, including using intent descriptive words and interaction candidate information database for matching calculation, ensuring the accuracy of the response information .
It improves interaction matching and efficiency, ensures the matching degree of interaction response information with user intentions, and improves the effect and efficiency of intelligent interaction.
Smart Images

Figure CN112347770B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and more specifically, to an interaction processing method, an interaction processing device, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the rapid development of artificial intelligence technology, intelligent interaction has been widely penetrated in different application fields. Intelligent interaction can provide users with efficient interactive services, which is not only conducive to improving the efficiency of business operations based on intelligent interaction, but also conducive to saving the platform's manpower costs for interacting with users.
[0003] In the process of realizing the technical concept of the present invention, the inventors found that in the intelligent interaction of related technologies, the interaction response information used to provide feedback to the user is mostly determined based on the interaction history data of the interaction with the user. This has the problem that the determined interaction response information may not match the user's interaction intention, which not only affects the efficiency of the intelligent interaction, but also affects the effect of the intelligent interaction. Summary of the invention
[0004] In view of this, the present disclosure provides an interaction processing method and device with high interaction matching and effectively improved interaction efficiency.
[0005] One aspect of the present disclosure provides an interaction processing method, including: obtaining interaction history information, the interaction history information including input history information and / or response history information; using a preset intention recognition model to determine the interaction intention of an interaction object indicated by the interaction history information; based on the interaction history information and the interaction intention, determining and outputting interaction response information for feedback to the interaction object.
[0006] Optionally, the above-mentioned determination of interaction response information for feedback to the above-mentioned interaction object based on the above-mentioned interaction history information and the above-mentioned interaction intention includes: determining at least one intent description word associated with the above-mentioned interaction history information according to a preset association relationship between the interaction intention and the intent description word, wherein the above-mentioned association relationship is obtained by training an intent recognition model based on interaction sample data; and determining the above-mentioned interaction response information based on the above-mentioned interaction history information and the above-mentioned at least one intent description word.
[0007] Optionally, the above-mentioned determining the interaction response information based on the above-mentioned interaction history information and the above-mentioned at least one intent descriptor includes: determining an interaction candidate information library associated with the above-mentioned interaction intent, the above-mentioned interaction candidate information library including at least one input candidate information and at least one response candidate information; based on the above-mentioned interaction history information and the above-mentioned at least one intent descriptor, determining the target input candidate information with the highest matching degree with the above-mentioned interaction history information in the above-mentioned interaction candidate information library; and using the response candidate information associated with the above-mentioned target input candidate information as the above-mentioned interaction response information.
[0008] Optionally, the above-mentioned method of determining the target input candidate information with the highest matching degree with the above-mentioned interaction history information in the above-mentioned interaction candidate information library based on the above-mentioned interaction history information and the above-mentioned at least one intention description word includes: for any input candidate information, determining the first matching degree between the above-mentioned interaction history information and the above-mentioned input candidate information; determining the second matching degree between the above-mentioned at least one intention description word and the above-mentioned input candidate information; determining the third matching degree for the above-mentioned input candidate information based on the above-mentioned first matching degree and the above-mentioned second matching degree; repeating the above steps until the third matching degree for each of the above-mentioned input candidate information is determined; and determining the above-mentioned target input candidate information at least based on the third matching degree for each of the above-mentioned input candidate information.
[0009] Optionally, the above-mentioned target input candidate information is determined at least based on the third matching degree for each of the above-mentioned input candidate information, including: for any of the above-mentioned input candidate information, calculating the similarity between the average word vector of the above-mentioned at least one intention description word and the average word vector of the above-mentioned input candidate information, as the fourth matching degree for the above-mentioned input candidate information; calculating the number of intention description words contained in the above-mentioned input candidate information, as the fifth matching degree for the above-mentioned input candidate information; calculating the average similarity between all the constituent words in the above-mentioned input candidate information and the above-mentioned at least one intention description word, as the sixth matching degree for the above-mentioned input candidate information; based on the above-mentioned third matching degree, fourth matching degree, fifth matching degree and sixth matching degree, the above-mentioned target input candidate information is determined.
[0010] Optionally, the above-mentioned interaction response information is determined based on the above-mentioned interaction history information and the above-mentioned at least one intention description word, including: using a preset interaction information generation model to perform an encoding operation based on the above-mentioned interaction history information to obtain an intermediate feature vector; and performing a decoding operation based on the above-mentioned intermediate feature vector and the above-mentioned at least one intention description word to generate the above-mentioned interaction response information.
[0011] Optionally, the training process of the above-mentioned interaction information generation model includes: using the above-mentioned interaction information generation model to perform an encoding operation based on the interaction sample information to obtain a sample intermediate feature vector, the above-mentioned interaction sample information includes sample input information and sample response information, and the above-mentioned interaction sample information has a sample label indicating the interaction intention; performing a decoding operation based on the above-mentioned sample intermediate feature vector to obtain predicted response information; based on the above-mentioned predicted response information and the above-mentioned sample response information, calculating the generation loss of the above-mentioned interaction information generation model; based on the above-mentioned sample label and the interaction intention indicated by the above-mentioned predicted response information, calculating the classification loss of the above-mentioned interaction information generation model; based on the above-mentioned generation loss and the above-mentioned classification loss, determining the total loss of the above-mentioned interaction information generation model to perform model training based on the above-mentioned total loss.
[0012] Another aspect of the present disclosure provides an interaction processing device, including: an acquisition module, used to acquire interaction history information, the above-mentioned interaction history information includes input history information and / or response history information; a first processing module, used to determine the interaction intention of the interaction object indicated by the above-mentioned interaction history information by using a preset intention recognition model; a second processing module, used to determine and output the interaction response information for feedback to the above-mentioned interaction object based on the above-mentioned interaction history information and the above-mentioned interaction intention.
[0013] Optionally, the second processing module includes: a first processing sub-module, used to determine at least one intent description word associated with the above-mentioned interaction history information based on a preset association relationship between the interaction intention and the intent description word, wherein the above-mentioned association relationship is obtained by training the intention recognition model based on the interaction sample data; a second processing sub-module, used to determine the above-mentioned interaction response information based on the above-mentioned interaction history information and the above-mentioned at least one intent description word.
[0014] Optionally, the second processing sub-module includes: a first processing unit, used to determine an interaction candidate information library associated with the above-mentioned interaction intention, the above-mentioned interaction candidate information library including at least one input candidate information and at least one response candidate information; a second processing unit, used to determine the target input candidate information with the highest matching degree with the above-mentioned interaction history information in the above-mentioned interaction candidate information library based on the above-mentioned interaction history information and the above-mentioned at least one intention description word; and a third processing unit, used to use the response candidate information associated with the above-mentioned target input candidate information as the above-mentioned interaction response information.
[0015] Optionally, the second processing unit includes: a first processing sub-unit, used to determine, for any input candidate information, a first matching degree between the interaction history information and the input candidate information; a second processing sub-unit, used to determine a second matching degree between the at least one intention description word and the input candidate information; a third processing sub-unit, used to determine a third matching degree for the input candidate information based on the first matching degree and the second matching degree; repeating the above steps until the third matching degree for each of the input candidate information is determined; and a fourth processing sub-unit, used to determine the target input candidate information at least based on the third matching degree for each of the input candidate information.
[0016] Optionally, the fourth processing sub-unit is specifically used to: for any of the above-mentioned input candidate information, calculate the similarity between the average word vector of the above-mentioned at least one intention description word and the average word vector of the above-mentioned input candidate information, as a fourth matching degree for the above-mentioned input candidate information; calculate the number of intention description words contained in the above-mentioned input candidate information, as a fifth matching degree for the above-mentioned input candidate information; calculate the average similarity between all the constituent words in the above-mentioned input candidate information and the above-mentioned at least one intention description word, as a sixth matching degree for the above-mentioned input candidate information; and determine the above-mentioned target input candidate information based on the above-mentioned third matching degree, fourth matching degree, fifth matching degree and sixth matching degree.
[0017] Optionally, the second processing sub-module includes: a fourth processing unit, used to use a preset interaction information generation model to perform encoding operations based on the interaction history information to obtain an intermediate feature vector; and a fifth processing unit, used to perform decoding operations based on the intermediate feature vector and the at least one intention description word to generate the interaction response information.
[0018] Optionally, the training process of the above-mentioned interaction information generation model includes: using the above-mentioned interaction information generation model to perform an encoding operation based on the interaction sample information to obtain a sample intermediate feature vector, the above-mentioned interaction sample information includes sample input information and sample response information, and the above-mentioned interaction sample information has a sample label indicating the interaction intention; performing a decoding operation based on the above-mentioned sample intermediate feature vector to obtain predicted response information; based on the above-mentioned predicted response information and the above-mentioned sample response information, calculating the generation loss of the above-mentioned interaction information generation model; based on the above-mentioned sample label and the interaction intention indicated by the above-mentioned predicted response information, calculating the classification loss of the above-mentioned interaction information generation model; based on the above-mentioned generation loss and the above-mentioned classification loss, determining the total loss of the above-mentioned interaction information generation model to perform model training based on the above-mentioned total loss.
[0019] Another aspect of the present disclosure provides an electronic device. The electronic device includes at least one processor and a memory connected to the at least one processor. The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor implements the method of the embodiment of the present disclosure.
[0020] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method of the embodiment of the present disclosure when executed.
[0021] Another aspect of the present disclosure provides a computer program, wherein the computer program includes computer executable instructions, and the instructions are used to implement the method of the embodiment of the present disclosure when executed.
[0022] Through the embodiments of the present disclosure, because the interaction history information is obtained, the interaction history information includes input history information and / or response history information; the interaction intention of the interaction object indicated by the interaction history information is determined by using a preset intention recognition model; based on the interaction history information and the interaction intention, the interaction response information for feedback to the interaction object and output is determined. Therefore, the technical problems of poor interaction matching and poor interaction efficiency existing in the related technology are at least partially overcome, thereby achieving the technical effect of effectively improving the interaction matching and interaction efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] For a more complete understanding of the present disclosure and its advantages, reference will now be made to the following description taken in conjunction with the accompanying drawings, in which:
[0024] Figure 1 The interactive processing system architecture according to an embodiment of the present disclosure is schematically shown;
[0025] Figure 2 A flowchart of an interaction processing method according to an embodiment of the present disclosure is schematically shown;
[0026] Figure 3 A flowchart schematically shows another interaction processing method according to an embodiment of the present disclosure;
[0027] Figure 4 A schematic diagram schematically shows a method for determining a third matching degree for a certain candidate input information according to an embodiment of the present disclosure;
[0028] Figure 5 A flowchart of another interaction processing method according to an embodiment of the present disclosure is schematically shown;
[0029] Figure 6 A block diagram of an interaction processing device according to an embodiment of the present disclosure is schematically shown;
[0030] Figure 7 A block diagram of an electronic device suitable for implementing the interaction processing method and apparatus according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0031] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0032] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0033] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0034] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0035] Various embodiments of the present disclosure provide an interaction processing method and an interaction processing device capable of applying the method. The method may include obtaining interaction history information, the interaction history information including input history information and / or response history information, and using a preset intention recognition model to determine the interaction intention of the interaction object indicated by the interaction history information, and then based on the interaction history information and the interaction intention, determine and output interaction response information for feedback to the interaction object.
[0036] like Figure 1As shown, the system architecture 100 includes at least one terminal (a plurality of terminals are shown in the figure, such as terminals 101, 102, and 103) and a server 104. In the system architecture 100, the server 104 obtains interaction history information generated by interacting with an interaction object, the interaction history information includes input history information and / or response history information, and then uses a preset intention recognition model to determine the interaction intention of the interaction object indicated by the interaction history information, and finally determines interaction response information for feedback to the interaction object based on the interaction history information and the interaction intention, and sends the interaction response information to the terminal (such as terminals 101, 102, and 103).
[0037] The present disclosure will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0038] Figure 2 The flowchart schematically shows an interaction processing method according to an embodiment of the present disclosure.
[0039] like Figure 2 As shown, the method may include, for example, operations S210 to S230.
[0040] In operation S210, interaction history information is acquired, where the interaction history information includes input history information and / or response history information.
[0041] In the embodiments of the present disclosure, specifically, the user interacts with the business platform through the terminal to generate interaction data, for example, the user interacts with the intelligent assistant provided by the business platform through the terminal to generate interaction data. The terminal may include, for example, a smart phone, a tablet computer, a portable computer, a desktop computer, a smart watch, a smart speaker, a smart home, etc. The business platform may include, for example, a shopping platform, a food delivery platform, a taxi platform, a machine dialogue platform, etc. The intelligent assistant provided by the business platform may include, for example, a virtual customer service, an intelligent assistant, a dialogue robot, etc.
[0042] The server performing the interaction processing obtains the interaction history information between the user and the service platform, and the interaction history information includes the input history information from the user and the response history information from the service platform. The aforementioned server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. The interaction history information can be in the form of text information, voice information, or other interactive forms of information.
[0043] When obtaining the interaction history information between the user and the business platform, the interaction history information within a preset time period can be obtained in the order of timestamps, starting from the user's interaction input information to be responded to, or a preset amount of interaction history information can be obtained. The interaction history information includes both the input history information from the user and the response history information from the business platform. Determining the interaction response information for feedback to the user based on the interaction history information is conducive to improving the matching degree of the determined interaction response information, and is conducive to improving the intelligent interaction experience and improving the efficiency of intelligent interaction.
[0044] Optionally, before determining the interactive response information for feedback to the user based on the interactive history information, the obtained interactive history information may be preprocessed in the form of deduplication, screening, text replacement, text conversion, etc., so as to convert non-standard information into standard information. Exemplarily, information that does not include text content in the conversation text information is screened out, such as conversation information that only includes punctuation marks or emoticons. Preprocessing the obtained interactive history information is beneficial to reducing the amount of calculation for subsequent data processing on the one hand, and improving the accuracy of the data processing results on the other hand.
[0045] Next, in operation S220, the interaction intention of the interaction object indicated by the interaction history information is determined using a preset intention recognition model.
[0046] In the disclosed embodiment, specifically, the acquired interaction history information is input into a trained intent recognition model, and the interaction history information is recognized and processed using the intent recognition model to obtain the interaction intention of the interaction object indicated by the interaction history information, that is, the interaction intention of the user indicated by the interaction history information. Interaction intentions have fine-grained divisions for different application scenarios and actual needs. For example, in e-commerce applications, for payment scenarios, interaction intentions may include payment method confirmation, discount information consultation, postage inquiry, etc.; for after-sales scenarios, interaction intentions may include logistics information inquiry, return and exchange consultation, product problem feedback, etc.
[0047] When determining the interaction intention of the interaction object indicated by the interaction history information, the intention recognition model is used to encode each interaction history information to obtain a feature vector associated with each interaction history information. The encoding method may include encoding based on a Transformer model (translation model) or encoding based on a Bi-GRU (Bidirectional Gated Recurrent Unit) model.
[0048] For a large number of preset fine-grained interaction intentions, each interaction intention has a corresponding intent label. When determining the interaction intention indicated by the interaction history information, the intent label of the preset interaction intention is vectorized to obtain feature vectors of different intent labels. Then, the similarity between the feature vector of each interaction history information and the feature vector of the intent label is determined, and the preset interaction intention with a similarity higher than a preset threshold is determined as the interaction intention indicated by the mutual history information. Among them, the similarity may include cosine similarity, inverse Euclidean distance, etc., and this embodiment does not limit the specific type of similarity.
[0049] The intent recognition model is trained using a large amount of interaction sample data with classification results, and the classification results of the interaction sample data indicate the interaction intent associated with the interaction sample data. The intent recognition model can be, for example, a HAN (Hieratical Attention Network) model.
[0050] When a large amount of interaction sample data with classification results is used for model training, for any interaction intent, the n words with the highest attention scores in each interaction sample data are annotated using the intent recognition model, and then the n words with the highest attention scores in each interaction sample data are summarized, and the words with the highest frequency of occurrence are determined as the intent description words associated with the interaction intent. The words with the highest frequency of occurrence constitute the intent description word library associated with the interaction intent.
[0051] For example, for the interaction intent of "express delivery information consultation", there are 200,000 interaction sample data associated with the interaction intent. The five words with the highest attention scores in each interaction sample data are annotated using the intention recognition model, and then the five words with the highest attention scores in each of the 200,000 interaction sample data are summarized, and the 100 words with the highest frequency of occurrence are determined as the intention description words associated with the interaction intent. The 100 words with the highest frequency of occurrence constitute the intention description word library associated with the interaction intent of "express delivery information consultation".
[0052] Next, in operation S230, based on the interaction history information and the interaction intention, interaction response information for feeding back to the interaction object is determined and output.
[0053] In an embodiment of the present disclosure, specifically, first, based on a preset association relationship between interaction intent and intent descriptors, at least one intent descriptor associated with the interaction history information is determined, wherein the association relationship is obtained by training an intent recognition model based on interaction sample data, and then, based on the interaction history information and at least one intent descriptor, the interaction response information is determined.
[0054] After the interaction intent indicated by the interaction history information is determined using the intent recognition model, a preset number of intent description words are determined as intent description words associated with the interaction history information according to the intent description word library associated with the interaction intent. Exemplarily, in the intent description word library associated with the interaction intent, 50 intent description words are determined as intent description words associated with the interaction history information. The intent description word library associated with the interaction intent is obtained during the training process of the intent recognition model, which has been specifically described in operation S220 and will not be repeated here.
[0055] Based on the interaction history information and the interaction intention indicated by the interaction history information, specifically, based on the interaction history information and at least one intention description word associated with the interaction history information, the interaction response information used to feed back to the interaction object is determined and output. This is conducive to ensuring that the output interaction response information matches the user's interaction intention, which is not only conducive to improving the self-service interaction effect, but also conducive to improving the self-service interaction efficiency.
[0056] In the disclosed embodiment, by acquiring interaction history information, wherein the interaction history information includes input history information and / or response history information, and using a preset intention recognition model, the interaction intention of the interaction object indicated by the interaction history information is determined, and then based on the interaction history information and the interaction intention, the interaction response information for feedback to the interaction object is determined and output. Based on the acquired interaction history information and the interaction intention indicated by the interaction history information, the interaction response information for feedback to the interaction object is determined, which is conducive to improving the matching degree of the output interaction response information at the interaction intention level; by accurately matching the interaction input information and providing highly accurate interaction response information, it can not only effectively improve the efficiency of intelligent interaction, but also help improve the effect of intelligent interaction.
[0057] Figure 3 The flowchart schematically shows another interaction processing method according to an embodiment of the present disclosure.
[0058] like Figure 3 As shown, operation S230 may specifically include operations S310 to S330.
[0059] In operation S310, an interaction candidate information library associated with an interaction intention is determined, where the interaction candidate information library includes at least one input candidate information and at least one response candidate information.
[0060] In the disclosed embodiment, specifically, after determining the interaction intention indicated by the interaction history information, an interaction candidate information library associated with the interaction intention is determined, and the interaction candidate information library includes at least one input candidate information and at least one response candidate information. The interaction candidate information library can be, for example, a standard question and answer library, which includes at least one standard question text and at least one standard answer text, and the standard question text can include, for example, "What is the freight of xx Express?"
[0061] In the above process, for each interaction intent, the interaction candidate information associated with each interaction intent can be stored in a key-value manner. Specifically, the interaction candidate information associated with each interaction intent is stored with the intent label of the interaction intent as the key name and the interaction candidate information as the key value. Multiple interaction candidate information associated with the interaction intent constitute an interaction candidate information library associated with the interaction intent.
[0062] Next, in operation S320, based on the interaction history information and at least one intention description word, target input candidate information having the highest matching degree with the interaction history information is determined in the interaction candidate information library.
[0063] In the embodiments of the present disclosure, specifically, for any input candidate information, a first degree of match between the interaction history information and the input candidate information is determined; a second degree of match between at least one intent description word and the input candidate information is determined; based on the first degree of match and the second degree of match, a third degree of match for the input candidate information is determined; the above steps are repeated until the third degree of match for each input candidate information is determined; and the target input candidate information is determined at least based on the third degree of match for each input candidate information.
[0064] The interaction history information includes at least one input history information and / or at least one response history information. For any input candidate information in the interaction candidate information library, when determining the first matching degree between the interaction history information and the input candidate information, the first matching degree between each piece of interaction history information and the input candidate information is determined. Exemplarily, the interaction history information includes 3 historical question texts A1, A2, and A3 from users, and 2 historical question texts Q1 and Q2 from virtual customer service. For the input candidate information "How much is the freight for xx express delivery", the first matching degrees between A1, A2, A3, Q1, and Q2 and the input candidate information are determined respectively. The method for determining the first matching degree may, for example, include determining the similarity between the feature vector of the interaction history information and the feature vector of the input candidate information.
[0065] In addition, it is necessary to determine the second matching degree between at least one intention descriptor associated with the interaction history information and each input candidate information in the interaction candidate information library. For any input candidate information, at least one intention descriptor can be used as additional interaction input information to determine the feature vector of the interaction input information composed of at least one intention descriptor. Then, determine the similarity between the feature vector of this "additional" interaction input information and the feature vector of the input candidate information to obtain the second matching degree between at least one intention descriptor and the input candidate information.
[0066] For any input candidate information, after determining the first matching degree between each interaction history information and the input candidate information, and determining the second matching degree between at least one intention description word and the input candidate information, the first matching degree and the second matching degree are aggregated using the matching matrix to obtain a third matching degree for the input candidate information. Repeat the above operation to determine the third matching degree for each input candidate information, and then based on the third matching degree for each input candidate information, determine the input candidate information with the highest third matching degree as the target input candidate information.
[0067] Figure 4 The following is a schematic diagram of a method for determining a third matching degree for a certain candidate input information according to an embodiment of the present disclosure. Figure 4 As shown, the interaction history information obtained includes A1, Q1, A2, Q2, and A3. For any input candidate information, the first matching degrees p1, p2, p3, p4, and p5 between A1, Q1, A2, Q2, and A3 and the input candidate information are determined respectively. At the same time, at least one intention description word is used as additional interaction input information, and based on the feature vector associated with the interaction input information, the second matching degree p6 between at least one description word and the input candidate information is determined. Then, based on the first matching degrees p1, p2, p3, p4, and p5 and the second matching degree p6, the matching matrix is used to determine the third matching degree for the candidate input information. After determining the third matching degree for each candidate input information, the candidate input information with the highest third matching degree is determined as the target candidate input information.
[0068] In addition to determining the target input candidate information based on the third matching degree for each input candidate information, multiple matching degrees can be integrated through an integration method, and then the target input candidate information is determined based on the integrated matching degree. Specifically, for any input candidate information, the similarity between the average word vector of at least one intention description word and the average word vector of the input candidate information is calculated as the fourth matching degree for the input candidate information; the number of intention description words contained in the input candidate information is calculated as the fifth matching degree for the input candidate information; the average similarity between all the constituent words in the input candidate information and at least one intention description word is calculated as the sixth matching degree for the input candidate information; based on the third matching degree, the fourth matching degree, the fifth matching degree and the sixth matching degree, the target input candidate information is determined.
[0069] The average similarity between all the constituent words in the input candidate information and at least one intent description word is the average similarity of all the constituent words, which is specifically obtained by averaging the similarities of all the constituent words. When calculating the similarity of a certain constituent word, the similarity between the constituent word and each intent description word is calculated, and the maximum similarity therebetween is determined as the similarity of the constituent word. After obtaining the fourth, fifth, and sixth matching degrees, the matching degrees including the third matching degree can be integrated using integration methods such as Xgboost to obtain the integrated matching degree for each input candidate information, and then the input candidate information with the highest integrated matching degree is determined as the target input candidate information.
[0070] Next, in operation S330, the response candidate information associated with the target input candidate information is output as interactive response information.
[0071] In an embodiment of the present disclosure, specifically, after determining the target input candidate information that has the highest match with the historical interaction information and at least one intended keyword, the response candidate information associated with the target input candidate information is output as interaction response information for feedback to the interaction object.
[0072] By combining and determining the second matching degree between at least one intention description word and each input candidate information, the target input candidate information with the highest matching degree is retrieved from the interaction candidate information library. The response candidate information associated with the target input candidate information naturally has the highest matching degree with the interaction history information and the interaction intention indicated by the interaction history information, which effectively improves the matching accuracy of the output interaction response information and the interaction intention of the interaction object, which is conducive to improving the efficiency of intelligent interaction with the interaction object and improving the intelligent interaction effect.
[0073] Figure 5 The flowchart of another interaction processing method according to an embodiment of the present disclosure is schematically shown.
[0074] like Figure 5As shown, operation S230 may specifically include operations S510 to S520.
[0075] In operation S510, a preset interaction information generation model is used to perform an encoding operation based on interaction history information to obtain an intermediate feature vector.
[0076] In the embodiments of the present disclosure, specifically, the preset interaction information generation model can be, for example, a sequence-to-sequence model, and the interaction information generation model is used to perform encoding operations based on interaction history information, which can specifically include: first traversing each character in the interaction history information, and when the interaction history information includes multiple input history information and multiple response history information, traversing the characters in each input history information and each response history information. Each character in the interaction history information is used as the input of the corresponding encoding moment in turn. In addition, the input of each encoding moment also includes the hidden state output at the adjacent previous encoding moment. Similarly, a hidden state will also be output at this encoding moment, and the hidden state output at this encoding moment will also be used as the input of the adjacent next encoding moment. For the seq2seq model, the hidden state output at the last encoding moment is usually retained as the intermediate feature vector obtained by the encoding operation based on the interaction history information. The intermediate feature vector can be considered to encode the semantic information of the interaction history information.
[0077] Next, in operation S520, a decoding operation is performed based on the intermediate feature vector and at least one intention description word to generate and output interactive response information.
[0078] In the disclosed embodiment, specifically, the intermediate feature vector is used as the initial hidden state of the first decoding moment, that is, the hidden state output at the last encoding moment is used as the initial hidden state of the first decoding moment. The characters and hidden states are output at each decoding moment of the neural network model, and the characters and hidden states output at the previous decoding moment are used as input to the next adjacent decoding moment. In addition, in order to improve the matching degree between the generated interactive response information and the interactive intention of the interactive object, the average word vector of at least one intention description word is determined, and the average word vector is used as the representation vector of at least one intention description word, and input into each decoding moment. Repeat the above operation until the decoding outputs the EOS token, and the characters output at each decoding moment constitute the interactive response information.
[0079] Optionally, an attention mechanism can be introduced to solve the problem of poor encoding effect when the input sentence is long. Specifically, when performing the decoding calculation at time t, in addition to taking the characters and hidden states output at the previous decoding moment and the representation vector of at least one intent description word as input, the inputs of all moments in the encoding calculation can also be weighted to obtain a context vector, and then the context vector is used as the input of each decoding moment at the same time, so as to generate interactive response information that matches the interactive intent well.
[0080] The interactive information generation model is a pre-trained model. During the training process of the interactive information generation model, the interactive information generation model can be used to perform encoding operations based on interactive sample information to obtain sample intermediate feature vectors, where the interactive sample information includes sample input information and sample response information, and the interactive sample information has a sample label indicating the interactive intention; perform decoding operations based on the sample intermediate feature vector to obtain predicted response information; calculate the generation loss of the interactive information generation model based on the predicted response information and the sample response information; calculate the classification loss of the interactive information generation model based on the sample label and the interactive intention indicated by the predicted response information; determine the total loss of the interactive information generation model based on the generation loss and the classification loss to perform model training based on the total loss.
[0081] Specifically, when using the interactive information generation model to generate interactive response information, p(yt) represents the probability of generating a certain word at time t, Emb(yt) represents the word vector of the word, and Ewe(t; C, z) represents the expected vector value of the generated word at time t:
[0082]
[0083] Among them, p(yt) is the probability of generating a word in the dictionary, which can be obtained by the decoder training of the interactive information generation model, and V represents the preset common dictionary. According to the sample response information and the expected vector value Ewe(t; C, z) of the generated word at each moment, the generation loss L of the interactive information generation model can be determined CE .
[0084] The expected vector values of the generated words at all times are accumulated and averaged, and then the softmax activation function is used to obtain q(z|Y), which represents the probability of the intention of generating the sentence:
[0085]
[0086] p(z) represents the intention of the expected generated sentence (which can be determined by the sample label of the interactive sample information), q(z|Y) represents the probability of the intention of the actual generated sentence, and the classification loss of the interactive information generation model can be expressed as:
[0087] L CLS=-p(z)log q(z|Y)
[0088] Based on the generation loss L CE and classification loss L CLS , we can determine the total loss of the mutual information generation model L = L CE +μL CLS , μ is a definable variable, generating loss L CE and classification loss L CLS Will work together to generate interactive response information.
[0089] Figure 6 The block diagram of the interaction processing device according to the embodiment of the present disclosure is schematically shown.
[0090] like Figure 6 As shown, the device may include an acquisition module 601 , a first processing module 602 , and a second processing module 603 .
[0091] Specifically, the acquisition module 601 is used to acquire interaction history information, which includes input history information and / or response history information; the first processing module 602 is used to determine the interaction intention of the interaction object indicated by the interaction history information using a preset intention recognition model; the second processing module 603 is used to determine and output the interaction response information for feedback to the interaction object based on the interaction history information and the interaction intention.
[0092] In the disclosed embodiment, by acquiring interaction history information, wherein the interaction history information includes input history information and / or response history information, and using a preset intention recognition model, the interaction intention of the interaction object indicated by the interaction history information is determined, and then based on the interaction history information and the interaction intention, the interaction response information for feedback to the interaction object is determined and output. Based on the acquired interaction history information and the interaction intention indicated by the interaction history information, the interaction response information for feedback to the interaction object is determined, which is conducive to improving the matching degree of the output interaction response information at the interaction intention level; by accurately matching the interaction input information and providing highly accurate interaction response information, it can not only effectively improve the efficiency of intelligent interaction, but also help improve the effect of intelligent interaction.
[0093] As an optional embodiment, the second processing module includes: a first processing sub-module, used to determine at least one intent description word associated with the interaction history information based on a preset association relationship between the interaction intent and the intent description word, wherein the association relationship is obtained by training the intent recognition model based on the interaction sample data; a second processing sub-module, used to determine the interaction response information based on the interaction history information and at least one intent description word.
[0094] As an optional embodiment, the second processing submodule includes: a first processing unit, used to determine an interaction candidate information library associated with the interaction intention, the interaction candidate information library including at least one input candidate information and at least one response candidate information; a second processing unit, used to determine the target input candidate information with the highest matching degree with the interaction history information in the interaction candidate information library based on the interaction history information and at least one intent description word; and a third processing unit, used to use the response candidate information associated with the target input candidate information as the interaction response information.
[0095] As an optional embodiment, the second processing unit includes: a first processing sub-unit, used to determine, for any input candidate information, a first matching degree between the interaction history information and the input candidate information; a second processing sub-unit, used to determine a second matching degree between at least one intent description word and the input candidate information; a third processing sub-unit, used to determine a third matching degree for the input candidate information based on the first matching degree and the second matching degree; repeating the above steps until the third matching degree for each input candidate information is determined; and a fourth processing sub-unit, used to determine the target input candidate information based at least on the third matching degree for each input candidate information.
[0096] As an optional embodiment, the fourth processing sub-unit is specifically used to: for any input candidate information, calculate the similarity between the average word vector of at least one intent description word and the average word vector of the input candidate information as the fourth matching degree for the input candidate information; calculate the number of intent description words contained in the input candidate information as the fifth matching degree for the input candidate information; calculate the average similarity between all constituent words in the input candidate information and at least one intent description word as the sixth matching degree for the input candidate information; determine the target input candidate information based on the third matching degree, the fourth matching degree, the fifth matching degree and the sixth matching degree.
[0097] As an optional embodiment, the second processing sub-module includes: a fourth processing unit, used to use a preset interaction information generation model to perform encoding operations based on interaction history information to obtain an intermediate feature vector; and a fifth processing unit, used to perform decoding operations based on the intermediate feature vector and at least one intent description word to generate interaction response information.
[0098] As an optional embodiment, the training process of the interaction information generation model includes: using the interaction information generation model to perform an encoding operation based on the interaction sample information to obtain a sample intermediate feature vector, the interaction sample information includes sample input information and sample response information, and the interaction sample information has a sample label indicating the interaction intention; performing a decoding operation based on the sample intermediate feature vector to obtain predicted response information; calculating the generation loss of the interaction information generation model based on the predicted response information and the sample response information; calculating the classification loss of the interaction information generation model based on the sample label and the interaction intention indicated by the predicted response information; determining the total loss of the interaction information generation model based on the generation loss and the classification loss to perform model training based on the total loss.
[0099] Optionally, any one of the modules and submodules in the acquisition module 601, the first processing module 602 and the second processing module 603, or at least part of the functions of any one of them can be implemented in one module. According to any one or more of the modules of the embodiments of the present disclosure, it can be split into multiple modules for implementation. According to any one or more of the modules of the embodiments of the present disclosure, it can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware of any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware and firmware or in any appropriate combination of any of them. Or according to one or more of the modules of the embodiments of the present disclosure, it can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be performed.
[0100] Figure 7 A block diagram of an electronic device suitable for implementing the interaction processing method and apparatus according to an embodiment of the present disclosure is schematically shown. Figure 7 The computer system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0101] like Figure 7As shown, the computer system 700 according to the embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include an onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.
[0102] In RAM 703, various programs and data required for the operation of system 700 are stored. Processor 701, ROM 702 and RAM 703 are connected to each other through bus 704. Processor 701 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 702 and / or RAM 703. It should be noted that the program can also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0103] Optionally, the system 700 may further include an input / output (I / O) interface 705, which is also connected to the bus 704. The system 700 may further include one or more of the following components connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 706 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0104] Optionally, the method flow according to the embodiment of the present disclosure can be implemented as a computer software program. For example, the embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. Optionally, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0105] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0106] Alternatively, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as but not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device. For example, optionally, the computer-readable storage medium may include the ROM 702 and / or RAM 703 described above and / or one or more memories other than ROM 702 and RAM 703.
[0107] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0108] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0109] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. An interactive processing method, comprising: Acquiring interaction history information, where the interaction history information includes input history information and / or response history information; Determine the interaction intention of the interaction object indicated by the interaction history information by using a preset intention recognition model; Based on the interaction history information and the interaction intention, determining and outputting interaction response information for feedback to the interaction object, wherein the method includes: determining at least one intention description word associated with the interaction history information according to a preset association relationship between the interaction intention and the intention description word; and determining the interaction response information based on the interaction history information and the at least one intention description word, including: Determine an interaction candidate information library associated with the interaction intention, wherein the interaction candidate information library includes at least one input candidate information and at least one response candidate information; Based on the interaction history information and the at least one intention descriptor, determining the target input candidate information with the highest matching degree with the interaction history information in the interaction candidate information library, including: for any input candidate information, determining a first matching degree between the interaction history information and the input candidate information; using the at least one intention descriptor as additional interaction input information, determining a second matching degree between the at least one intention descriptor and the input candidate information; determining a third matching degree for the input candidate information based on the first matching degree and the second matching degree; repeating the above steps until the third matching degree for each input candidate information is determined; determining the target input candidate information based at least on the third matching degree for each input candidate information; The response candidate information associated with the target input candidate information is used as the interactive response information.
2. The method according to claim 1, wherein: The association relationship is obtained by training the intention recognition model based on the interaction sample data.
3. The method according to claim 1, wherein: The determining the target input candidate information at least based on the third matching degree for each of the input candidate information includes: For any of the input candidate information, calculating the similarity between the average word vector of the at least one intention description word and the average word vector of the input candidate information as a fourth matching degree for the input candidate information; Calculating the number of intention description words contained in the input candidate information as a fifth matching degree for the input candidate information; Calculating an average similarity between all constituent words in the input candidate information and the at least one intention description word as a sixth matching degree for the input candidate information; The target input candidate information is determined based on the third matching degree, the fourth matching degree, the fifth matching degree, and the sixth matching degree.
4. The method according to claim 1, wherein: The determining the interaction response information based on the interaction history information and the at least one intention description word includes: Using a preset interactive information generation model, performing an encoding operation based on the interactive history information to obtain an intermediate feature vector; and A decoding operation based on the intermediate feature vector and the at least one intention description word is performed to generate the interactive response information.
5. The method according to claim 4, in the training process of the interaction information generation model, comprises: Using the interaction information generation model, performing an encoding operation based on the interaction sample information to obtain a sample intermediate feature vector, wherein the interaction sample information includes sample input information and sample response information, and the interaction sample information has a sample label indicating an interaction intention; Performing a decoding operation based on the intermediate feature vector of the sample to obtain predicted response information; Calculating a generation loss of the interaction information generation model based on the predicted response information and the sample response information; Calculating the classification loss of the interaction information generation model based on the sample label and the interaction intention indicated by the predicted response information; Based on the generation loss and the classification loss, a total loss of the mutual information generation model is determined to perform model training based on the total loss.
6. An interactive processing device, comprising: An acquisition module, used to acquire interaction history information, wherein the interaction history information includes input history information and / or response history information; A first processing module, configured to determine the interaction intention of the interaction object indicated by the interaction history information by using a preset intention recognition model; a second processing module, configured to determine and output interaction response information for feedback to the interaction object based on the interaction history information and the interaction intention, wherein the second processing module comprises: a first processing submodule, configured to determine at least one intention description word associated with the interaction history information according to a preset association relationship between the interaction intention and the intention description word; a second processing submodule, configured to determine interaction response information based on the interaction history information and the at least one intention description word, wherein the second processing submodule comprises: A first processing unit, configured to determine an interaction candidate information library associated with an interaction intention, wherein the interaction candidate information library includes at least one input candidate information and at least one response candidate information; a second processing unit, for determining, in the interaction candidate information library, the target input candidate information with the highest matching degree with the interaction history information based on the interaction history information and at least one intention descriptor, wherein the second processing unit comprises: a first processing sub-unit, for determining, for any input candidate information, a first matching degree between the interaction history information and the input candidate information; a second processing sub-unit, for determining, using the at least one intention descriptor as additional interaction input information, a second matching degree between the at least one intention descriptor and the input candidate information; a third processing sub-unit, for determining, based on the first matching degree and the second matching degree, a third matching degree for the input candidate information; repeating the above steps until the third matching degree for each input candidate information is determined; a fourth processing sub-unit, for determining the target input candidate information based at least on the third matching degree for each input candidate information; The third processing unit is configured to use the response candidate information associated with the target input candidate information as the interactive response information.
7. An electronic device comprising: one or more processors; as well as a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Information interaction method and device, electronic device and storage medium
CN111611358A