Providing responses in automated chat
Through the matching model based on transfer memory and a multi-task framework, the emotional representation of the chat robot is optimized, combined with external factors and predefined personality, the problem of large emotional fluctuations in automatic chat is solved, and the semantic and emotional fluency is achieved. Users are emotionally empathetic.
Patent Information
- Application Number
- CN201911036507.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-10-29
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2039-10-29
AI Technical Summary
Existing chatbots fail to effectively consider emotional changes in automatic chat, resulting in the selected candidates' response to emotional fluctuations and lack of semantic and emotional fluency.
Using a matching model based on transfer memory, combining multi-task frameworks and affective classification tasks, optimizes the emotional representation of context and candidate responses, and considers external factors and predefined personality, fuses through multimodal inputs to generate semantic and emotionally consistent response.
It provides a smoother and more natural response to semantic and emotional response, improves the correlation score in the chat stream, and realizes empathy and positive orientation with the user's emotional state.
Smart Images

Figure CN112750430B_ABST
Abstract
Description
Background Art
[0001] Artificial intelligence (AI) chatbots are becoming more and more popular and are being used in more and more scenarios. Chatbots are designed to simulate human speech and can chat with users through text, voice, images, etc. Generally, chatbots can recognize the language content within a message input by a user or apply natural language processing to the message, and then provide a response to the message to the user. Summary of the invention
[0002] This summary is provided to introduce a set of concepts that will be further described in the following detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
[0003] Embodiments of the present disclosure provide a method and apparatus for providing a response in an automatic chat. A message may be obtained in a chat stream. A context associated with the message may be determined, the context comprising a set of utterances, the set of utterances comprising the message. For each candidate response in a set of candidate responses, the candidate response may be scored based at least on information changes between the set of utterances and adjacent utterances in the candidate response. The candidate response with the highest score in the set of candidate responses may be provided in the chat stream.
[0004] It should be noted that one or more of the above aspects include the features specifically pointed out in the following detailed description and claims. The following description and drawings set forth in detail certain illustrative features of the one or more aspects. These features are merely indicative of the various ways in which the principles of various aspects may be implemented, and the present disclosure is intended to include all such aspects and their equivalents. BRIEF DESCRIPTION OF THE DRAWINGS
[0005] The disclosed aspects will be described below in conjunction with the accompanying drawings, which are provided to illustrate rather than limit the disclosed aspects.
[0006] Figure 1 An exemplary application scenario of a chatbot according to an embodiment of the present disclosure is shown.
[0007] Figure 2 An exemplary chat window according to an embodiment of the present disclosure is shown.
[0008] Figure 3 An exemplary process for obtaining a comprehensive relevance score according to an embodiment of the present disclosure is shown.
[0009] Figure 4 An exemplary valence-arousal model according to an embodiment of the present disclosure is shown.
[0010] Figure 5 An exemplary process for generating an initial representation according to an embodiment of the present disclosure is shown.
[0011] Figure 6 An exemplary process for generating an interaction representation according to an embodiment of the present disclosure is shown.
[0012] Figure 7 An exemplary process for semantic matching according to an embodiment of the present disclosure is shown.
[0013] Figure 8 An exemplary process for emotion matching according to an embodiment of the present disclosure is shown.
[0014] Fig. 9 An exemplary process of performing aggregation according to an embodiment of the present disclosure is shown.
[0015] Fig.10 An exemplary chat flow and associated sentiment flow according to an embodiment of the present disclosure are shown.
[0016] Fig.11 An exemplary process for training a transfer memory-based matching model according to an embodiment of the present disclosure is shown.
[0017] Fig.12 An exemplary process of optimizing sentiment representation by using a dialogue corpus according to an embodiment of the present disclosure is shown.
[0018] Fig.13 An exemplary process of optimizing sentiment representation using a sentence corpus according to an embodiment of the present disclosure is shown.
[0019] Fig.14 An exemplary process for generating additional emotion representations according to an embodiment of the present disclosure is shown.
[0020] Fig.15 An exemplary process for inserting additional emotion representations according to an embodiment of the present disclosure is shown.
[0021] Fig.16 An exemplary process of combining multimodal inputs through an early fusion strategy according to an embodiment of the present disclosure is shown.
[0022] Fig.17 An exemplary process of combining multimodal inputs through a late fusion strategy according to an embodiment of the present disclosure is shown.
[0023] Fig.18 An exemplary scenario of expressing a corresponding emotional state through lighting according to an embodiment of the present disclosure is shown.
[0024] Fig.19is a flowchart of an exemplary method for providing a response in an automated chat according to an embodiment of the present disclosure.
[0025] Fig. 20 An exemplary apparatus for providing a response in an automated chat according to an embodiment of the present disclosure is shown.
[0026] Fig.21 An exemplary apparatus for providing a response in an automated chat according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0027] The present disclosure will now be discussed with reference to various exemplary embodiments. It should be understood that the discussion of these embodiments is only for enabling those skilled in the art to better understand and thereby implement the embodiments of the present disclosure, and does not teach any limitation on the scope of the present disclosure.
[0028] Typically, a chatbot can conduct an automated chat in a session with a user. In this article, a "session" may refer to a time-continuous conversation between two chat participants. When conducting an automated chat, the chatbot may receive messages from a user and reply by selecting a candidate response from a set of candidate responses stored in its associated database. When selecting candidate responses, current chatbots typically score the relevance of each candidate response to the message in the chat stream and provide the user with the candidate response with the highest score. Since the emotional changes in the chat stream are not taken into account during the scoring process, the candidate responses finally selected may be emotionally volatile.
[0029] Embodiments of the present disclosure provide a method and apparatus for providing a response in an automatic chat. According to embodiments of the present disclosure, after a message is obtained in a chat stream, a context associated with the message can be determined, and a context-related and fluent response can be provided in terms of both semantics and emotion. In this article, context refers to all received messages and sent responses in the current session, that is, the session in which the latest received message is located, and may include the latest received message itself.
[0030] In one aspect, an embodiment of the present disclosure proposes a transfer memory-based matching model that can model semantic changes and emotional changes in a chat stream and consider these changes when selecting candidate responses, thereby providing responses that are more semantically and emotionally fluent and natural.
[0031] In another aspect, embodiments of the present disclosure propose to use a multi-task framework to optimize the sentiment representation of context and candidate responses through an additional sentiment classification task. A training corpus with sentiment annotations can be used to perform the additional sentiment classification task.
[0032] In another aspect, the disclosed embodiment proposes to train a transfer memory-based matching model for a predefined personality, thereby obtaining a chat robot with the predefined personality. The speaker's personality can be associated with the range of his or her emotional changes in speech. The transfer memory-based matching model can be trained based on the emotional change range constraints associated with the predefined personality.
[0033] In another aspect, the embodiments of the present disclosure propose to consider external factors that affect the emotional state when selecting candidate responses, such as weather, health status, whether good things happen, whether bad things happen, etc. The basic emotional state can be determined based on the external factors, and the emotional state of the selected response is consistent with the basic emotional state determined based on the external factors, and is relevant and fluent to the context in the current conversation.
[0034] In another aspect, the transfer memory-based matching model proposed in the embodiments of the present disclosure can support multimodal input. Inputs of different modes for a specific utterance can be converted into corresponding representations respectively. These representations can be combined together through a variety of fusion strategies.
[0035] In another aspect, the embodiments of the present disclosure propose that the response can be presented based on the emotional state of the selected candidate response, and the emotional state of the selected candidate response can also be expressed by additionally providing other multimodal signals.
[0036] On the other hand, the embodiments of the present disclosure propose that empathy can be achieved between the chatbot and the user, and the user can be guided to achieve a positive emotional state.
[0037] Figure 1 An exemplary application scenario 100 of a chatbot according to an embodiment of the present disclosure is shown. In scenario 100, a network 110 is applied to interconnect between a terminal device 120 and a chatbot server 130. The network 110 may be any type of network capable of interconnecting network entities. The network 110 may be a single network or a combination of various networks. In terms of coverage, the network 110 may be a local area network (LAN), a wide area network (WAN), etc. In terms of carrier media, the network 110 may be a wired network, a wireless network, etc. In terms of data exchange technology, the network 110 may be a circuit switching network, a packet switching network, etc.
[0038] The terminal device 120 may be any type of electronic computing device that can connect to the network 110, access a server or website on the network 110, process data or signals, etc. For example, the terminal device 120 may be a desktop computer, a laptop computer, a tablet computer, a smart phone, etc. Figure 1Only one terminal device 120 is shown in FIG. 1 , but it should be understood that a different number of terminal devices may be connected to the network 110 .
[0039] The terminal device 120 may include a chatbot client 122 that can provide an automatic chat service for a user. In some embodiments, the chatbot client 122 may interact with the chatbot server 130 and present the information and response provided by it to the user. For example, the chatbot client 122 may send a message input by a user to the chatbot server 130 and receive a response related to the message from the chatbot server 130. However, it should be understood that in other embodiments, the chatbot client 122 may also locally generate a response to the message input by the user instead of interacting with the chatbot server 130.
[0040] The chat robot server 130 can automatically chat with the user of the terminal device 120. The corpus used for the automatic chat can be stored in a chat robot database 132 to which the chat robot server 130 is connected or included.
[0041] It should be understood that Figure 1 All network entities in the example are exemplary, and any other network entities may be involved in the application scenario 100 according to specific application requirements.
[0042] Figure 2 An exemplary chat window 200 according to an embodiment of the present disclosure is shown. The chat window 200 may include a rendering area 210, a control area 220, and an input area 230. The rendering area 210 displays messages and responses in the chat stream. The control area 220 includes a plurality of virtual buttons for the user to use to perform message input settings. For example, the user can choose to perform voice input, attach image files, select emoticons, take screenshots of the current screen, etc. through the control area 220. The input area 230 is used for the user to input messages. For example, the user can type text through the input area 230. The chat window 200 may also include a virtual button 240 for confirming the sending of the input message. If the user touches the virtual button 240, the message entered in the input area 230 may be sent to the rendering area 210.
[0043] It should be noted that Figure 2 All units and their layouts are examples. Figure 2 The chat window in the can omit or add any unit, and Figure 2 The layout of the cells in the chat window can also be changed in various ways.
[0044] According to an embodiment of the present disclosure, when conducting automatic chatting, the chat robot can obtain messages in the chat stream, such as the latest message received from the user, and determine the context associated with the message. The context may include all received messages and sent responses in the current session, and may include the latest received message itself. In this article, the messages received and the responses sent by the chat robot are collectively referred to as utterances. Therefore, the context may include a group of utterances. The chat robot may also obtain a group of candidate responses from a database to which it is connected or contained, and for each candidate response in the group of candidate responses, score the correlation between the candidate response and the context, thereby obtaining a comprehensive correlation score corresponding to the candidate response. Subsequently, the chat robot may provide the candidate response with the highest comprehensive correlation score in the group of candidate responses in the chat stream.
[0045] Figure 3 An exemplary process 300 for obtaining a comprehensive relevance score according to an embodiment of the present disclosure is shown. The process 300 may be performed by, for example Figure 1 The chatbot server 130 executes.
[0046] After obtaining a message in the chat stream, the chatbot server can determine the context associated with the message, e.g. Figure 3 The context 302 in the chatbot server may include all received and sent utterances in the conversation in which the message is located, such as utterances 302-1, 302-2, 302-3, ..., 302-n, where utterance 302-n may be a message currently obtained from the chat stream. In addition, the chatbot server may also obtain from a database connected to or included in the chatbot server, such as Figure 1 , a candidate response set 304 is obtained from the chatbot database 132 in the example, which may include multiple candidate responses, such as candidate response 306. The exemplary process for obtaining the comprehensive relevance score of the candidate response 306 is described below by taking the candidate response 306 as an example. The context 302 and the candidate response 306 may be provided to a transfer memory-based matching model 308. The transfer memory-based matching model 308 may, for example, include an initial representation generation part 310, an interaction representation generation part 312, a matching part 314, and an aggregation part 316.
[0047] At the initial representation generating portion 310, an initial representation of the context 302 and an initial representation of the candidate response 306 may be generated. Herein, the initial representation refers to a representation generated based on a representation of each utterance in the context or the candidate response.
[0048] The representation of each utterance may include a semantic representation and / or an emotional representation. The emotional representation may be generated based on various emotional state representation methods. In one embodiment, the emotional state may be represented by a valence-arousal (VA) model. Figure 4 An exemplary VA model 400 according to an embodiment of the present disclosure is shown. The VA model 400 maps emotional features to a two-dimensional space, which is defined by two orthogonal dimensions such as valence and arousal. Valence can represent the polarity of emotions, such as negative emotions and positive emotions, and the degree is indicated by continuous numerical values ranging, for example, between [-1,0] and [0,1], respectively. Arousal can indicate the energy of the emotion, and the degree is indicated by continuous numerical values ranging, for example, between [0,1]. Almost all human emotional states can be mapped to points defined based on valence value-arousal value pairs (VA pairs) in this two-dimensional space. Figure 4 4 exemplary emotional states are shown in VA model 400, such as “happy”, “contented”, “nervous”, and “sad”. The emotional state “happy” can be mapped to point 402 in VA model 400, for example, and its VA pair is (0.8, 0.6). The emotional state “contented” can be mapped to point 404 in VA model 400, for example, and its VA pair is (0.7, 0.4). The emotional state “nervous” can be mapped to point 406 in VA model 400, for example, and its VA pair is (-0.3, 0.9). The emotional state “sad” can be mapped to point 408 in VA model 400, for example, and its VA pair is (-0.8, 0.3).
[0049] It should be understood that Figure 4 The description of characterizing the emotional state by the VA model is only an example, and the emotional state can also be characterized by other methods. For example, the emotional state can be characterized by a six-classification method, that is, the emotional state is characterized by a probability distribution for six basic emotional types. These six basic emotional types include, for example, anger, happiness, surprise, disgust, sadness, and fear. The emotional expression according to the embodiment of the present disclosure can be based on any emotional state characterization method.
[0050] Based on the semantic representation of each utterance in the context 302, a context semantic initial representation can be generated. Based on the emotional representation of each utterance in the context 302, a context emotional initial representation can be generated. Based on the semantic representation of the candidate response 306, a candidate response semantic initial representation can be generated. Based on the emotional representation of the candidate response 306, a candidate response emotional initial representation can be generated. Figure 5 To explain the specific process of generating the above initial representation.
[0051] After obtaining the initial representation of the context 302 and the initial representation of the candidate response 306, at the interaction representation generating part 312, an interaction representation of the context 302 and an interaction representation of the candidate response 306 may be further generated. In this article, the interaction representation refers to a representation generated based on the information change between each two adjacent utterances in the context and / or the candidate response. Such information changes may include semantic changes and / or emotional changes. Based on the semantic changes between each two adjacent utterances in the context 302, a contextual semantic interaction representation may be generated. Based on the emotional changes between each two adjacent utterances in the context 302, a contextual emotional interaction representation may be generated. Based on the semantic changes between each two adjacent utterances in the context 302 and the candidate response 306, a candidate response semantic interaction representation may be generated. Based on the emotional changes between each two adjacent utterances in the context 302 and the candidate response 306, a candidate response emotional interaction representation may be generated. This will be discussed later in conjunction with Figure 6 To explain the specific process of generating the above interaction representation.
[0052] At the matching portion 314, a matching process may be performed based on the generated initial representation and the interaction representation. Each of the initial representation and the interaction representation may include a semantic representation and an emotional representation. Accordingly, the matching may include a semantic match and an emotional match. Semantic matching may be performed between two semantic representations to obtain a semantic correlation representation and a semantic interaction correlation representation. Figure 7 To explain the specific process of semantic matching. Emotion matching can be performed between two emotion representations to obtain the emotion initial correlation representation and the emotion interaction correlation representation. Figure 8 To explain the specific process of emotion matching.
[0053] After obtaining the semantic relevance representation, the semantic interaction relevance representation, the sentiment initial relevance representation, and the sentiment interaction relevance representation, these relevance representations can be aggregated at the aggregation part 316 to obtain a comprehensive relevance score 318. Fig. 9 To explain the specific process of performing aggregation.
[0054] Figure 5 An exemplary process 500 for generating an initial representation according to an embodiment of the present disclosure is shown. The initial representation may include a semantic initial representation and an emotional initial representation, for example, the context initial representation may include a context semantic initial representation and a context emotional initial representation, and the candidate response initial representation may include a candidate response semantic initial representation and a candidate response emotional initial representation. The process of generating the semantic initial representation and the emotional initial representation is similar.
[0055] Process 500 may be performed with respect to context 502 and candidate responses 512. Context 502 may correspond to Figure 3 Context 302 in . Context 502 may include, for example, utterances 502-1, 502-2, 502-3, ..., 502-n, which may correspond to Figure 3 Candidate responses 512 may correspond to utterances 302-1, 302-2, 302-3, ..., 302-n in FIG. Figure 3 The candidate response 306 in .
[0056] The word vector sequences corresponding to the utterances 502-1, 502-2, 502-3, ..., 502-n can be generated by the embedding layers 504-1, 504-2, ..., 504-n, respectively. Assume that the context 502 can be represented as {u 1 ,u 2 ,u 3 …u n}, where u represents the utterance, u k represents the kth utterance in context 502, i.e., utterance 502-k. After being processed by the embedding layer, u k can be expressed as in represents the word vector of the j-th word in utterance 502 - k , and m represents the number of words in utterance 502 - k .
[0057] Similarly, a word vector sequence corresponding to the candidate response 512 can be generated by the embedding layer 514. The word vector can be represented as in represents the word vector of the j-th word in the candidate response 512, i.e., the candidate response r, and m represents the number of words in the candidate response 512.
[0058] Subsequently, word-level representations 508-1, 508-2, 508-3, ..., 508-n corresponding to utterances 502-1, 502-2, 502-3, ..., 502-n can be generated respectively through the attention mechanism and the forward feedback neural network 506-1, 506-2, ..., 506-n. Similarly, a word-level representation 518 corresponding to the candidate response 512 can be generated through the attention mechanism and the forward feedback neural network 516. The word-level representation 508-k corresponding to the utterance 502-k can be represented as And the word level representation 518 corresponding to the candidate response 512 can be represented as R self . It can be expressed, for example, by the following formula and R self :
[0059]
[0060] R self =f ATT (R,R) (2)
[0061] where f ATT () represents the output of the attention mechanism and the feedforward neural network.
[0062] The context initial representation 510 may be generated by combining, for example, concatenating, the word-level representations 508-1, 508-2, 508-3, ..., 508-n, that is, The word level representation 518 can be used as the candidate response initial representation 520. Both the semantic initial representation and the sentiment initial representation can be used. Figure 5 Through process 500, the context semantic initial representation can be generated. Contextual Sentiment Initial Representation Initial representation of candidate response semantics and candidate response sentiment initial representation
[0063] After word-level representations corresponding to the utterances in the context and candidate responses are generated, context interaction representations and candidate response interaction representations may be further generated based on these word-level representations. Figure 6 An exemplary process 600 for generating an interaction representation according to an embodiment of the present disclosure is shown. The interaction representation may include a semantic interaction representation and an emotional interaction representation, for example, a contextual interaction representation may include a contextual semantic interaction representation and a contextual emotional interaction representation, and a candidate response interaction representation may include a candidate response semantic interaction representation and a candidate response interaction initial representation. The process of generating a semantic interaction representation and an emotional interaction representation is similar.
[0064] First, word-level representations 602-1, 602-2, 602-3, ..., 602-n corresponding to the utterances in the context 602 and word-level representations 618 corresponding to the candidate responses 616 can be obtained, where the word-level representation 602-k corresponds to the utterance k in the context 602, i.e., u k Context 602 may correspond to Figure 5 , and the word-level representations 602-1, 602-2, 602-3, ..., 602-n may correspond to Figure 5 The candidate responses 616 may correspond to the word level representations 508-1, 508-2, 508-3, ..., 508-n in FIG. Figure 5 The candidate response 512 in , and the word level representation 618 may correspond to Figure 5 The word level representation in 518.
[0065] Sentence level representations 606-1, 606-2, 606-3, ..., 606-n corresponding to word level representations 602-1, 602-2, 602-3, ..., 602-n can be generated by recurrent neural networks and attention mechanisms 604-1, 604-2, 604-3, ..., 604-n, respectively. Similarly, sentence level representations 622 corresponding to word level representations 618 can be generated by recurrent neural networks and attention mechanisms 620.
[0066] The sentence level representation 606-k corresponding to utterance k in context 602 may be represented as And the sentence level representation 622 corresponding to the candidate response 616 can be represented as R utter Generating sentence-level representations through recurrent neural networks and attention mechanisms can be expressed, for example, by the following formula and R utter First, the hidden state H corresponding to the i-th word in the context utterance u or the candidate response r can be calculated. {u,r} [i], as shown in the following formula:
[0067] H {u,r} [i] = GRU(W self [i],H {u,r} [i-1]) (3)
[0068] Among them, GRU represents the gated recurrent unit, denotes the hidden state corresponding to each utterance in the context or candidate response, where m denotes the number of words in the corresponding utterance and d denotes the dimension. Subsequently, the hidden state H can be {u,r} Perform attention and average pooling to obtain the individual utterances u in the context k The corresponding sentence level representation and the sentence-level representation R corresponding to the candidate response r utter , as shown in the following formula:
[0069]
[0070] R utter =mean(f ATT (H r ,H r )) (5)
[0071] Among them, mean() represents average pooling.
[0072] Can be based on and R utterTo calculate the difference between the sentence-level representations of the context and the adjacent utterances in the candidate response. This difference can reflect the information changes between the context and the adjacent utterances in the candidate response, such as semantic changes and / or sentiment changes. Figure 6 As shown, a difference 608-1 can be calculated based on the sentence level representation 606-1 and the required context information, which can reflect the information change between utterance 1 in the context 602 and the required context information, wherein the required context information can be initialized to zero; a difference 608-2 can be calculated based on the sentence level representation 606-2 and the sentence level representation 606-1, which can reflect the information change between utterance 2 and utterance 1 in the context 602; a difference 608-3 can be calculated based on the sentence level representation 606-3 and the sentence level representation 606-2, which can reflect the information change between utterance 3 and utterance 2 in the context 602; ...; and so on, a difference 608-n can be calculated, which can reflect the information change between utterance n and utterance n-1 in the context 602. The utterance adjacent to the candidate response 616 is utterance n in the context 602. Accordingly, a difference 624 may be calculated based on the sentence-level representation 622 of the candidate response 616 and the sentence-level representation 606 - n of utterance n, which may reflect the information change between the candidate response 616 and utterance n.
[0073] For example, you can use Represents sentence level representation With sentence level representation The difference between 608-k. can be used, for example, Represents sentence level representation R utter With sentence level representation The difference between 624. In one embodiment, it can be calculated, for example, by the following formula and
[0074]
[0075]
[0076] Among them, ReLU represents the rectified linear unit, ⊙ represents element-by-element multiplication, and W t and b t are trainable parameters and can be padded with zeros
[0077] After obtaining the differences 608-1, 608-2, 608-3, ..., 608-n and 624, at 610, utterance interaction representations 612-1, 612-2, 612-3, ..., 612-n corresponding to the utterances in the context and candidate response interaction representations 626 corresponding to the candidate responses may be generated based on the differences. In one embodiment, the utterance interaction representation 612-k corresponding to the utterance k in the context 602 may be generated based on the difference between the sentence-level representations of the utterance k in the context 602 and each two adjacent utterances in the context of the utterance k, wherein the context of the utterance k may include the utterance in the context 602 that is located before the utterance k. For example, the speech interaction representation 612-3 corresponding to the speech 3 in the context 602 can be generated based on the differences 608-2 and 608-3, the speech interaction representation 612-n corresponding to the speech n can be generated based on the differences 608-2, 608-3, ..., 608-n, and the candidate response interaction representation 626 corresponding to the candidate response 616 can be generated based on the differences 608-2, 608-3, ..., 608-n and 624.
[0078] In one embodiment, the speech interaction representation generation 610 can integrate the differences by copying the historical memory through the transitional memory network. In this paper, the memory is implemented using a recurrent attention mechanism, in which a forward feedback neural network can be used to convert the speech k into a memory representation. And convert candidate responses into memory representation As shown in the following formula:
[0079]
[0080]
[0081] in, and represents the input memory representation, and represents the output memory representation, and W {in,out} and b {in,out} is a trainable parameter.
[0082] A global representation of the utterance k and candidate responses in the context can be obtained Among them, when k′∈{1,2,…,n}, represents the global representation for utterance k, when k′=n+1, represents the global representation for the candidate response. It can be calculated, for example, by the following formula
[0083]
[0084]
[0085] The above process can be performed iteratively, where the representation results between adjacent hops can be integrated through the residual. and Cascade to obtain the discourse interaction representation T for discourse k and candidate responses k′ , as shown in the following formula:
[0086]
[0087] Among them, when k′=n+1, It can be corresponded to the formula (7) When k′∈{1,2,…,n}, T k′ represents the discourse interaction representation for the discourse in the context, and when k′=n+1, T k′ represents the interaction representation for the candidate response, that is, the candidate response interaction representation 626, that is, T r . Discourse Interaction Representation T k′ The difference in representation between speech k′ and all previous speeches before speech k′ in the current conversation, i.e., speech 1 to speech k′-1, can be reflected. Subsequently, the context interaction representation 614 can be obtained by cascading the speech interaction representations 612-2, 612-3, ... 612-n corresponding to each speech in the context 602, i.e.
[0088] Both semantic initial representation and sentiment initial representation can be used Figure 6 Through process 600, a contextual semantic interaction representation can be generated. Contextual sentiment interaction representation Candidate response semantic interaction representation T s,r and candidate response sentiment interaction representation T e,r .
[0089] As above combined Figure 6As explained, the generation of contextual interaction representation and candidate response interaction representation according to the embodiments of the present disclosure takes into account the differences in representation of adjacent utterances in the context and candidate responses, and further takes into account the differences in representation of each utterance in the context and candidate responses and the context above the utterance in the current conversation. Such differences can reflect changes in information during a conversation, such as semantic changes and sentiment changes. In other words, the embodiments of the present disclosure propose to model the semantic flow and sentiment flow in a conversation, so that the semantic changes and sentiment changes in a conversation can be effectively tracked. Return to reference Figure 3 , the context interaction representation and the candidate response interaction representation can then be used in subsequent matching and aggregation processes, and finally generate a comprehensive relevance score indicating the relevance between the candidate response and the context. Since the generation of the context interaction representation and the candidate response interaction representation takes into account the semantic changes and emotional changes between adjacent utterances in the context and the candidate response, such changes will also be taken into account when generating the comprehensive relevance score, so that the calculated candidate response that is more fluent and natural in semantics and emotion relative to the context will have a higher relevance score.
[0090] Figure 7 An exemplary process 700 for semantic matching according to an embodiment of the present disclosure is shown. A context semantic initial representation 704 and a context semantic interaction representation 706 corresponding to a context 702 may be obtained. The context 702 may correspond to Figure 3 The context 302 in the context semantics. The context semantics initial representation 704 and the context semantics interaction representation 706 can be represented as and A candidate response semantic initial representation 710 and a candidate response semantic interaction representation 712 corresponding to the candidate response 708 may be obtained. The candidate response 708 may correspond to Figure 3 The candidate response 306 in FIG. The candidate response semantic initial representation 710 and the candidate response semantic interactive representation 712 can be represented as and T s,r . This can be done, for example, by Figure 5 The process 500 in the above embodiment is used to generate the context semantic initial representation 704 and the candidate response semantic initial representation 710, and can be performed, for example, by Figure 6 The process 600 in is used to generate the context semantic interaction representation 706 and the candidate response semantic interaction representation 712.
[0091] The context semantic initial representation 704 and the candidate response semantic initial representation 710 may be matched 714 to generate a semantic initial relevance representation 716. The semantic initial relevance representation 716 may be represented, for example, as The semantic initial correlation representation 716 may indicate the correlation between the context semantic initial representation 704 and the candidate response semantic initial representation 710. The semantic initial correlation representation 716 may be represented, for example, by the following formula: Generation of:
[0092]
[0093]
[0094] in, and is a trainable parameter.
[0095] The context semantic interaction representation 706 and the candidate response semantic interaction representation 712 may be matched 718 to generate a semantic interaction correlation representation 720. The semantic interaction correlation representation 720 may be represented, for example, as The semantic interaction correlation representation 720 may indicate the correlation between the context semantic interaction representation 706 and the candidate response semantic interaction representation 712. The semantic interaction correlation representation 720 may be represented, for example, by the following formula: Generation of:
[0096]
[0097]
[0098] in, and is a trainable parameter.
[0099] Figure 8 An exemplary process 800 for emotion matching according to an embodiment of the present disclosure is shown. A context emotion initial representation 804 and a context emotion interaction representation 806 corresponding to a context 802 may be obtained. The context 802 may correspond to Figure 3 The context 302 in the context. The context emotion initial representation 804 and the context emotion interaction representation 806 can be represented as and A candidate response emotion initial representation 810 and a candidate response emotion interaction representation 812 corresponding to the candidate response 808 may be obtained. The candidate response 808 may correspond to Figure 3 The candidate response 306 in FIG. The candidate response emotion initial representation 810 and the candidate response emotion interaction representation 812 can be represented as and T e,r . This can be done, for example, by Figure 5 The process 500 in the above embodiment is used to generate the context emotion initial representation 804 and the candidate response emotion initial representation 810, and can be performed, for example, by Figure 6The process 600 in is used to generate the context emotion interaction representation 806 and the candidate response emotion interaction representation 812.
[0100] The context emotion initial representation 804 and the candidate response emotion initial representation 810 may be matched 814 to generate an emotion initial correlation representation 816. The emotion initial correlation representation 816 may be represented, for example, as The sentiment initial correlation representation 816 may indicate the correlation between the context sentiment initial representation 804 and the candidate response sentiment initial representation 810. The sentiment initial correlation representation 816 may be represented, for example, by the following formula: Generation of:
[0101]
[0102]
[0103] in, and is a trainable parameter.
[0104] The context emotion interaction representation 806 and the candidate response emotion interaction representation 812 may be matched 818 to generate an emotion interaction correlation representation 820. The emotion interaction correlation representation 820 may be represented, for example, as The emotion interaction correlation representation 820 may indicate the correlation between the context emotion interaction representation 806 and the candidate response emotion interaction representation 812. The emotion interaction correlation representation 820 may be represented, for example, by the following formula: Generation of:
[0105]
[0106]
[0107] in, and is a trainable parameter.
[0108] Fig. 9 FIG. 9 shows an exemplary process 900 for performing aggregation according to an embodiment of the present disclosure. The process 900 may be performed by Figure 3 The aggregation portion 316 of the transition memory based matching model 308 is shown to be executed. Fig. 9 The semantic initial correlation representation 902 and the semantic interaction correlation representation 904 in the example may correspond to Figure 7 The semantic initial correlation representation 716 and the semantic interaction correlation representation 720 in Fig. 9 The sentiment initial correlation representation 920 and the sentiment interaction correlation representation 922 in the above diagram may correspond to Figure 8The emotion initial correlation representation 816 and the emotion interactive correlation representation 820 in .
[0109] The semantic initial relevance representation 902 may be processed by, for example, two layers of recurrent neural networks 906 and 908, as shown in the following formula:
[0110]
[0111]
[0112] in, m represents the number of words in the corresponding utterance; k∈{1,2,…,n}, n represents the number of utterances in the context; can be initialized to zero; and It can be used in the subsequent correlation score calculation process.
[0113] The semantic interaction correlation representation 904 may be processed by a recurrent neural network 910 as shown in the following formula:
[0114]
[0115] where k∈{1,2,…,n}, n represents the number of utterances in the context; and It can be used in the subsequent correlation score calculation process.
[0116] At 912, the processed semantic initial correlation representation 902 and the processed semantic interaction correlation representation 904 may be combined, such as concatenated, to obtain a semantic correlation representation 914. Subsequently, a semantic correlation score 918 may be generated based on the semantic correlation representation 914 through a feedforward neural network 916, as shown in the following formula:
[0117]
[0118] in, and is a trainable parameter.
[0119] The sentiment initial correlation representation 920 may be processed by, for example, a two-layer recurrent neural network 924 and 926, as shown in the following formula:
[0120]
[0121]
[0122] in, m represents the number of words in the corresponding utterance; k∈{1,2,…,n}, n represents the number of utterances in the context; can be initialized to zero; and It can be used in the subsequent correlation score calculation process.
[0123] The sentiment interaction correlation representation 922 may be processed by a recurrent neural network 928, as shown in the following formula:
[0124]
[0125] where k∈{1,2,…,n}, n represents the number of utterances in the context; and It can be used in the subsequent correlation score calculation process.
[0126] At 930, the processed sentiment initial correlation representation 920 and the processed sentiment interaction correlation representation 922 may be combined, such as concatenated, to obtain a sentiment correlation representation 932. Subsequently, a sentiment correlation score 936 may be generated based on the sentiment correlation representation 932 through a forward neural network 934, as shown in the following formula:
[0127]
[0128] in, and is a trainable parameter.
[0129] At 938, the semantic relevance score 918 and the sentiment relevance score 936 may be combined to obtain a composite relevance score 940. The composite relevance score 940 may be denoted, for example, as g. The composite relevance score 940 may correspond to Figure 3 In one embodiment, the comprehensive relevance score 940 can be obtained by summing the semantic relevance score 918 and the sentiment relevance score 936, as shown in the following formula:
[0130] g=g s +g e (29)
[0131] Combination of the above Figure 5-Figure 9 The specific operation process of each part in the matching model based on transfer memory is described. It should be understood that these processes are only exemplary. According to actual application requirements, each process can adopt any other units, can include any other steps, and can include more or fewer steps.
[0132] Fig.10 An exemplary chat flow 1000a and an associated sentiment flow 1000b according to an embodiment of the present disclosure are shown. The chat flow 1000a may occur between a chatbot and a user.
[0133] At 1002, the chatbot may output the utterance U1 "I like Taurus girls so much!". In the case where the emotional state is represented by the VA model, the emotional state E of the utterance U1 is U1 It can be, for example, (0.804, 0.673).
[0134] At 1004, the user may input utterance U2 "Well, Scorpio boys always like Taurus girls. This is a fact." The emotional state E of utterance U2 U2 It can be, for example, (0.392, 0.616).
[0135] At 1006, the chatbot may output utterance U3 "But why can't I meet a Taurus girl who likes me?". The emotional state E of utterance U3 U3 It can be, for example, (-0.348, 0.647).
[0136] At 1008, the user may input utterance U4 "Because your circle of friends is too narrow". The emotional state E of utterance U4 U4 It can be, for example, (-0.339, 0.599).
[0137] The positions of the respective emotional states of utterances U1 to U4 in the VA model are shown in the emotion stream 1000 b .
[0138] After receiving the utterance U4 at 1008, the chatbot may first determine the context associated with the utterance U4, which context may include, for example, utterances U1 to U4. Next, the chatbot may determine the response to be provided to the user from a set of candidate responses in a database connected to or contained therein. For example, the chatbot may calculate a comprehensive relevance score between each candidate response in the set of candidate responses and the context. Box 1010 shows two exemplary candidate responses R1 "I'll encounter that" and candidate response R2 "Forget it, I'm just kidding. Hahahaha". The emotional state E of candidate response R1 R1 It can be, for example, (-0.837, 0.882). The emotional state E of the candidate response R2 R2 It can be (0.225, 0.670) for example.
[0139] For example, Figure 3 Process 300 and combined Figure 5-Figure 9The comprehensive relevance score is calculated by using processes 500-900 in . Since the calculation of the comprehensive relevance score takes into account the semantic changes and emotional changes between the context and the adjacent utterances in the candidate response, and between the context and each utterance in the candidate response and the context of the utterance in the current conversation, the calculated relevance score of the candidate response that is more fluent and natural in terms of semantics and emotion relative to the context will be higher. For example, the relevance score S1 corresponding to the candidate response R1 with an emotional state of (-0.837, 0.882) may be 0.562, while the relevance score S2 corresponding to the candidate response R2 with an emotional state of (0.225, 0.670) may be 0.114. The relevance score S1 is higher than the relevance score S2, so the chatbot finally outputs the candidate response R1 "I will encounter it" at 912. It can also be seen from the emotional flow 1000b that compared with the candidate response R2, the emotional state of the candidate response R1 is more fluent and natural relative to the utterances U1 to U4.
[0140] Fig.11 An exemplary process 1100 for training a transfer memory based matching model according to an embodiment of the present disclosure is shown. Fig.11 The transfer memory-based matching model 1106 in may correspond to Figure 3 The transfer memory-based matching model 308 in FIG. The transfer memory-based matching model 1106 may include an initial representation generation part 1108, an interactive representation generation part 1110, a matching part 1112, and an aggregation part 1114, which may correspond to Figure 3 An initial representation generation part 310, an interactive representation generation part 312, a matching part 314 and an aggregation part 316 are included in the diagram.
[0141] The training of the transfer memory-based matching model 1106 may be based on the corpus 1150. The corpus 1150 may include multiple dialogue-based training samples, such as [context c1, candidate response r1, relevance annotation y1], [context c2, candidate response r2, relevance annotation y2], [context c3, candidate response r3, relevance annotation y3], etc., where context c i can include a set of dialogue-based utterances, candidate responses r i Can be for context c i The candidate response is labeled with the correlation y i ∈{0,1} can indicate the context c i With candidate response r i The correlation between them is “0”, which can indicate that the candidate response r i With context c i Not relevant and "1" may indicate a candidate response r i With context ci Related.
[0142] Taking the training samples i[context c in corpus 1150 i , candidate response r i , correlation label y i ] as an example. Context c i 1102 and candidate response r i 1104 can be used as input to the transfer memory based matching model 1106. The transfer memory based matching model 1106 can be used to match the context c i and the candidate response r i The correlation between them performs the scoring task and outputs the comprehensive correlation score g(c i ,r i )1116. For example, Figure 3 Process 300 and combined Figure 5-Figure 9 In one embodiment, the prediction loss of training sample i can be calculated as a binary cross entropy loss, and the prediction loss corresponding to the scoring task can be calculated by summing the prediction losses of all training samples. As shown in the following formula:
[0143]
[0144] Embodiments of the present disclosure propose to use a multi-task framework to optimize the sentiment representation of context and candidate responses with an additional sentiment classification task, such as Figure 3 The context emotion initial representation and candidate response emotion initial representation generated by the initial representation generation part 310 in the training process, and the context emotion interaction representation and candidate response emotion interaction representation generated by the interaction representation generation part 312. Fig.11 The scoring task described above is performed in conjunction with the scoring task described above. The additional sentiment classification task can be performed using a corpus including training data with sentiment annotations. In one embodiment, the corpus can be a dialogue corpus including multiple dialogue-based training samples. Fig.12 An exemplary process 1200 of optimizing sentiment representation using a dialogue corpus according to an embodiment of the present disclosure is shown.
[0145] exist Fig.12 In the example, the corpus 1250 for performing the additional sentiment classification task to optimize the sentiment representation may include a plurality of dialogue-based training samples, such as [context c1, candidate response r1, sentiment annotation {z 1,j}], [context c2, candidate response r2, sentiment label {z 2,j}], [context c3, candidate response r3, sentiment annotation {z3,j}], etc., where context c i can include a set of dialogue-based utterances, candidate responses r i Can be for context c i Candidate responses. Different forms of emotional annotations can be provided for different representations of emotional states. For example, when using the six-category method to represent emotional states, i,j ∈{0,1} represents the sentiment labeling of sentiment category j in training sample i.
[0146] To utilize the training sample i[context c i , candidate response r i , sentiment labeling {z i,j}] to perform additional sentiment classification tasks. First, we can generate i 1204 corresponds to the candidate response emotion initial representation 1206. This can be done, for example, by Figure 3 In the initial representation generation part 310, more specifically, by Figure 5 The process 500 in the above embodiment is used to generate the candidate response emotion initial representation 1206. The candidate response emotion initial representation 1206 can be represented as It may correspond, for example, to R in the above formula (2) self . Then, based on the context c i 1202 and candidate response r i 1204 to generate candidate responses i The corresponding candidate response emotion interaction representation 1210 can be obtained, for example, by Figure 3 In the interactive representation generation part 312, more specifically, by Figure 6 The process 600 in the embodiment of the present invention is used to generate a candidate response emotion interaction representation 1210. The candidate response emotion interaction representation 1210 can be represented as T e , which may correspond, for example, to T which can be calculated by the above formula (12) e,r .
[0147] At 1212, the candidate response emotion initial representation 1206 processed by the pooling layer 1208 can be combined with the candidate response emotion interaction representation 1210 to obtain the candidate response emotion comprehensive representation. The forward neural network 1214 can generate the emotion prediction result h(x i )1216, as shown in the following formula:
[0148]
[0149] in, is a trainable parameter for linear transformation; mean represents the average pooling function; and K is the number of emotion types, for example, when a six-category method is used to characterize the emotional state, K can be 6.
[0150] In one embodiment, the prediction loss for training sample i can be calculated as a multi-class cross entropy loss, and the prediction loss corresponding to the additional sentiment classification task can be calculated by summing the prediction losses of all training samples. As shown in the following formula:
[0151]
[0152] Among them, K is the number of sentiment types and M is the number of training samples.
[0153] In addition to the dialogue corpus, a sentence-based corpus can also be adopted to perform additional sentiment classification tasks to optimize the sentiment representation. Fig.13 An exemplary process 1300 of optimizing sentiment representation using a sentence corpus according to an embodiment of the present disclosure is shown.
[0154] Fig.13 The corpus 1350 in may include multiple training samples, such as [utterance x1, sentiment label {z 1,j}], [utterance x2, sentiment label {z 2,j}], [utterance x3, sentiment label {z 3,j}], etc., where the sentiment annotation {z i,j} is used to indicate the utterance x i Different forms of emotional annotations can be provided for different representations of emotional states. For example, when using the six-category method to represent emotional states, i,j ∈{0,1} represents the sentiment labeling of sentiment category j in training sample i.
[0155] To use the training sample i[utterance x i , sentiment labeling {z i,j}] to perform additional sentiment classification tasks. First, we can generate i 1302 corresponding to the word level representation 1304. For example, Figure 3 In the initial representation generation part 310, more specifically, by Figure 5 The process 500 in the above embodiment is used to generate a word level representation 1304. The pooling layer 1306 and the forward neural network 1308 can process the word level representation 1304 in sequence to obtain the sentiment prediction result h(x i )1310. Then, based on the emotion prediction result h(x i )1310 and sentiment annotation {zi,j} to calculate the prediction loss corresponding to the additional sentiment classification task In one embodiment, the prediction loss for training sample i can be calculated as a multi-class cross entropy loss, and the prediction loss corresponding to the additional sentiment classification task can be calculated by summing the prediction losses of all training samples. As shown in the above formula (32).
[0156] It should be understood that reference Fig.12 Described using the dialogue corpus to perform additional sentiment classification tasks and references Fig.13 The described additional sentiment classification task performed using a sentence corpus can be performed separately or together. When performed together, the prediction loss corresponding to the additional sentiment classification task can be calculated based on the prediction loss obtained by performing the additional sentiment classification task using the dialogue corpus and the prediction loss obtained by performing the additional sentiment classification task using the sentence corpus.
[0157] Fig.11 The scoring tasks in Fig.12 and / or Fig.13 The additional sentiment classification task in can be performed jointly. The prediction loss corresponding to the rating task can be and the prediction loss corresponding to the additional sentiment classification task Perform a weighted sum to calculate the total prediction loss As shown in the following formula:
[0158]
[0159] Among them, α is a system setting hyperparameter.
[0160] People with different personalities may have different emotional changes. For example, the emotions of a sensitive person may change easily, while the emotions of a quiet person may hardly change. For example, a sensitive person may become depressed very easily, even if he was very happy the last second. The disclosed embodiment proposes that a matching model based on transfer memory can be trained for a predefined personality, such as Figure 3 The transfer memory-based matching model 308 is used to obtain a chat robot with a predefined personality.
[0161] In one embodiment, the transfer memory-based matching model can be trained based on a constraint on the magnitude of emotion change between two adjacent utterances associated with a predefined personality. For example, during the training of the transfer memory-based matching model, a prediction loss function associated with the magnitude of emotion change, such as the magnitude of emotion change between two adjacent utterances, can be added to the prediction loss function shown in the above formula (33). And set the prediction loss The associated weight β is shown in the following formula:
[0162]
[0163] Among them, β is a hyperparameter set by the system, which can affect the prediction loss associated with the magnitude of sentiment change Total prediction loss If you want to train a chatbot with a large range of emotional changes, such as a chatbot with a perceptual personality, you can set β to a smaller value to predict the loss. Conversely, if you want to train a chatbot with a small range of emotional changes, such as a chatbot with a quiet personality, you can set β to a larger value, so that the prediction loss The proportion of the total predicted loss can be larger.
[0164] The emotional state may also be affected by external factors, such as weather, health status, whether good things happen, whether bad things happen, etc. For example, if the speaker is ill or the weather is bad, he may be depressed even if he hears good news; and if the speaker is healthy or the weather is fine, he may be calm even if he hears bad news. The disclosed embodiment proposes that when providing a response, not only the context in the chat flow can be considered, but also external factors that affect the emotional state of the chatbot can be considered.
[0165] In one implementation, additional sentiment representations corresponding to external factors may be generated and inserted between a set of word-level representations corresponding to a set of utterances in the context of a chat stream, thereby influencing subsequent relevance score generation and further influencing the selection of candidate responses.
[0166] Fig.14 An exemplary process 1400 for generating additional emotion representations according to an embodiment of the present disclosure is shown.
[0167] First, external factors 1402 that affect the emotional state of the chatbot may be identified, such as weather, health status, whether good things happen, whether bad things happen, etc. External factors such as weather may be related to actual conditions, such as actual weather conditions of the day, and may be obtained through other applications. External factors such as health status, whether good things happen, whether bad things happen, etc. may be manually defined or automatically defined by the system.
[0168] At 1404, the external factor 1402 may be mapped to an emotional state 1406 corresponding to the external factor 1402 through a predefined function. In the case where the VA model is used to represent the emotional state, the emotional state 1406 may be, for example, a VA pair.
[0169] Subsequently, an additional emotion representation 1410 may be generated based on the emotion state 1406 by the forward neural network 1408. In this article, the emotion representation corresponding to the external factor generated is referred to as an additional emotion representation. In the case where the emotion state 1406 is a VA pair, the forward neural network 1408 may generate the additional emotion representation 1410 by converting the emotion state 1406 into a valence vector and an arousal vector and combining the valence vector and the arousal vector.
[0170] After the additional sentiment representation is generated, it can be inserted between a set of word-level representations corresponding to a set of utterances in the context of the chat stream. Fig.15 An exemplary process 1500 for inserting additional emotion representations according to an embodiment of the present disclosure is shown.
[0171] First, a set of word-level representations 1504-1, 1504-2, 1502-3, ..., 1504-n corresponding to the utterances 1502-1, 1502-2, 1502-3, ..., 1502-n in the context 1502 may be obtained. Figure 5 In one embodiment, the word level representations 1504-1, 1504-2, 1502-3, ..., 1504-n may be generated by, for example, Fig.14 The additional emotion representation 1506 generated by the process 1400 is inserted before the representation of the first utterance of the current conversation, that is, before the word level representation 1504-1. In another embodiment, the additional emotion representation 1506 can be inserted before the word level representation of the current utterance, that is, before the word level representation 1504-n.
[0172] An updated context initial representation 1508 may be generated based on the word level representations 1504-1, 1504-2, 1502-3, ..., 1504-n and the additional sentiment representation 1506. For example, the updated context initial representation 1508 may be generated by concatenating the word level representations 1504-1, 1504-2, 1502-3, ..., 1504-n and the additional sentiment representation 1506. An updated context interaction representation 1510 may also be generated based on the word level representations 1504-1, 1504-2, 1502-3, ..., 1504-n and the additional sentiment representation 1506. In addition, the word level representations 1504-1, 1504-2, 1502-3, ..., 1504-n and the additional sentiment representation 1506 may also generate an updated response interaction representation 1516 together with the word level representation 1514 of the candidate response 1512. For example, you can Figure 6 The process 600 in is used to generate an updated context interaction representation 1510 and an updated response interaction representation 1516.
[0173] The generation of the updated context initial representation 1508, the updated context interaction representation 1510, and the updated response interaction representation 1516 takes into account the additional emotion representations corresponding to the external factors. These updated representations can then be used in subsequent matching processes, such as Figure 8 800 in the process, and the aggregation process, e.g. Fig. 9 The process 900 in the embodiment is repeated, and the comprehensive relevance score is finally obtained. Since the generation of the updated context initial representation 1508, the updated context interaction representation 1510, and the updated response interaction representation 1516 takes into account the additional emotion representation corresponding to the external factors, the additional emotion representation is also taken into account when generating the comprehensive relevance score, so that the calculated relevance score of the candidate response consistent with the emotion state of the additional emotion representation can be higher.
[0174] In another embodiment, the basic emotional state of the chatbot can also be determined based on external factors. For example, when the external factor is "good weather", the basic emotional state of the chatbot can be determined as "high spirits"; and when the external factor is "bad weather", the basic emotional state of the chatbot can be determined as "low spirits". Subsequently, a threshold corresponding to the basic emotional state can be set for each candidate response. In some embodiments, only a valence threshold can be set. Taking the candidate response "haha" as an example, the valence threshold corresponding to "high spirits" can be, for example, "0.1", and the valence threshold corresponding to "low spirits" can be, for example, "0.8". In this case, when the basic emotional state determined based on external factors is "high spirits", the chatbot's emotional state predicted according to the context in the conversation can provide the candidate response "haha" as long as the valence value is greater than "0.1"; and when the basic emotional state determined based on external factors is "low spirits", the predicted chatbot's emotional state can provide the candidate response "haha" only if the valence value is greater than "0.8".
[0175] In addition, after the basic emotional state of the chatbot is determined based on external factors, the emotional state of the chatbot can be adapted according to the determined basic emotional state. For example, when the basic emotional state is "high emotion", the effectiveness value of the emotional state of the chatbot predicted based on the context in the conversation can be increased, for example, multiplied by a coefficient greater than 1; and when the basic emotional state is "low emotion", the effectiveness value of the emotional state of the chatbot predicted based on the context in the conversation can be reduced, for example, multiplied by a coefficient less than 1.
[0176] The above describes different ways in which the chatbot considers external factors that affect the emotional state when providing a response. These ways can make the emotional state of the response provided throughout the entire conversation consistent with the basic emotional state determined by the external factors. It should be understood that the above ways are only exemplary, and the embodiments of the present disclosure are not limited thereto, but can be implemented in any other way to make the emotional state of the response provided by the chatbot consistent with the basic emotional state determined by the external factors.
[0177] According to the transfer memory-based matching model of the embodiment of the present disclosure, multimodal input can be supported. Each utterance as input of the transfer memory-based matching model can adopt at least one of the following modes: text, voice, facial expression and gesture. For example, in the process of a user using a terminal device to chat with a chat robot, the microphone on the terminal device can capture voice, the voice recognition software can convert voice into text, or the user can directly input text. In addition, the camera on the terminal device can capture the user's facial expressions, body postures and gestures, etc. Inputs of different modes for a specific utterance can be converted into corresponding representations respectively. These representations can be combined together through an early fusion strategy or a late fusion strategy to generate a context initial representation and a context interaction representation. In this article, the early fusion strategy refers to first combining the representations of various modal inputs for each utterance into a comprehensive representation of the utterance, and then generating the context initial representation and the context interaction representation based on the comprehensive representation of the utterance and the comprehensive representation of other utterances. The late fusion strategy refers to first using the representations of various modal inputs of each utterance to generate intermediate initial representations and intermediate interaction representations under each modality, and then generating the context initial representation and the context interaction representation by combining the generated intermediate initial representations and intermediate interaction representations respectively.
[0178] Fig.16 An exemplary process 1600 for combining multimodal inputs through an early fusion strategy according to an embodiment of the present disclosure is shown.
[0179] Assume that the transfer memory-based matching model according to the embodiment of the present disclosure can support m types of modal inputs. Fig.16 , utterance 1 1602 may, for example, have modality 1 input 1602-1, modality 2 input 1602-2, ..., modality m input 1602-m. These inputs may be converted into corresponding representations, such as representation 1 1604-1 of utterance 1, representation 2 1604-2 of utterance 1, ..., representation m 1604-m of utterance 1. Similarly, utterance 2 1606 may, for example, have modality 1 input 1606-1, modality 2 input 1606-2, ..., modality m input 1606-m. These inputs may be converted into corresponding representations, such as representation 1 1608-1 of utterance 2, representation 2 1608-2 of utterance 2, ..., representation m 1608-m of utterance 2. It should be understood that although in Fig.16 It is shown in that both utterance 1 and utterance 2 have m modal inputs, but the number of modal inputs of utterance 1 and utterance 2 may be less than m. In the case of not having a certain modal input, the modal input and the corresponding representation may be initialized to zero.
[0180] Representation 1 1604-1 of utterance 1, representation 2 1604-2 of utterance 1, ..., representation m 1604-m of utterance 1 may be combined together to generate a comprehensive representation 1610 of utterance 1. Similarly, representation 1 1608-1 of utterance 2, representation 2 1608-2 of utterance 2, ..., representation m 1608-m of utterance 2 may be combined together to generate a comprehensive representation 1612 of utterance 2. A context initial representation 1614 and a context interaction representation 1616 may be generated based on the comprehensive representation 1610 of utterance 1, the comprehensive representation 1612 of utterance 2, and possibly comprehensive representations of other utterances (not shown). For example, the context initial representation 1614 and the context interaction representation 1616 may be generated by Figure 5 Process 500 and Figure 6 The process 600 in the embodiment is used to generate the context initial representation 1614 and the context interaction representation 1616. The context initial representation 1614 and the context interaction representation 1616 can be used in subsequent matching and aggregation processes, and finally participate in generating a comprehensive relevance score indicating the relevance between the candidate response and the context.
[0181] Fig.17 An exemplary process 1700 for combining multimodal inputs through a late fusion strategy according to an embodiment of the present disclosure is shown.
[0182] Assume that the transfer memory-based matching model according to the embodiment of the present disclosure can support m types of modal inputs. Fig.17 , utterance 1 may, for example, have modal 1 input 1702-1 of utterance 1, modal 2 input 1702-2 of utterance 1, ..., modal m input 1702-m of utterance 1. These inputs may be converted into corresponding representations, such as representation 1 1704-1 of utterance 1, representation 2 1704-2 of utterance 1, ..., representation m 1704-m of utterance 1, respectively. Similarly, utterance 2 1706 may, for example, have modal 1 input 1706-1 of utterance 2, modal 2 input 1706-2 of utterance 2, ..., modal m input 1706-m of utterance 2. These inputs may be converted into corresponding representations, such as representation 1 1708-1 of utterance 2, representation 2 1708-2 of utterance 2, ..., representation m 1708-m of utterance 2, respectively. It should be understood that although in Fig.17 It is shown in that both utterance 1 and utterance 2 have m modal inputs, but the number of modal inputs of utterance 1 and utterance 2 may be less than m. In the case of not having a certain modal input, the modal input and the corresponding representation may be initialized to zero.
[0183] Representations of various modal inputs of various utterances may be used to generate intermediate initial representations and intermediate interactive representations under respective modal inputs. For example, an intermediate initial representation 1710-1 and an intermediate interactive representation 1712-1 corresponding to modality 1 may be generated based on representation 1 1704-1 of utterance 1, representation 1 1708-1 of utterance 2, and possible representations of other utterances corresponding to modality 1 (not shown); an intermediate initial representation 1710-2 and an intermediate interactive representation 1712-2 corresponding to modality 2 may be generated based on representation 2 1704-2 of utterance 1, representation 2 1708-2 of utterance 2, and possible representations of other utterances corresponding to modality 2 (not shown); ...; an intermediate initial representation 1710-m and an intermediate interactive representation 1712-m corresponding to modality m may be generated based on representation m 1704-m of utterance 1, representation m 1708-m of utterance 2, and possible representations of other utterances corresponding to modality m (not shown). This may be done, for example, by a method similar to Figure 5 The process 500 for generating the context initial representation in the embodiment of the present invention generates the intermediate initial representations 1710-1, 1710-2, ..., 1710-m, and the intermediate initial representations 1710-1, 1710-2, ..., 1710-m are generated by a process similar to Figure 6 The process 600 for generating contextual interaction representations in is used to generate intermediate interaction representations 1712-1, 1712-2, ..., 1712-m.
[0184] Subsequently, the context initial representation 1714 may be generated by combining the intermediate initial representation 1710-1, the intermediate initial representation 1710-2, ..., the intermediate initial representation 1710-m, and the context interaction representation 1716 may be generated by combining the intermediate interaction representation 1712-1, the intermediate interaction representation 1712-2, ..., the intermediate interaction representation 1712-m. The context initial representation 1714 and the context interaction representation 1716 may be used in subsequent matching and aggregation processes, and ultimately participate in generating a comprehensive relevance score indicating the relevance between the candidate response and the context.
[0185] It should be understood that although Fig.16 and Fig.17 Only two utterances are shown in FIG. 1 , but the process of combining multimodal inputs through early fusion strategy and late fusion strategy according to an embodiment of the present disclosure is not limited to a specific number of utterances, but can be applied to any number of utterances in a similar manner. In addition, Fig.16 and Fig.17The processes of combining multimodal inputs by early fusion strategy and late fusion strategy respectively shown in are only exemplary, and the embodiments of the present disclosure are not limited thereto. For example, for the late fusion strategy, the representations of various modal inputs of each utterance can also be used to generate intermediate initial correlation representations and intermediate interaction correlation representations under their respective modalities, and then the generated intermediate initial correlation representations and intermediate interaction correlation representations are combined to obtain context initial correlation representations and context interaction correlation representations, respectively. The context initial correlation representation and the context interaction correlation representation can participate in generating a comprehensive correlation score indicating the correlation between the candidate response and the context.
[0186] According to an embodiment of the present disclosure, after selecting a candidate response to be provided to the user, the chatbot may present the response based on the emotional state of the selected candidate response. In some embodiments, the chatbot may express the emotional state of the response in a corresponding manner based on the modality of the selected candidate response. For example, in the case where the response is voice, when its emotional state is "happy", the chatbot may present the response with a faster speaking speed or a higher pitch. In addition, the emotional state of the response may also be expressed by additionally providing other multimodal signals, such as through the chatbot's facial expressions, body postures or gestures. In one embodiment, when presenting a response, corresponding lights may be provided simultaneously to express the emotional state of the response.
[0187] Fig.18 An exemplary scenario 1800 of expressing a response emotional state through light according to an embodiment of the present disclosure is shown. This scenario may occur between a user and a smart speaker. The smart speaker may be equipped with a chatbot implemented according to an embodiment of the present disclosure. The smart speaker may reply to the user's voice input by providing a voice response and corresponding light.
[0188] At 1802, the user may say "I am so annoyed!". At 1804, the smart speaker may reply by providing a voice response "Cheer up! I still like to see you smile." The emotional state of the voice response at 1804 may have a relatively positive valence, such as a valence value of "0.9", so the light provided in association therewith may have a relatively strong brightness.
[0189] At 1806, the user may then say "But I don't feel like laughing now." At 1808, the smart speaker may reply by providing a voice response "You should learn to laugh. Everyone can do it." The emotional state of the voice response at 1808 may have a generally positive valence, such as a valence value of "0.6," and thus the light provided in association therewith may have a weaker brightness.
[0190] At 1810, the user may continue to say "I can't do that". At 1812, the smart speaker may reply by providing a voice response "Let me make you happy!" The emotional state of the voice response at 1812 may have a more positive valence, such as a valence value of "0.9", so the light provided in association therewith may have a stronger brightness.
[0191] Fig.18 An example of expressing different emotional states of a response by different light brightness is shown. It should be understood that the embodiments of the present disclosure are not limited thereto. For example, in the case where the emotional state is expressed by light, the emotional state of the response can also be expressed by the color, duration, etc. of the light. In addition, the emotional state of the response can also be expressed by any other multimodal signal.
[0192] According to an embodiment of the present disclosure, the selection of candidate responses can be based on the semantic relevance and emotional relevance between the candidate responses and the context. When determining the semantic relevance and emotional relevance, the messages received by the chatbot and the responses sent are considered uniformly as utterances in the context, and no distinction is made between the received messages and the responses sent. This approach can enable the sharing of emotional states between the chatbot and the user, and achieve empathy between the chatbot and the user. Furthermore, the chatbot can drive the user's emotional state in the direction of positive valence by providing more positive responses, such as responses with higher valence values, thereby guiding the user to obtain an emotional state with positive valence before the end of the session.
[0193] Fig.19 is a flow chart of an exemplary method 1900 for providing a response in an automated chat according to an embodiment of the present disclosure.
[0194] At step 1910, a message may be obtained in the chat stream.
[0195] At step 1920, a context associated with the message may be determined, the context comprising a set of utterances that include the message.
[0196] At step 1930, for each candidate response in a set of candidate responses, the candidate response may be scored based at least on the set of utterances and information changes between adjacent utterances in the candidate response.
[0197] At step 1940, a highest-scoring candidate response from the set of candidate responses may be provided in the chat stream.
[0198] In one implementation, the information change may include at least one of a semantic change and a sentiment change.
[0199] The scoring may include at least one of: generating a semantic relevance score for the candidate response based at least on semantic changes between the set of utterances and adjacent utterances in the candidate response; and generating a sentiment relevance score for the candidate response based at least on sentiment changes between the set of utterances and adjacent utterances in the candidate response.
[0200] The scoring may include generating a composite relevance score for the candidate response based on the semantic relevance score and the sentiment relevance score.
[0201] In one embodiment, the scoring may include: generating a context interaction representation corresponding to the context based on the information change between each two adjacent utterances in the group of utterances; generating a candidate response interaction representation corresponding to the candidate response based on the information change between each two adjacent utterances in the group of utterances and the candidate responses; obtaining an interaction correlation representation by matching the context interaction representation with the candidate response interaction representation; and generating a relevance score for the candidate response based at least on the interaction correlation representation.
[0202] The scoring may also include: generating a context initial representation corresponding to the context based on a representation of each utterance in the set of utterances; generating a candidate response initial representation corresponding to the candidate response; obtaining an initial relevance representation by matching the context initial representation with the candidate response initial representation; and generating a relevance score for the candidate response based on a combination of the initial relevance representation and the interaction relevance representation.
[0203] The information change may include a semantic change, and the context interaction representation may include a context semantic interaction representation, the candidate response interaction representation may include a candidate response semantic interaction representation, the interaction correlation representation may include a semantic interaction correlation representation, the context initial representation may include a context semantic initial representation, the candidate response initial representation may include a candidate response semantic initial representation, the initial correlation representation may include a semantic initial correlation representation, and the correlation score may be a semantic correlation score.
[0204] The information change may include an emotion change, and the context interaction representation may include a context emotion interaction representation, the candidate response interaction representation may include a candidate response emotion interaction representation, the interaction correlation representation may include an emotion interaction correlation representation, the context initial representation may include a context emotion initial representation, the candidate response initial representation may include a candidate response emotion initial representation, the initial correlation representation may include an emotion initial correlation representation, and the correlation score may be an emotion correlation score.
[0205] In one embodiment, method 1900 may further include: identifying external factors that affect the emotional state; and adding the external factors to the context.
[0206] In one implementation, at least one utterance in the set of utterances may be in at least one of the following modalities: text, voice, facial expression, and gesture.
[0207] In one embodiment, method 1900 may further include presenting the candidate responses based on the emotional state of the highest-scoring candidate responses.
[0208] In one embodiment, the scoring may be performed by a transfer memory-based matching model, which is optimized by adding a sentiment classification task during training.
[0209] In one embodiment, the scoring may be performed by a transfer memory-based matching model, which is trained based on a constraint on the magnitude of emotion change between two adjacent utterances associated with a predefined personality.
[0210] It should be understood that method 1900 may also include any steps / processes for providing responses in automatic chat according to the above-mentioned embodiments of the present disclosure.
[0211] Fig. 20 An exemplary device 2000 for providing a response in an automatic chat according to an embodiment of the present disclosure is shown. The device 2000 may include a message obtaining module 2010, for obtaining a message in a chat stream; a context determining module 2020, for determining a context associated with the message, the context including a set of utterances, the set of utterances including the message; a scoring module 2030, for scoring each candidate response in a set of candidate responses based at least on information changes between the set of utterances and adjacent utterances in the candidate response; and a response providing module 2040, for providing the candidate response with the highest score in the set of candidate responses in the chat stream.
[0212] In one implementation, the information change may include at least one of a semantic change and a sentiment change.
[0213] The scoring module 2030 can also be configured to perform at least one of the following: generating a semantic relevance score for the candidate response based at least on semantic changes between the set of utterances and adjacent utterances in the candidate response; and generating a sentiment relevance score for the candidate response based at least on sentiment changes between the set of utterances and adjacent utterances in the candidate response.
[0214] In one embodiment, the apparatus 2000 may further include: an external factor identification module for identifying external factors that affect the emotional state; and an external factor adding module for adding the external factors to the context.
[0215] In one embodiment, the scoring module 2030 may include a transfer memory-based matching model, and the transfer memory-based matching model is optimized by adding a sentiment classification task during the training process.
[0216] In one embodiment, the scoring module 2030 may include a transfer memory-based matching model, which is trained based on a constraint on the magnitude of emotion changes between two adjacent utterances that is associated with a predefined personality.
[0217] It should be understood that the device 2000 may also include any other modules configured to provide responses in automatic chatting according to the above-mentioned embodiments of the present disclosure.
[0218] Fig.21 An exemplary apparatus 2100 for providing a response in an automated chat according to an embodiment of the present disclosure is shown.
[0219] The device 2100 may include at least one processor 2110. The device 2100 may also include a memory 2120 connected to the processor 2110. The memory 2120 may store computer executable instructions, which, when executed, cause the processor 2110 to perform any operation of the method for providing a response in automatic chat according to the above-mentioned embodiments of the present disclosure.
[0220] The embodiments of the present disclosure may be implemented in a non-transitory computer-readable medium. The non-transitory computer-readable medium may include instructions, which, when executed, cause one or more processors to perform any operation of the method for providing a response in an automatic chat according to the above-mentioned embodiments of the present disclosure.
[0221] It should be understood that all operations in the method described above are merely exemplary, and the present disclosure is not limited to any operations in the method or the order of these operations, but should cover all other equivalent transformations under the same or similar concept.
[0222] It should also be understood that all modules in the above described device can be implemented in various ways. These modules can be implemented as hardware, software, or a combination thereof. In addition, any module in these modules can be further divided into submodules or combined together functionally.
[0223] Processors have been described in conjunction with various devices and methods. These processors can be implemented using electronic hardware, computer software or any combination thereof. Whether these processors are implemented as hardware or software will depend on specific application and the overall design constraints imposed on the system. As an example, the processor provided in the present disclosure, any part of the processor or any combination of processors can be implemented as a microprocessor, a microcontroller, a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic device (PLD), a state machine, a gate logic, a discrete hardware circuit, and other suitable processing components configured to perform the various functions described in the present disclosure. The function of the processor provided in the present disclosure, any part of the processor or any combination of processors can be implemented as software executed by a microprocessor, a microcontroller, a DSP or other suitable platforms.
[0224] Software should be broadly considered to represent instructions, instruction sets, codes, code segments, program codes, programs, subroutines, software modules, applications, software applications, software packages, routines, subroutines, objects, running threads, processes, functions, etc. Software can reside in a computer-readable medium. A computer-readable medium can include, for example, a memory, which can be, for example, a magnetic storage device (e.g., a hard disk, a floppy disk, a magnetic stripe), an optical disk, a smart card, a flash memory device, a random access memory (RAM), a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), a register, or a removable disk. Although the memory is shown as being separated from the processor in the various aspects provided in the present disclosure, the memory can also be located inside the processor (e.g., a cache or a register).
[0225] The above description is provided to enable any person skilled in the art to implement the various aspects described herein. Various modifications to these aspects are apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects. Therefore, the claims are not intended to be limited to the aspects shown herein. All structural and functional equivalents of the elements of the various aspects described in this disclosure that are known or to be known to those skilled in the art will be covered by the claims.
Claims
1. A method for providing a response in an automated chat, comprising: Get messages in the chat stream; determining a context associated with the message, the context comprising a set of utterances, the set of utterances comprising the message; For each candidate response in a set of candidate responses, the candidate response is scored based at least on information changes between the set of utterances and adjacent utterances in the candidate response, wherein the scoring comprises: generating a context interaction representation corresponding to the context based on information changes between every two adjacent utterances in the set of utterances; generating a candidate response interaction representation corresponding to the candidate response based on the set of utterances and information changes between each two adjacent utterances in the candidate response; Obtaining an interaction relevance representation by matching the context interaction representation with the candidate response interaction representation; and generating a relevance score for the candidate response based at least on the interaction relevance representation; and A highest-scoring candidate response from the set of candidate responses is provided in the chat stream.
2. The method according to claim 1, wherein: The information change includes at least one of a semantic change and a sentiment change.
3. The method according to claim 2, wherein: The score includes at least one of the following: generating a semantic relevance score for the candidate response based at least on semantic variations between the set of utterances and adjacent utterances in the candidate response; as well as A sentiment relevance score for the candidate response is generated based at least on the set of utterances and sentiment variations between adjacent utterances in the candidate response.
4. The method according to claim 3, wherein: The rating includes: A composite relevance score for the candidate response is generated based on the semantic relevance score and the sentiment relevance score.
5. The method according to claim 1, wherein: The rating also includes: generating an initial representation of a context corresponding to the context based on a representation of each utterance in the set of utterances; generating a candidate response initial representation corresponding to the candidate response; Obtaining an initial relevance representation by matching the context initial representation with the candidate response initial representation; and A relevance score for the candidate response is generated based on a combination of the initial relevance representation and the interactive relevance representation.
6. The method according to claim 5, wherein: The information change includes a semantic change, and, The context interaction representation includes context semantic interaction representation, The candidate response interaction representation includes a candidate response semantic interaction representation, The interaction correlation representation includes a semantic interaction correlation representation, The context initial representation includes a context semantic initial representation, The candidate response initial representation includes a candidate response semantic initial representation, The initial relevance representation includes a semantic initial relevance representation, and The relevance score is a semantic relevance score.
7. The method according to claim 5, wherein: The information change includes emotional change, and, The context interaction representation includes a context emotion interaction representation, The candidate response interaction representation includes a candidate response emotion interaction representation, The interaction correlation representation includes an emotional interaction correlation representation, The context initial representation includes a context emotion initial representation, The candidate response initial representation includes a candidate response emotion initial representation, The initial relevance representation includes an initial relevance representation of sentiment, and The relevance score is a sentiment relevance score.
8. The method according to claim 1, further comprising: Identify external factors that influence affective states; as well as The external factors are added to the context.
9. The method according to claim 1, wherein: At least one utterance of the set of utterances is in at least one of the following modalities: text, speech, facial expression, and gesture.
10. The method according to claim 1, further comprising: The candidate responses are presented based on the affective states of the highest-scoring candidate responses.
11. The method according to claim 1, wherein: The scoring is performed by a transfer memory based matching model which is optimized by an additional sentiment classification task during the training process.
12. The method according to claim 1, wherein: The scoring is performed by a transfer memory based matching model trained based on sentiment change magnitude constraints between two adjacent utterances associated with predefined personalities.
13. An apparatus for providing a response in an automated chat, comprising: A message acquisition module is used to obtain messages in the chat stream; a context determination module for determining a context associated with the message, the context comprising a set of utterances, the set of utterances comprising the message; A scoring module is configured to score each candidate response in a set of candidate responses based at least on information changes between the set of utterances and adjacent utterances in the candidate responses, wherein the scoring includes: generating a context interaction representation corresponding to the context based on information changes between every two adjacent utterances in the set of utterances; generating a candidate response interaction representation corresponding to the candidate response based on the set of utterances and information changes between each two adjacent utterances in the candidate response; Obtaining an interaction relevance representation by matching the context interaction representation with the candidate response interaction representation; and generating a relevance score for the candidate response based at least on the interaction relevance representation; and A response providing module is used to provide, in the chat flow, a candidate response with the highest score among the set of candidate responses.
14. The device according to claim 13, wherein: The information change includes at least one of a semantic change and a sentiment change.
15. The device according to claim 14, wherein: The scoring module is further configured to perform at least one of the following: generating a semantic relevance score for the candidate response based at least on semantic variations between the set of utterances and adjacent utterances in the candidate response; as well as A sentiment relevance score for the candidate response is generated based at least on the set of utterances and sentiment variations between adjacent utterances in the candidate response.
16. The apparatus according to claim 13, further comprising: External factor identification module, used to identify external factors that affect the emotional state; as well as An external factor adding module is used to add the external factor to the context.
17. The device according to claim 13, wherein: The scoring module includes a transfer memory-based matching model, which is optimized by adding a sentiment classification task during training.
18. The device according to claim 13, wherein: The scoring module includes a transfer memory-based matching model, which is trained based on a constraint on the magnitude of emotion changes between two adjacent utterances associated with a predefined personality.
19. An apparatus for providing a response in an automated chat, comprising: at least one processor; as well as a memory storing computer executable instructions that, when executed, cause the at least one processor to: Get messages in the chat stream, determining a context associated with the message, the context comprising a set of utterances, the set of utterances comprising the message, For each candidate response in a set of candidate responses, the candidate response is scored based at least on information changes between the set of utterances and adjacent utterances in the candidate response, wherein the scoring comprises: generating a context interaction representation corresponding to the context based on information changes between every two adjacent utterances in the set of utterances; generating a candidate response interaction representation corresponding to the candidate response based on the set of utterances and information changes between each two adjacent utterances in the candidate response; Obtaining an interaction relevance representation by matching the context interaction representation with the candidate response interaction representation; and generating a relevance score for the candidate response based at least on the interaction relevance representation, and A highest-scoring candidate response from the set of candidate responses is provided in the chat stream.
Citation Information
Patent Citations
Forming chatbot output based on user state
CN107870977A
Chat-robot-oriented hybrid strategy type emotional comforting system
CN108960402A
Generating responses in automated chatting
CN109313650A
Providing product recommendation in automated chatting
CN109690602A
Generating responses in automated chatting
CN109844741A
