Session generation method and apparatus

By establishing a dependency graph and utilizing users' historical context-aware data and dialogue data, the system selects higher-priority target dialogues to generate conversation content, thus solving the problem of lack of context awareness in conversation generation methods and improving user satisfaction.

CN118095437BActive Publication Date: 2026-11-17VIVO MOBILE COMM CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410302323.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-15
Publication Date
2026-11-17
Estimated Expiration
2044-03-15

AI Technical Summary

Technical Problem

Existing conversation generation methods lack context-aware features, resulting in monotonous and inflexible conversation content and low user satisfaction.

Method used

By establishing a dependency graph and utilizing users' historical contextual awareness data and dialogue data, the weights of directed edges are determined, thereby selecting the target dialogue with higher importance from multiple dialogues to generate session content.

Benefits of technology

It improves the accuracy of conversation generation and user satisfaction, and the conversation content is more in line with users' conversation habits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118095437B_ABST
    Figure CN118095437B_ABST
Patent Text Reader

Abstract

This application discloses a conversation generation method and apparatus, belonging to the field of communication interaction technology. The method includes: acquiring context-aware data and user-inputted statement information; determining N first nodes from a dependency graph based on the context-aware data and statement information, each first node corresponding to a first dialogue, wherein the dependency graph is established based on the user's historical context-aware data and historical dialogue data, and includes nodes and directed edges connected to the nodes, where N is an integer greater than 1; determining a target dialogue from the N first dialogues based on the weights of the directed edges connected to each of the N first nodes, wherein the weights of the directed edges are used to characterize the importance of the dialogue corresponding to the node; and generating conversation content corresponding to the statement information based on the target dialogue.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of communication and interaction technology, and specifically relates to a session generation method and apparatus. Background Technology

[0002] Conversation generation is a crucial function of AI assistants. Current conversation generation methods lack contextual information from user dialogues or situational awareness features. Each dialogue is relatively isolated, and the information between dialogues is not fully explored. This results in a simplistic and inflexible conversation generation approach, and the conversation content may not be a satisfactory response for the user, leading to low user satisfaction. Summary of the Invention

[0003] The purpose of this application is to provide a session generation method and apparatus that can improve user satisfaction with the generated session content.

[0004] In a first aspect, embodiments of this application provide a session generation method, including:

[0005] Acquire context-aware data and user-inputted statements;

[0006] Based on context-aware data and statement information, N first nodes are determined from the relation dependency graph. Each first node corresponds to a first dialogue. The relation dependency graph is established based on the user's historical context-aware data and historical dialogue data. The relation dependency graph includes nodes and directed edges connected to the nodes. N is an integer greater than 1.

[0007] The target dialogue is determined from the N first dialogues based on the weights of the directed edges connected to each of the N first nodes. The weights of the directed edges are used to characterize the importance of the dialogue corresponding to the node.

[0008] Based on the target dialogue, generate the corresponding session content for the statement information.

[0009] Secondly, embodiments of this application provide a session generation apparatus, the apparatus comprising:

[0010] The first acquisition module is used to acquire context-aware data and user-inputted statement information;

[0011] The first determination module is used to determine N first nodes from the relation dependency graph based on context-aware data and statement information. Each first node corresponds to a first dialogue. The relation dependency graph is established based on the user's historical context-aware data and historical dialogue data. The relation dependency graph includes nodes and directed edges connected to the nodes. N is an integer greater than 1.

[0012] The second determining module is used to determine the target dialogue from the N first dialogues based on the weights of the directed edges connected to each of the N first nodes, wherein the weights of the directed edges are used to characterize the importance of the dialogue corresponding to the node.

[0013] The generation module is used to generate the conversation content corresponding to the statement information based on the target dialogue.

[0014] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions implementing the steps of the method as described in the first or second aspect when executed by the processor.

[0015] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method as described in the first or second aspect.

[0016] Fifthly, embodiments of this application provide a chip, which includes a processor and a communication interface, the communication interface and the processor being coupled together, the processor being used to run programs or instructions to implement the methods of the first or second aspect.

[0017] Sixthly, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method as described in the first or second aspect.

[0018] In this embodiment, a dependency graph can be established based on the user's historical context-aware data and historical dialogue data. Upon obtaining the user's input statement information and the context-aware data at the time of input, multiple first nodes can be matched from the dependency graph. Based on the weights of directed edges that characterize the importance of the dialogue, a more important target dialogue is determined from the first dialogues corresponding to these first nodes. Conversation content corresponding to the statement information is then generated based on this target dialogue. In this way, conversation generation can combine context-aware data and fully leverage the user's historical dialogue data, making the conversation content corresponding to the statement information more consistent with the user's dialogue habits, thereby improving user satisfaction. Attached Figure Description

[0019] Figure 1 This is a flowchart illustrating a session generation method provided in an embodiment of this application;

[0020] Figure 2 This is a schematic diagram of the relationship dependency graph in the session generation method provided in the embodiments of this application;

[0021] Figure 3 This is a schematic diagram of the session vector in the session generation method provided in the embodiments of this application;

[0022] Figure 4 This is a schematic diagram of the user vector in the session generation method provided in the embodiments of this application;

[0023] Figure 5 This is a flowchart illustrating a specific embodiment of the session generation method provided in this application.

[0024] Figure 6 This is a schematic diagram of the structure of the session generation device provided in the embodiments of this application;

[0025] Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0026] Figure 8 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0027] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0028] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0029] The session generation method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0030] Figure 1 This is a flowchart illustrating a session generation method provided in an embodiment of this application. Figure 1 As shown, the session generation method may include the following steps:

[0031] Step 101: Obtain context-aware data and user-inputted statement information.

[0032] In step 101, context-aware data can be used to characterize the perception of the user's environment, including but not limited to at least one of the following: user location, conversation time, user state, user behavior, user's scene, and electronic device status information. The user-inputted statement can refer to a statement that the user expects to receive a response from the AI ​​assistant. The input method can be manual typing or voice input; no specific limitation is made here. For example, the user-inputted statement could be "Have you eaten?".

[0033] It can acquire context-aware data when it receives user input.

[0034] Step 102: Based on context-aware data and statement information, determine N first nodes from the relation dependency graph. Each first node corresponds to a first dialogue. The relation dependency graph is established based on the user's historical context-aware data and historical dialogue data. The relation dependency graph includes nodes and directed edges connected to the nodes. N is an integer greater than 1.

[0035] In step 102, a relationship dependency graph can be established based on the user's historical context-aware data and historical dialogue data. This means that all historical dialogue data corresponding to this user, as well as the historical context-aware data of the dialogues within these historical dialogues at the time they occurred, can be obtained. The dialogues can include the user's questioning statements and the conversational information of the AI ​​assistant's responses. Alternatively, historical dialogue data of this user over a period of time, as well as the historical context-aware data of the dialogues within these historical dialogues at the time they occurred, can be obtained. This period can be set according to specific needs, such as a week, a month, or a year; no specific limitation is made here.

[0036] The nodes of the dependency graph can be determined based on historical context-aware data and historical dialogue data. Each node can correspond to a piece of context-aware data and a dialogue within that context-aware data. The dependency graph also includes directed edges connected to the nodes. For example, the node corresponding to a certain dialogue can point to the node corresponding to the next round of dialogue.

[0037] Based on context-aware data and statement information, N first nodes can be determined from the dependency graph. For example, multiple nodes that are consistent with or similar to the context-aware data can be matched from the dependency graph first, and then N first nodes whose dialogue content is related to the statement information can be determined from these nodes. Alternatively, multiple nodes whose dialogue content is related to the statement information can be matched from the dependency graph first, and then N first nodes that are consistent with or similar to the context-aware data can be determined from these nodes. Matching nodes whose dialogue content is related to the statement information can be based on keyword matching; for example, keywords from the dialogue content and keywords from the statement information can be extracted. If the same keywords exist, the dialogue content can be considered related to the statement information.

[0038] It is understandable that each node in the dependency graph can correspond to a dialogue, so N first nodes can correspond to N first dialogues.

[0039] Step 103: Determine the target dialogue from the N first dialogues based on the weights of the directed edges connected to each of the N first nodes. The weights of the directed edges are used to characterize the importance of the dialogue corresponding to the node.

[0040] In step 103, weights can be assigned to the directed edges connected to each first node. These weights can be assigned based on user presets, browsing information such as the number of views and viewing duration of the dialogue, or dialogue attribute information such as the number of words and keywords in the dialogue content. No specific limitations are imposed here. It is understood that the weight of this directed edge can be used to characterize the importance of the dialogue corresponding to the node.

[0041] The importance of the first dialogue to the user can be determined by the weights of the directed edges connecting the N first nodes. Based on this importance, the target dialogue can then be identified from the N first dialogues. For example, the first dialogue corresponding to the first node with the highest weight of the directed edge can be directly identified as the target dialogue.

[0042] The importance of the first dialogue to the user can also be determined by the probability distribution. That is, the probability distribution of the N first dialogues can be determined according to the weight of the directed edges connecting the N first nodes. The first dialogue that meets the preset conditions can be identified as the target dialogue. For example, the first dialogue with a probability value greater than a preset threshold can be identified as the target dialogue, or the m first dialogues with the highest probability values ​​can be identified as the target dialogue. m can be set according to actual needs.

[0043] Step 104: Generate the conversation content corresponding to the statement information based on the target dialogue.

[0044] In step 104, the target dialogue can be considered as the dialogue that the user is most satisfied with. At this time, the conversation content corresponding to the statement information can be generated based on the target dialogue. For example, the reply content in the target dialogue can be used as the conversation content to reply to the statement information entered by the user.

[0045] The target dialogue can also be multiple dialogues whose probability values ​​meet preset conditions. In this case, the dialogues can be sorted from high to low according to their probability values ​​to generate the dialogue content. For example, the response content in the first dialogue can be used to reply to the user's input. If the user continues the topic, it can be assumed that the user is not satisfied with the response, and then the response content in the second dialogue can be used as the reply content.

[0046] In this embodiment, the session generation method can establish a dependency graph based on the user's historical context-aware data and historical dialogue data. Upon obtaining the user's input statement information and the context-aware data at the time of input, multiple first nodes can be matched from the dependency graph. Based on the weights of directed edges that characterize the importance of the dialogue, a more important target dialogue is determined from the first dialogues corresponding to these first nodes. Session content corresponding to the statement information is then generated based on this target dialogue. In this way, session generation can combine context-aware data and fully leverage the user's historical dialogue data, making the session content corresponding to the statement information more consistent with the user's dialogue habits, thereby improving user satisfaction.

[0047] In some embodiments, prior to step 102 above, the session generation method may further include the following steps:

[0048] Acquire users' historical context-aware data and historical dialogue data. The historical dialogue data includes multiple second dialogues, the generation time sequence of the multiple second dialogues, and browsing information for each second dialogue.

[0049] Using historical context-aware data and multiple second dialogues as nodes, directed edges are established according to the order of the multiple second dialogues to obtain a relational dependency graph;

[0050] Based on the browsing information of each second dialogue, determine the weights of the directed edges in the relation dependency graph.

[0051] In this embodiment, as mentioned above, the user's historical context-aware data and historical dialogue data can be acquired. The historical dialogue data may include multiple second dialogues and the generation time sequence of these second dialogues. For example, all dialogues of the same user can be organized chronologically into historical dialogue data; that is, historical dialogue data includes multiple dialogue inputs made by a user sequentially. For instance, user u completed n multi-turn dialogues v1, v2…v within a certain period. j v k …vn-1 v n Then, the corresponding historical dialogue data S is generated. u =[v1,v2,…,v j ,v k ,…,v n-1 ,v n Historical dialogue data can be used for user vector modeling and can also be used to build dependency graphs between context-aware data and dialogue data.

[0052] Using historical context-aware data and multiple second dialogues as nodes, directed edges can be established according to the order of these second dialogues, pointing from the previous dialogue to the next, thus obtaining a dependency graph. For example... Figure 2 As shown, historical context-aware data can be combined to integrate multiple one-dimensional second dialogues into a two-dimensional graph structure, which can further explore the connection between context-aware data and dialogue data and reduce data sparsity.

[0053] Understandably, in Figure 2 In this context, S = [v2, v5, v1, v6, v3] can be the N first nodes determined from the dependency graph based on context-aware data and statement information in a certain example. That is, v2, v5, v1, v6, and v3 can be the first dialogue.

[0054] Each second dialogue can carry browsing information, which may include browsing duration, number of views, and number of user clicks. Based on the browsing information of each second dialogue, the weights of directed edges in the dependency graph can be determined. For example, regarding the number of views, the more times a second dialogue is viewed, the more important it is to the user, and the higher the weight of the directed edges connected to it. Similarly, regarding browsing duration, the longer the browsing time of a second dialogue, the more important it is to the user, and the higher the weight of the directed edges connected to it.

[0055] In this way, a relationship dependency graph can be built based on the user's historical context-aware data and historical dialogue data to explore the connections between context-aware data and dialogue data, reduce data sparsity, improve the isolation of the conversation, so that context-aware data can be taken into account when generating subsequent conversations, thereby improving the accuracy of conversation generation and improving user satisfaction.

[0056] In some embodiments, prior to step 103 above, the session generation method may further include the following steps:

[0057] Based on the browsing information of the third dialogue, the relative click-through rate of the third dialogue is determined. The relative click-through rate is used to indicate the degree of attention the user pays to the dialogue content. The third dialogue is any one of multiple first dialogues.

[0058] Based on the dependency graph, determine the out-degree and in-degree of the third node, which is the node corresponding to the third dialogue.

[0059] Based on the relative click-through rate, out-degree, and in-degree, determine the out-degree and in-degree matrices of the third node. The weights of directed edges include the out-degree and in-degree matrices.

[0060] In this embodiment, the relative click-through rate of the third dialogue can be determined based on the browsing information of the third dialogue. The browsing information may include the number of views or the duration of the views.

[0061] In some examples, taking browsing information including the number of views as an example, the relative click-through rate of the third dialogue can be determined by the ratio of the number of views of the third dialogue to the total number of views of N first dialogues. In other words, the proportion of the number of views of a certain dialogue content to the total number of views of all dialogues can reflect the degree of attention that dialogue content receives from all dialogues.

[0062] In other examples, taking browsing information including browsing time as an example, in order to measure the importance of the dialogue content to the user, since the dialogue does not contain user and sentiment data features, the user's attention to the dialogue content can be indirectly judged based on the browsing time. If the user's attention to a certain dialogue is high, the browsing time of that dialogue is relatively long and accounts for a high proportion of the total browsing time.

[0063] For example, the relative click-through rate of the third dialogue can be determined by the ratio of the browsing time of the third dialogue to the total browsing time of the N first dialogues. This means that the proportion of browsing time for a particular dialogue content within the total browsing time of all dialogues reflects the level of attention given to that content across all dialogues. This facilitates a more accurate calculation of the weights of the directed edges connected to the corresponding nodes of that dialogue, laying the foundation for session generation. The expression for the relative click-through rate is shown in formula (1):

[0064]

[0065] Where TR(v) j v k ) is the dialogue node v j The relative click-through rate, T(v) j v k (for dialogue v) j Browsing duration, ∑T(v i v i+1 () represents the total browsing time for all conversations.

[0066] Based on the dependency graph, the out-degree and in-degree of the third node corresponding to the third dialogue can be determined. The in-degree of a node is the number of nodes reachable from it via an edge; it can be used to represent the number of times a user clicks on a dialogue corresponding to another node before clicking on the dialogue corresponding to this node within a given time period. Similarly, the out-degree of a node is the number of nodes reachable from it via an edge; it can be used to represent the number of times a user clicks on a dialogue corresponding to this node before clicking on dialogues corresponding to other nodes within a given time period.

[0067] The weights of directed edges can be represented by out-degree and in-degree matrices. Therefore, determining the relationship depends on the weights of directed edges in the graph. The out-degree and in-degree matrices of the third node can be determined based on the relative click-through rate, out-degree, and in-degree.

[0068] The expression for the out-degree matrix can be shown in equation (2):

[0069]

[0070] Among them, a (out) (v j v k ) is the dialogue node v j The out-degree matrix, TR(v j v k ) is the dialogue node v j The relative click-through rate, d (out) (v j ) is the dialogue node v j The degree of departure.

[0071] The expression for the in-degree matrix can be shown in formula (3):

[0072]

[0073] Among them, a (in) (v j v k ) is the dialogue node v j The in-degree matrix, TR(v j v k ) is the dialogue node v j The relative click-through rate, d (in) (v j ) is the dialogue node v j The degree of ingress.

[0074] In this way, by combining browsing information, the relative click-through rate indicating the user's level of attention to the conversation content can be determined. Then, based on this relative click-through rate, and the out-degree and in-degree of the nodes, the out-degree and in-degree matrices can be determined, reflecting the weights of the directed edges in the dependency graph, so that better conversation content can be generated subsequently. In some embodiments, step 103 above may include the following steps:

[0075] Based on the out-degree and in-degree matrices of each of the N first nodes, a graph neural network is used to learn the feature information of each first node in the relation dependency graph, and a conversation vector for the first dialogue corresponding to each first node is generated.

[0076] Based on the session vector of each first dialogue, the target dialogue is determined from N first dialogues.

[0077] In this embodiment, a Graph Neural Network (GNN) can be used to learn nodes in a dependency graph to generate session vectors. For example, for N first dialogues in the dependency graph, a multi-layered GNN can be used to aggregate information from more adjacent dialogues, making the connections between dialogues stronger. Figure 3 As shown, the learning process is as follows:

[0078] It can obtain the dialogue node v at unit time t. i initial vector representation in

[0079] It is understandable that the process of GNN forming node vectors involves propagating information from the vectors of its neighboring nodes to that node and then aggregating it. Based on this, the vectors of each dialogue node at the previous unit time t-1 can be obtained. Obtain the out-degree and in-degree matrices of the dependency graph at unit time t and concatenate them to obtain A = [a (out) ,a (in) The matrix transformation calculation is performed on the dialogue node vector at the previous time t-1 and the relationship dependency graph at the unit time t to obtain the aggregation of the conversation content at the previous time t-1 at the unit time t.

[0080] Based on the forward propagation process of a gated recurrent unit (GRU), the session vector representation for the next time step can be obtained by controlling the old and new session vector representations. For example, the input data at the current time step is combined with the hidden state at the previous time step, and then the on / off state of the input gate is calculated using a sigmoid activation function. This gate controls the degree to which the current input data influences the hidden state at the current time step. The candidate hidden state at the current time step can be calculated using a tanh activation function, representing the influence of the current input data on the hidden state at the current time step. The input data at the current time step can also be combined with the hidden state at the previous time step, and the on / off state of the reset gate can be calculated using a sigmoid activation function. The reset gate controls how the hidden state at the previous time step influences the candidate hidden state at the current time step. The hidden state at the current time step can be updated using the output of the input gate, the output of the reset gate, and the hidden state at the previous time step. In other words, the above steps can be repeated to obtain the hidden state at the current time step, which is then used for prediction and calculation at the next time step.

[0081] The formula for this learning process can be shown below:

[0082]

[0083]

[0084]

[0085]

[0086]

[0087] in, For dialogue node v i The initial vector representation, A is the vector representation of each dialogue node at time (t-1); A is the concatenation of the out-degree and in-degree matrices of the dependency graph, A = [a (out) ,a (in) ]; σ is the sigmoid activation function; ⊙ represents the Hadamard product, i.e., the element-wise product; For dialogue node v i The session vector.

[0088] The target dialogue can be determined from N first dialogues using the session vector of each first dialogue.

[0089] In this way, since user conversation behavior is random, to reduce the impact of noisy conversations on the personalization of the generated conversation results, the relative click time rate of the conversation can be used to generate the relationship dependency graph, resulting in the out-degree matrix and in-degree matrix. Smaller weights are assigned to consecutive unrelated conversations within a short period of time. Then, GNN is used to learn the nodes in the relationship dependency graph, and multi-level neighbor node information is aggregated to generate a conversation vector that can measure the importance of the conversation content to the user. Conversations are generated based on the conversation vector, so that the conversation content corresponding to the statement information can better match the user's conversation habits, thereby improving user satisfaction.

[0090] In some embodiments, determining the target dialogue from N first dialogues based on the session vector of each first dialogue may include the following steps:

[0091] User vectors are generated through an attention mechanism;

[0092] Based on the session vector and user vector of each first dialogue, determine the cosine similarity of each first dialogue;

[0093] The cosine similarity of each first dialogue is normalized to obtain the probability distribution of N first dialogues.

[0094] Based on the probability distribution of N first dialogues, determine the target dialogue from the N first dialogues.

[0095] In this embodiment, the attention mechanism originates from human observation of things; that is, a person's gaze focuses on the key areas of an object to obtain the necessary information, while other irrelevant areas are ignored. The attention mechanism can strengthen or suppress relevant features. It is understandable that users exhibit different interests and preferences at different times. Based on this characteristic, the next conversation content a user focuses on may be closely related to later conversations. Therefore, the attention mechanism can be used to strengthen later conversations.

[0096] This involves using an attention mechanism to first calculate the weights of user session preference features, then summing the features using weighted averages. The larger the weight, the greater its impact on the current result. The formula for calculating the weight factor is α. ni =q(h u ,h i ),like Figure 4 As shown, weighting factors can be applied to the outputs of each graph unit in the attention mechanism, and a linear transformation can be performed to obtain the user vector c. u The expression for the user vector is shown in formula (4):

[0097]

[0098] Among them, c u Let α be the user vector.ni This is the weighting factor.

[0099] The cosine similarity of each first dialogue can be determined based on the session vector and user vector of each first dialogue. The formula for calculating the cosine similarity is shown in formula (5):

[0100]

[0101] in, For dialogue v i cosine similarity, c u For the user vector, e i For dialogue v i The session vector.

[0102] The cosine similarity of each first dialogue can be normalized to obtain the probability distribution of N first dialogues. For example, softmax normalization is performed on the cosine similarity of N first dialogues to form the probability distribution of N first dialogues for predicting the dialogue content. The expression for the normalization process can be shown in formula (6):

[0103]

[0104] It is understandable that, since users' browsing behavior towards dialogue content is limited to either browsing or not browsing, binary cross-entropy can be chosen as the loss function, and the loss function can be shown in formula (7):

[0105]

[0106] in, As the basis for predicting probability, y i This represents the true distribution.

[0107] The target dialogue can be determined from the N first dialogues based on their probability distribution. For example, the first dialogue with the highest probability can be identified as the target dialogue.

[0108] In this way, we can combine the conversation vector used to measure the importance of the dialogue content to the user, and the user vector used to represent the user's conversation preference features, perform cosine similarity calculation, and then perform normalization to form a probability distribution for predicting the conversation content, thereby generating the optimal conversation content and further improving user satisfaction.

[0109] To facilitate understanding of the session generation method provided in the above embodiments, the following describes the session generation method using a specific scenario embodiment. Figure 5 This is a schematic flowchart of a scenario embodiment of the session generation method provided in this application.

[0110] This scenario implementation example may specifically include the following steps:

[0111] Step 501: Obtain context-aware data and user-inputted statement information as input data.

[0112] Step 502: Establish a dependency graph between the user's context-aware data and dialogue data.

[0113] Step 503: Combine the relative click-through rate of the conversation to measure the importance of the conversation content to the user.

[0114] Step 504: Use GNN to learn the nodes of the relation dependency graph and generate session vectors.

[0115] Step 505: Combine attention mechanism to generate user vectors.

[0116] Step 506: Calculate the cosine similarity between the session vector and the user vector, and perform softmax normalization to generate the optimal session content.

[0117] The session generation method provided in this application can be executed by a session generation device. This application uses a session generation device executing the session generation method as an example to illustrate the session generation device provided in this application.

[0118] like Figure 6 As shown in the illustration, this application also provides a session generation apparatus 600, which may include:

[0119] The first acquisition module 601 is used to acquire context-aware data and user-inputted statement information;

[0120] The first determining module 602 is used to determine N first nodes from the relation dependency graph based on context-aware data and statement information. Each first node corresponds to a first dialogue. The relation dependency graph is established based on the user's historical context-aware data and historical dialogue data. The relation dependency graph includes nodes and directed edges connected to the nodes. N is an integer greater than 1.

[0121] The second determining module 603 is used to determine the target dialogue from the N first dialogues based on the weights of the directed edges connected to each of the N first nodes, wherein the weights of the directed edges are used to characterize the importance of the dialogue corresponding to the node.

[0122] The generation module 604 is used to generate the conversation content corresponding to the statement information based on the target dialogue.

[0123] In this embodiment, a dependency graph can be established based on the user's historical context-aware data and historical dialogue data. Upon obtaining the user's input statement information and the context-aware data at the time of input, multiple first nodes can be matched from the dependency graph. Based on the weights of directed edges that characterize the importance of the dialogue, a more important target dialogue is determined from the first dialogues corresponding to these first nodes. Conversation content corresponding to the statement information is then generated based on this target dialogue. In this way, conversation generation can combine context-aware data and fully leverage the user's historical dialogue data, making the conversation content corresponding to the statement information more consistent with the user's dialogue habits, thereby improving user satisfaction.

[0124] In some embodiments, the session generation apparatus 600 may further include:

[0125] The second acquisition module is used to acquire the user's historical context-aware data and historical dialogue data. The historical dialogue data includes multiple second dialogues, the generation time order of the multiple second dialogues, and browsing information for each second dialogue.

[0126] A module is built to create a relational dependency graph by using historical context-aware data and multiple second dialogues as nodes and establishing directed edges according to the order of the multiple second dialogues.

[0127] The third determination module is used to determine the weights of directed edges in the relation dependency graph based on the browsing information of each second dialogue.

[0128] In this way, a relationship dependency graph can be built based on the user's historical context-aware data and historical dialogue data to explore the connections between context-aware data and dialogue data, reduce data sparsity, improve the isolation of the conversation, so that context-aware data can be taken into account when generating subsequent conversations, thereby improving the accuracy of conversation generation and improving user satisfaction.

[0129] In some embodiments, the session generation apparatus 600 may further include:

[0130] The fourth determining module is used to determine the relative click-through rate of the third dialogue based on the browsing information of the third dialogue. The relative click-through rate is used to indicate the degree of attention the user pays to the dialogue content. The third dialogue is any one of multiple first dialogues.

[0131] The fifth determination module is used to determine the out-degree and in-degree of the third node based on the dependency graph. The third node is the node corresponding to the third dialogue.

[0132] The sixth determination module is used to determine the out-degree matrix and in-degree matrix of the third node based on the relative click time rate, out-degree, and in-degree. The weights of the directed edges include the out-degree matrix and in-degree matrix.

[0133] In this way, by combining browsing information, the relative click-through rate that indicates the user's level of attention to the dialogue content can be determined. Then, based on the relative click-through rate and the out-degree and in-degree of the nodes, the out-degree matrix and in-degree matrix can be determined to reflect the weights of the directed edges in the relational dependency graph, so that better conversation content can be generated subsequently.

[0134] In some embodiments, the second determining module 603 can also be used for:

[0135] Based on the out-degree and in-degree matrices of each of the N first nodes, a graph neural network is used to learn the feature information of each first node in the relation dependency graph, and a conversation vector for the first dialogue corresponding to each first node is generated.

[0136] Based on the session vector of each first dialogue, the target dialogue is determined from N first dialogues.

[0137] In this way, since user conversation behavior is random, to reduce the impact of noisy conversations on the personalization of the generated conversation results, the relative click time rate of the conversation can be used to generate the relationship dependency graph, resulting in the out-degree matrix and in-degree matrix. Smaller weights are assigned to consecutive unrelated conversations within a short period of time. Then, GNN is used to learn the nodes in the relationship dependency graph, and multi-level neighbor node information is aggregated to generate a conversation vector that can measure the importance of the conversation content to the user. Conversations are generated based on the conversation vector, so that the conversation content corresponding to the statement information can better match the user's conversation habits, thereby improving user satisfaction.

[0138] In some embodiments, the second determining module 603 can also be used for:

[0139] User vectors are generated through an attention mechanism;

[0140] Based on the session vector and user vector of each first dialogue, determine the cosine similarity of each first dialogue;

[0141] The cosine similarity of each first dialogue is normalized to obtain the probability distribution of N first dialogues.

[0142] Based on the probability distribution of N first dialogues, determine the target dialogue from the N first dialogues.

[0143] In this way, we can combine the conversation vector used to measure the importance of the dialogue content to the user, and the user vector used to represent the user's conversation preference features, perform cosine similarity calculation, and then perform normalization to form a probability distribution for predicting the conversation content, thereby generating the optimal conversation content and further improving user satisfaction.

[0144] The session generation device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0145] The session generation device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.

[0146] The session generation device provided in this application embodiment can achieve... Figures 1 to 4 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0147] Optionally, such as Figure 7 As shown, this application embodiment also provides an electronic device 700, including a processor 701 and a memory 702. The memory 702 stores a program or instructions that can run on the processor 701. When the program or instructions are executed by the processor 701, they implement the various steps of the above-described session generation method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0148] It should be noted that the electronic devices in the embodiments of this application include the aforementioned mobile electronic devices and non-mobile electronic devices.

[0149] Figure 8 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.

[0150] The electronic device 800 includes, but is not limited to, components such as: radio frequency unit 801, network module 802, audio output unit 803, input unit 804, sensor 805, display unit 806, user input unit 807, interface unit 808, memory 809, and processor 810.

[0151] Those skilled in the art will understand that the electronic device 800 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 810 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 8 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0152] The processor 810 can be used for:

[0153] Acquire context-aware data and user-inputted statements;

[0154] Based on context-aware data and statement information, N first nodes are determined from the relation dependency graph. Each first node corresponds to a first dialogue. The relation dependency graph is established based on the user's historical context-aware data and historical dialogue data. The relation dependency graph includes nodes and directed edges connected to the nodes. The weight of the directed edges is used to characterize the importance of the dialogue corresponding to the node to the user. N is an integer greater than 1.

[0155] The target dialogue is determined from the N first dialogues based on the weights of the directed edges connected to each of the N first nodes. The weights of the directed edges are used to characterize the importance of the dialogue corresponding to the node.

[0156] Based on the target dialogue, generate the corresponding session content for the statement information.

[0157] In this embodiment, a dependency graph can be established based on the user's historical context-aware data and historical dialogue data. Upon obtaining the user's input statement information and the context-aware data at the time of input, multiple first nodes can be matched from the dependency graph. Based on the weights of directed edges that characterize the importance of the dialogue, a more important target dialogue is determined from the first dialogues corresponding to these first nodes. Conversation content corresponding to the statement information is then generated based on this target dialogue. In this way, conversation generation can combine context-aware data and fully leverage the user's historical dialogue data, making the conversation content corresponding to the statement information more consistent with the user's dialogue habits, thereby improving user satisfaction.

[0158] In some embodiments, the processor 810 may also be used for:

[0159] Acquire users' historical context-aware data and historical dialogue data. The historical dialogue data includes multiple second dialogues, the generation time sequence of the multiple second dialogues, and browsing information for each second dialogue.

[0160] Using historical context-aware data and multiple second dialogues as nodes, directed edges are established according to the order of the multiple second dialogues to obtain a relational dependency graph;

[0161] Based on the browsing information of each second dialogue, determine the weights of the directed edges in the relation dependency graph.

[0162] In this way, a relationship dependency graph can be built based on the user's historical context-aware data and historical dialogue data to explore the connections between context-aware data and dialogue data, reduce data sparsity, improve the isolation of the conversation, so that context-aware data can be taken into account when generating subsequent conversations, thereby improving the accuracy of conversation generation and improving user satisfaction.

[0163] In some embodiments, the processor 810 may also be used for:

[0164] Based on the browsing information of the third dialogue, the relative click-through rate of the third dialogue is determined. The relative click-through rate is used to indicate the degree of attention the user pays to the dialogue content. The third dialogue is any one of multiple first dialogues.

[0165] Based on the dependency graph, determine the out-degree and in-degree of the third node, which is the node corresponding to the third dialogue.

[0166] Based on the relative click-through rate, out-degree, and in-degree, determine the out-degree and in-degree matrices of the third node. The weights of directed edges include the out-degree and in-degree matrices.

[0167] In this way, by combining browsing information, the relative click-through rate that indicates the user's level of attention to the dialogue content can be determined. Then, based on the relative click-through rate and the out-degree and in-degree of the nodes, the out-degree matrix and in-degree matrix can be determined to reflect the weights of the directed edges in the relational dependency graph, so that better conversation content can be generated subsequently.

[0168] In some embodiments, the processor 810 may also be used for:

[0169] Based on the out-degree and in-degree matrices of each of the N first nodes, a graph neural network is used to learn the feature information of each first node in the relation dependency graph, and a conversation vector for the first dialogue corresponding to each first node is generated.

[0170] Based on the session vector of each first dialogue, the target dialogue is determined from N first dialogues.

[0171] In this way, since user conversation behavior is random, to reduce the impact of noisy conversations on the personalization of the generated conversation results, the relative click time rate of the conversation can be used to generate the relationship dependency graph, resulting in the out-degree matrix and in-degree matrix. Smaller weights are assigned to consecutive unrelated conversations within a short period of time. Then, GNN is used to learn the nodes in the relationship dependency graph, and multi-level neighbor node information is aggregated to generate a conversation vector that can measure the importance of the conversation content to the user. Conversations are generated based on the conversation vector, so that the conversation content corresponding to the statement information can better match the user's conversation habits, thereby improving user satisfaction.

[0172] In some embodiments, the processor 810 may also be used for:

[0173] User vectors are generated through an attention mechanism;

[0174] Based on the session vector and user vector of each first dialogue, determine the cosine similarity of each first dialogue;

[0175] The cosine similarity of each first dialogue is normalized to obtain the probability distribution of N first dialogues.

[0176] Based on the probability distribution of N first dialogues, determine the target dialogue from the N first dialogues.

[0177] In this way, we can combine the conversation vector used to measure the importance of the dialogue content to the user, and the user vector used to represent the user's conversation preference features, perform cosine similarity calculation, and then perform normalization to form a probability distribution for predicting the conversation content, thereby generating the optimal conversation content and further improving user satisfaction.

[0178] It should be understood that, in this embodiment, the input unit 804 may include a graphics processing unit (GPU) 8041 and a microphone 8042. The GPU 8041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 806 may include a display panel 8061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 807 includes at least one of a touch panel 8071 and other input devices 8072. The touch panel 8071 is also called a touch screen. The touch panel 8071 may include a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.

[0179] The memory 809 can be used to store software programs and various data. The memory 809 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 809 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 809 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.

[0180] Processor 810 may include one or more processing units; optionally, processor 810 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 810.

[0181] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described session generation method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0182] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0183] This application also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described session generation method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0184] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0185] This application provides a computer program product that is stored in a storage medium and executed by at least one processor to implement the various processes of the session generation method embodiment described above, and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0186] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0187] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0188] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A session generation method, characterized in that, include: Acquire the user's historical context-aware data and historical dialogue data, wherein the historical dialogue data includes multiple second dialogues, the generation time order of the multiple second dialogues, and browsing information for each second dialogue; Using the historical context-aware data and the multiple second dialogues as nodes, directed edges are established according to the generation time order of the multiple second dialogues to obtain a relational dependency graph; Based on the browsing information of each second dialogue, determine the weight of the directed edges in the relation dependency graph; Acquire context-aware data and user-inputted statements; Based on the context-aware data and the statement information, N first nodes are determined from the relation dependency graph, each first node corresponding to a first dialogue. The relation dependency graph is established based on the user's historical context-aware data and historical dialogue data. The relation dependency graph includes nodes and directed edges connected to the nodes, and N is an integer greater than 1. The target dialogue is determined from the N first dialogues based on the weights of the directed edges connected to each of the N first nodes, wherein the weights of the directed edges are used to characterize the importance of the dialogue corresponding to the node. Based on the target dialogue, generate the session content corresponding to the statement information.

2. The method according to claim 1, characterized in that, Before determining the target dialogue from the N first dialogues based on the weights of the directed edges connecting each of the N first nodes, the method further includes: Based on the browsing information of the third dialogue, the relative click-through rate of the third dialogue is determined. The relative click-through rate is used to indicate the degree of attention the user pays to the dialogue content. The third dialogue is any one of the plurality of first dialogues. Based on the relationship dependency graph, determine the out-degree and in-degree of the third node, where the third node is the node corresponding to the third dialogue; Based on the relative click-through rate, the out-degree, and the in-degree, the out-degree matrix and in-degree matrix of the third node are determined, and the weight of the directed edge includes the out-degree matrix and the in-degree matrix.

3. The method according to claim 2, characterized in that, The step of determining the target dialogue from the N first dialogues based on the weights of the directed edges connecting each of the N first nodes includes: Based on the out-degree and in-degree matrices of each of the N first nodes, a graph neural network is used to learn the feature information of each first node in the relation dependency graph, and a conversation vector for the first dialogue corresponding to each first node is generated. The target dialogue is determined from the N first dialogues based on the session vector of each first dialogue.

4. The method according to claim 3, characterized in that, The step of determining the target dialogue from the N first dialogues based on the session vector of each first dialogue includes: User vectors are generated through an attention mechanism; Based on the session vector of each first dialogue and the user vector, determine the cosine similarity of each first dialogue; The cosine similarity of each of the first dialogues is normalized to obtain the probability distribution of the N first dialogues. Based on the probability distribution of the N first dialogues, the target dialogue is determined from the N first dialogues.

5. A session generation apparatus, characterized in that, include: The second acquisition module is used to acquire the user's historical context-aware data and historical dialogue data. The historical dialogue data includes multiple second dialogues, the generation time order of the multiple second dialogues, and browsing information for each second dialogue. A module is established to create a relational dependency graph by using the historical context-aware data and the multiple second dialogues as nodes and establishing directed edges according to the generation time order of the multiple second dialogues. The third determining module is used to determine the weight of the directed edges in the relation dependency graph based on the browsing information of each second dialogue. The first acquisition module is used to acquire context-aware data and user-inputted statement information; The first determining module is used to determine N first nodes from the relation dependency graph based on the context-aware data and the statement information, each first node corresponding to a first dialogue, wherein the relation dependency graph is established based on the user's historical context-aware data and historical dialogue data, the relation dependency graph includes nodes and directed edges connected to the nodes, and N is an integer greater than 1. The second determining module is used to determine the target dialogue from the N first dialogues based on the weight of the directed edges connected to each of the N first nodes, wherein the weight of the directed edges is used to characterize the importance of the dialogue corresponding to the node. The generation module is used to generate the conversation content corresponding to the statement information based on the target dialogue.

6. The apparatus according to claim 5, characterized in that, The device further includes: The fourth determining module is used to determine the relative click time rate of the third dialogue based on the browsing information of the third dialogue. The relative click time rate is used to indicate the degree of attention the user pays to the dialogue content. The third dialogue is any one of the plurality of first dialogues. The fifth determining module is used to determine the out-degree and in-degree of the third node based on the relation dependency graph, wherein the third node is the node corresponding to the third dialogue; The sixth determining module is used to determine the out-degree matrix and in-degree matrix of the third node based on the relative click time rate, the out-degree, and the in-degree, wherein the weight of the directed edge includes the out-degree matrix and the in-degree matrix.

7. The apparatus according to claim 6, characterized in that, The second determining module is also used for: Based on the out-degree and in-degree matrices of each of the N first nodes, a graph neural network is used to learn the feature information of each first node in the relation dependency graph, and a conversation vector for the first dialogue corresponding to each first node is generated. The target dialogue is determined from the N first dialogues based on the session vector of each first dialogue.

8. The apparatus according to claim 7, characterized in that, The second determining module is also used for: User vectors are generated through an attention mechanism; Based on the session vector of each first dialogue and the user vector, determine the cosine similarity of each first dialogue; The cosine similarity of each of the first dialogues is normalized to obtain the probability distribution of the N first dialogues. Based on the probability distribution of the N first dialogues, the target dialogue is determined from the N first dialogues.

Citation Information

Patent Citations

  • Session method and device based on session graph, equipment and storage medium

    CN117609453A