Method and apparatus for assisting conversation

By constructing a directed graph of session state nodes across sessions, combining graph neural networks and recurrent neural networks, the problem of insufficient information in single session management is solved, and more accurate session state node transfer is achieved, which improves the action recommendation effect in real estate transactions.

CN114647714BActive Publication Date: 2025-08-26KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210328601.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-30
Publication Date
2025-08-26
Estimated Expiration
2042-03-30

AI Technical Summary

Technical Problem

In the intelligent dialogue assistant, the single-session-based conversation management method lacks information during the business opportunity generation stage of real estate transactions, resulting in general accuracy of action recommendations and the inability to effectively utilize the user's historical conversation and portrait information.

Method used

By constructing a directed graph of session state nodes across sessions, using the graph neural network model and recurrent neural network model, combining the information of the current session and historical session, the transfer relationship between session state nodes is re-determined, and the next session state node is filtered out.

Benefits of technology

Improve the accuracy when determining the next session state node, and use more historical information to assist conversations, improving the accuracy of action recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114647714B_ABST
    Figure CN114647714B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a method and apparatus for assisting conversations. The method includes: obtaining historical conversations conducted by a current user of a current conversation within a preset time period; constructing a directed graph of session state nodes across sessions to obtain a first directed graph of session state nodes; obtaining a first node vector for each session state node in the first directed graph of session state nodes; reconstructing the directed graph of session state nodes across sessions to obtain a second directed graph of session state nodes; and, based on the second directed graph of session state nodes and in combination with the first node vector, screening candidate session state nodes in a preset set of session state nodes to determine the next session state node of the current session's current session. In this way, the accuracy of the determined next session state node is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to a method and apparatus for assisting conversation. Background Art

[0002] In intelligent conversational assistants, all applications are based on single-session conversation management. The so-called single-session refers to considering only the conversation initiated by the current user in an IM chat window. In the scenario of intelligent customer service, when helping agents answer users' questions, relying solely on the current conversation to assist agents in selecting corresponding actions often has limited effect.

[0003] In typical conversational scenarios, robot-based recommendations rely not only on information from the current session but also on the user profile information from that session. However, during the opportunity generation phase of real estate transactions, conversational information is scarce, and user profile information is difficult to utilize. Consequently, robot action recommendation methods based on a single conversation rely on limited information, resulting in limited accuracy in recommended actions. Summary of the Invention

[0004] An object of the embodiments of the present invention is to provide a method and apparatus for assisting conversation, which can solve or at least partially solve the above-mentioned problems.

[0005] To achieve the above objectives, one aspect of an embodiment of the present invention provides a method for assisting a conversation, the method comprising: obtaining historical conversations of a current user conducting a current conversation within a preset time period; constructing a cross-session session state node directed graph for the session state nodes included in the current conversation and the historical conversations in chronological order based on a preset transfer rule for session state node transfer, to obtain a first session state node directed graph; inputting the first session state node directed graph into a first preset graph neural network model to obtain a first node vector for each session state node in the first session state node directed graph, wherein the first node vector of the session state node reflects global information of the session state node; re-determining, for the session state nodes in the first session state node directed graph, based on the first node vector, transition relationships between the session state nodes to re-construct a cross-session session state node directed graph to obtain a second session state node directed graph; and screening candidate session state nodes in a preset session state node set based on the second session state node directed graph and in combination with the first node vector to determine a next session state node of the current session.

[0006] Optionally, for the session state nodes in the first session state node directed graph, re-determining the transition relationship between the session state nodes based on the first node vector to reconstruct the cross-session session state node directed graph to obtain the second session state node directed graph includes: determining, based on the preset transition rule, the start session state node of the second session state node directed graph among the session state nodes included in the first session state node directed graph; and for any start session state node in the second session state node directed graph, performing the following operations to construct the second session state node directed graph: determining, in combination with the first node vector, the closeness of the relationship between each session state node in the first session state node directed graph except the start session state node and the start session state node; determining, based on the determined closeness of the relationship, whether the start session state node has a next session state node; and, if the start session state node has the next session state node, repeating the process of determining the closeness of the relationship and determining whether there is a next session state node based on the next session state node of the start session state node, until the session state node for which the next session state node is to be determined does not have a next session state node.

[0007] Optionally, the method further includes: assigning weights to the in-degree session state nodes and / or out-degree session state nodes of each of the session state nodes in the directed graph of the first session state node based on an attention mechanism, wherein the determination of the closeness of the relationship is also combined with the weight of the in-degree session state node and / or the weight of the out-degree session state node.

[0008] Optionally, screening the candidate session state nodes in the preset session state node set based on the second session state node directed graph in combination with the first node vector to determine the next session state node of the current session state node includes: based on the session state node transfer path in the second session state node directed graph, combined with the first node vector of the session state node, evaluating the possibility that any of the candidate session state nodes in the preset session state node set is the next session state node of the current session state node; and screening the candidate session state nodes in the preset session state node set according to the evaluation result to determine the next session state node of the current session state node.

[0009] Optionally, for any of the candidate session state nodes in the preset session state node set, evaluating the possibility that the candidate session state node is the next session state node of the current session state node includes: determining a path score for any of the session state node transfer paths in combination with the first node vector of the session state node; and determining, based on the path scores corresponding to all of the session state node transfer paths, an evaluation score corresponding to the candidate session state node being the next session state node of the current session state node, so as to evaluate the possibility that the candidate session state node is the next session state node of the current session state node, wherein screening the candidate session state nodes in the preset session state node set according to the evaluation result includes screening the candidate session state nodes according to the evaluation scores, wherein the candidate session state node corresponding to the highest evaluation score is the next session state node of the current session state node.

[0010] Optionally, determining the path score for any of the session state node transfer paths in combination with the first node vector of the session state node includes: determining, in combination with the first node vector, the closeness of the path relationship between the session state nodes other than the no-out-degree session state node in the session state node transfer path and the no-out-degree session state node; and determining the path score according to a preset scoring formula in combination with the closeness of the path relationship, the first node vector of the no-out-degree session state node, and the first node vector of the to-be-selected session state node.

[0011] Optionally, the preset scoring formula includes: in, The first node vector representing the session state node with no out-degree in the session state node transition path α, represents the closeness of the path relationship corresponding to the session state node transfer path α, w n and w s represents weight, σ represents ReLU function, V β The first node vector y represents the session state node β to be selected in the preset session state node set. αβ represents the path score corresponding to the session state node transfer path α for the candidate session state node β.

[0012] Optionally, the method further includes: inputting the first node vector of each session state node in the first session state node directed graph into a second preset recurrent neural network model to obtain a second node vector for each session state node, wherein the second node vector of each session state node reflects global information about the session state node, and wherein the first node vector is replaced with the second node vector when the first node vector is used.

[0013] Optionally, the method further includes: in a case where the selected session state node obtained by screening is a question intention state node, based on the preset transfer rule, mapping the selected session state node obtained by screening to a reply action state node, wherein the mapped reply action state node is the next session state node of the current session state node.

[0014] Accordingly, another aspect of an embodiment of the present invention provides a device for assisting conversations, the device comprising: a historical conversation acquisition module for acquiring historical conversations conducted by a current user of a current conversation within a preset time period; a first conversation state node directed graph acquisition module for constructing a cross-session conversation state node directed graph for the conversation state nodes included in the current conversation and the historical conversation based on a preset transfer rule for the conversation state node transfer, in accordance with the time sequence of the current conversation and the historical conversation, to obtain a first conversation state node directed graph; a first node vector acquisition module for inputting the first conversation state node directed graph into a first preset graph neural network model to obtain a first node vector of each node in the first conversation state node directed graph. A first node vector of a session state node, wherein the first node vector of the session state node reflects global information of the session state node; a second session state node directed graph obtaining module, configured to, for the session state nodes in the first session state node directed graph, redetermine, based on the first node vector, the transfer relationship between the session state nodes, so as to reconstruct the cross-session session state node directed graph to obtain a second session state node directed graph; and a screening module, configured to screen, based on the second session state node directed graph and in combination with the first node vector, candidate session state nodes in a preset session state node set, so as to determine the next session state node of the current session session.

[0015] In addition, another aspect of an embodiment of the present invention further provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the above method.

[0016] In addition, another aspect of an embodiment of the present invention further provides a processor for running a program, wherein the program is used to execute the above method when being run.

[0017] In addition, another aspect of an embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the above method when executed by a processor.

[0018] Through the above technical solution, in combination with the current session and the historical session, a first session state node directed graph is constructed, and the session state node directed graph is reconstructed for the session state nodes in the first session state node directed graph to obtain a second session state node directed graph, wherein the second session state node directed graph disrupts the transfer order between the session state nodes included in the first session state node directed graph, and the second session state node directed graph constructs a transfer order between the session state nodes across sessions, and then determines the next session state node of the current session state node based on the second session state node directed graph. In this way, auxiliary conversations across sessions are realized, so that more information can be relied upon when determining the next session state node to assist the conversation, thereby improving the accuracy of the determined next session state node.

[0019] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following detailed description, they are used to explain the embodiments of the present invention, but do not constitute a limitation of the embodiments of the present invention. In the accompanying drawings:

[0021] Figure 1 is a flow chart of a method for assisting conversation provided by an embodiment of the present invention;

[0022] Figure 2 is a schematic diagram of a preset transfer rule provided by another embodiment of the present invention;

[0023] Figure 3 is a schematic diagram of a first session state node directed graph provided by another embodiment of the present invention;

[0024] Figure 4 is a schematic diagram of a directed graph of session state nodes of a single session provided by another embodiment of the present invention;

[0025] Figure 5 is a logic diagram of a method for assisting conversation provided by another embodiment of the present invention;

[0026] Figure 6 is a schematic diagram of the network structure of an LSTM model provided by another embodiment of the present invention; and

[0027] Figure 7This is a structural block diagram of a device for assisting conversation provided by another embodiment of the present invention. DETAILED DESCRIPTION

[0028] The following describes the specific implementation of the embodiment of the present invention in detail with reference to the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the embodiment of the present invention and is not used to limit the embodiment of the present invention.

[0029] During an intelligent conversation, the interaction between the user and the broker is a state transition process, and the user's state transition depends on the broker's actions. During the business opportunity generation stage, the user's problem description is diverse and discontinuous, and it may be necessary to contact more brokers to obtain the information they want. The user will consult many different brokers for basic information, and there is an indirect cooperative relationship between these brokers. Among them, a business opportunity can be a business opportunity generated by entering a conversation from the property details page. However, for the broker, the broker only communicates with the user in the current conversation. The broker cannot obtain much effective information from the user's scattered demand consultation. The broker only relies on the content of the current short conversation and cannot fully understand the user's needs. The process of closing a real estate transaction is originally a scenario where different brokers cooperate with each other. In single-session management, the advantages of cooperative conversations are not utilized. Therefore, the embodiment of the present invention provides a technical solution for assisted conversation based on cross-session.

[0030] One aspect of an embodiment of the present invention provides a method for assisting a conversation.

[0031] Figure 1 FIG. 1 is a flow chart of a method for assisting conversation provided by an embodiment of the present invention. Figure 1 As shown, the method includes the following contents.

[0032] In step S10, historical sessions of the current user who is currently in the current session within a preset time period are obtained. For example, sessions initiated within two weeks prior to the initiation of the current session are obtained as historical sessions, where the current session and historical sessions are from the same user. It should be understood that the embodiments of the present disclosure do not limit the method for obtaining historical sessions, such as obtaining with the user's authorization. Furthermore, it should be understood that in the embodiments of the present disclosure, analyzing the obtained historical sessions and the current session and providing services such as recommendations and predictions to the user are also performed with the user's authorization.

[0033] In step S11, based on the preset transfer rules for session state node transfer, a cross-session session state node directed graph is constructed for the session state nodes included in the current session and the historical session in the time sequence to obtain a first session state node directed graph. The preset transfer rules describe the order of transfers between session state nodes and the transfer probability between two session state nodes, for example, Figure 2 As shown, a preset transfer rule is shown, wherein, Figure 2 Applicable to real estate transactions. In addition, a session state node is a node in a directed graph that expresses one party in the corresponding session process, and corresponds to the session state. In the following, the preset transfer rules and session state nodes are described in detail. In addition, the session state node directed graph of a single session describes the transfer relationship between the session state nodes corresponding to a single session. In addition to describing the transfer relationship between the session state nodes corresponding to a single session, the first session state node directed graph also includes the transfer relationship between the session state nodes across sessions. In the first session state node directed graph, transfer links are established between the session state nodes that can be transferred across sessions obtained according to the preset transfer rules in chronological order. For example, Figure 3 As shown, Figure 3 The figure shows a directed graph of the first session state nodes, where the current session is session 4, and the historical sessions are session 1, session 2, and session 3. Figure 3 Node 1, Node 2, Node 3, Node 4, Node 5, Start and End are the session state nodes in the embodiment of the present invention, and Node 5 in Session 4 is the current session state node. Figure 3 The first session state node directed graph shown in the figure is used as an example to illustrate how to construct the first session state node directed graph. The first session state node directed graph is a cross-session directed graph. The cross-session directed graph is constructed based on a single session. We select the sessions initiated within two weeks before the current session is initiated as the historical sessions of the current session. Figure 3 In the example, the nodes are represented as session 1, session 2, session 3, and session 4. When constructing the directed graph of the first session state nodes, sessions 1, 2, 3, and 4 are arranged in chronological order, and a transition link is determined between two adjacent sessions in chronological order according to the preset transition rule. In the preset transition rule, if there is a transition between node 1 of session 1 and node 2 of session 2 and the transition probability is greater than a preset transition probability threshold, for example, the preset transition probability threshold may be 0.6, then a transition link may be established between node 1 of session 1 and node 2 of session 2, as shown in FIG. Figure 3Based on the above content, the session data of the two weeks before the current time is traversed, and combined with the preset transfer rules, it is checked whether all two adjacent sessions in chronological order can be linked to each other, so as to construct a directed graph of the first session state nodes.

[0034] In step S12, the first session state node directed graph is input into a first preset graph neural network model to obtain a first node vector for each session state node in the first session state node directed graph, wherein the first node vector of the session state node reflects global information of the session state node. For example, global information may be information reflecting global information such as the node's in-degree in the entire graph, the node's importance, and the node's position in the graph. That is, the first node vector obtained by the graph neural network can enable the node representation to reflect global information such as the node's in-degree in the entire graph, the node's importance, and the node's position in the graph. For example, the first preset graph neural network model may be a GNN model.

[0035] In step S13, for the session state nodes in the first session state node directed graph, based on the first node vector, the transfer relationship between the session state nodes is re-determined, and the cross-session session state node directed graph is reconstructed to obtain a second session state node directed graph.

[0036] In step S14, based on the second session state node directed graph and in combination with the first node vector, the candidate session state nodes in the preset session state node set are screened to determine the next session state node of the current session.

[0037] Through the above technical solution, in combination with the current session and the historical session, a first session state node directed graph is constructed, and the session state node directed graph is reconstructed for the session state nodes in the first session state node directed graph to obtain a second session state node directed graph, wherein the second session state node directed graph disrupts the transfer order between the session state nodes included in the first session state node directed graph, and the second session state node directed graph constructs a transfer order between the session state nodes across sessions, and then determines the next session state node of the current session state node based on the second session state node directed graph. In this way, auxiliary conversations across sessions are realized, so that more information can be relied upon when determining the next session state node to assist the conversation, thereby improving the accuracy of the determined next session state node.

[0038] In an embodiment of the present invention, a session state node is a node in a directed graph that represents a party in a conversation and corresponds to a session state. The session state can be determined based on the content of the conversation and may include, for example, a start session state (corresponding to the initial entry into a conversation), an end session state (corresponding to the end of a conversation), a question intention state (for example, if the user and the agent do not continue the conversation, all states will end), and a reply action state (for example, the action type given by the agent in replying to the user's question is defined as a reply action state). Accordingly, a session state node may include a start session state node, an end session state node, a question intention state node, and a reply action state node. During a conversation, one party solves their own problem by asking questions, while the other party solves the other party's problem by answering questions. Therefore, there are a questioner and a replyer. The node for the initial entry into a conversation is a start session state node, and the node for the end of a conversation is an end session state node. In addition to the start state node and the end state node, the node corresponding to the questioner is a question intention state node (for example, if a user identifies the corresponding intention when asking a question, we define this intention as the user's question intention state), and the node corresponding to the replyer is a reply action state node. Furthermore, session state transition refers to the alternating transitions between the session state of one party and the session state of another party during a conversation. For example, the interaction between the questioner and the answerer is the alternating transition between the question intention state and the answer action state. Correspondingly, the transition between session state nodes is the transition from one session state node to the other. The transition probability between two session state nodes refers to the probability of transitioning from one session state node to the other. For example, the transition probability can be the statistical probability of transitions between the user's question intention state node and the agent's answer action state node. The following uses the conversation between a user and an agent during a real estate transaction as an example to illustrate session states. Session states are determined by the content of the conversation, as shown in Table 1. In this example, the conversation begins when the user sends a property listing. Sending the property listing corresponds to the starting state. The remaining user states correspond to the question intention state, while the agent states correspond to the answer action state.

[0039] Table 1

[0040]

[0041] In the embodiment of the present invention, the preset transfer rule describes the order of transfer between session state nodes and the transfer probability between two session state nodes. Figure 2 As shown, a preset transfer rule is shown, wherein, Figure 2Applicable to real estate transactions. In addition, the preset transfer rules are pre-established. For example, the preset transfer rules can be constructed with reference to a single session with successful communication. In different session scenarios, the definition of successful communication is different, and can be set according to the specific session scenario. For example, in the process of real estate transactions, the successful transfer of delegation between the user and the broker is used to characterize the success of the communication, wherein the successful transfer of delegation can be the broker successfully obtaining the user's contact information. Specifically, the single session with successful communication is abstracted into a session state node directed graph based on the session state, and the node out-degree ratio is statistically calculated based on the session state node directed graph corresponding to a large number of single sessions to obtain the transfer probability. Among them, for a single session, the session state node directed graph can describe the transfer relationship between the session state nodes. For example, for the single session shown in Table 1 above, the session state node directed graph can refer to Figure 4 As shown. In addition, in the directed graph of session state nodes corresponding to all single sessions for which statistics are taken, there must be a session state node that is both a session state node in the directed graph of session state nodes of a certain single session and a session state node in the directed graph of session state nodes of another or several other single sessions. Then, for a session state node, there can be multiple next session state nodes corresponding to it, wherein the next session state node is also called the out-degree session state node of the session state node. For the transition from a session state node to its corresponding out-degree session state node, for a certain out-degree session state node, the node out-degree ratio refers to the ratio of the number of transfers to the out-degree session state node to the number of transfers to all corresponding out-degree session state nodes, and the transition probability from the session state node to the out-degree session state node is the calculated ratio. For example, in the directed graph of session state nodes corresponding to all single sessions being counted, session state node A can be transferred to session state nodes B, C, and D, where session state nodes B, C, and D are all out-degree session state nodes of session state node A. The number of transfers from session state node A to session state node B is 30, the number of transfers from session state node A to session state node C is 30, and the number of transfers from session state node A to session state node D is 40. Then, among the out-degree session state nodes transferred from session state node A, the node out-degree ratio of session state node B is 30 / 100=0.3, so the probability of transferring from session state node A to session state node B is 0.3.

[0042] Specifically, in this embodiment, the following can be referred to: Figure 2The preset transfer rules shown. The data source is IM text chat data, the data time is June 2021, the data volume is 9000W+, and 1000W data are randomly selected for analysis. After obtaining 1000w data, data preprocessing is performed first, where data preprocessing includes the following: 1) Get business opportunity data (sessions started with users sending listings, marked with the start); 2) Remove data without conversations in the last seven days; 3) The data after filtering is about 3 million. Randomly select 1 million single-session data with successful transfers from the 3 million data, abstract the single session into a directed graph according to the session state, and for these 1 million single sessions, count the node out-degree ratio to obtain the transfer probability, and then obtain Figure 2 The preset transfer rules are shown.

[0043] Optionally, in an embodiment of the present invention, for session state nodes in a first session state node directed graph, based on the first node vector, redetermining the transition relationships between the session state nodes to reconstruct a cross-session session state node directed graph to obtain a second session state node directed graph may include the following: Based on a preset transition rule, determining the starting session state node of the second session state node directed graph from the session state nodes included in the first session state node directed graph. The preset transition rule specifies which session state nodes are starting session state nodes. By comparing the first session state node directed graph with the first session state node directed graph, the starting session state nodes that exist in the first session state node directed graph and are included in the preset transition rule are used as the starting session state nodes of the second session state node directed graph. For any starting session state node in the second session state node directed graph, the following operations are performed to construct the second session state node directed graph. Specifically, based on the first node vector, the closeness of the relationship between each session state node in the first session state node directed graph, excluding the starting session state node, and the starting session state node is determined. This step is intended to globally measure the representation of the session state node directed graph based on the representation and node similarity between each session state node. For example, the relationship closeness can be determined according to a preset relationship formula. Based on the determined relationship closeness, it is determined whether the starting session state node has a next session state node. Specifically, it is determined whether the determined relationship closeness meets the preset relationship closeness determination rule. If it meets the preset relationship closeness, it means that there is a next session state node, and if it does not meet the preset relationship closeness, it means that there is no next session state node. Among them, there may be one or more determined relationship closenesses. For each relationship closeness obtained, it is determined whether it meets the preset relationship closeness determination rule. The session state node corresponding to the relationship closeness that meets the preset relationship closeness determination rule is used as the next session state node. For example, for session state node E, it is determined whether it has a next session state node. By determining the relationship closeness, it is determined that the relationship closeness between session state node F and session state node G and session state node E all meet the preset relationship closeness determination rule. Therefore, session state node F and session state node G are both the next session state nodes of session state node E. After determining the next session state node, the next session state node is determined based on each determined next session state node from the set of session state nodes in the first session state node directed graph, excluding the start session state node and the node itself. Specifically, the determination is made based on the above-described determination of the closeness of the relationship and the determination of whether the next session state node exists. The process of determining the closeness of the relationship and determining whether the next session state node exists is then repeated for the third, fourth, and Nth generations of determining the next session state node until the session state node for which the next session state node is to be determined does not have a next session state node.Among them, the first generation determines the next session state node as the next session state node of the start session state node, the second generation determines the next session state node as the next session state node of the next session state node of the start session state node, and so on, the third generation determines the next session state node... and the Nth generation determines the next session state node.

[0044] Optionally, in an embodiment of the present invention, the method may further include: assigning weights to the in-degree session state nodes and / or out-degree session state nodes of each session state node in the first session state node directed graph based on an attention mechanism, wherein the determination of the closeness of the relationship is also combined with the weights of the in-degree session state nodes and / or the weights of the out-degree session state nodes. In the session state node directed graph, for a session state node, the in-degree session state node is the session state node pointing to it, and the out-degree session state node is the session state node pointing to it. For example, Figure 3 As shown, for node 2 in session 2, node 1 and node 2 in session 1 are its in-degree session state nodes, and node 2 and node 3 in session 3 are its out-degree session state nodes.

[0045] Optionally, in an embodiment of the present invention, the preset relationship formula may be as follows. In the formula, the numerator calculates the relationship between session state node i and session state node j, and the denominator represents the sum of the relationships between session state node i and each session state node in the session state node set. The result of this fraction measures the closeness of the relationship between session state node i and session state node j based on the global session state node. Among them, α i,j Indicates the closeness of the relationship between session state node i and session state node j; a T Represents the weight parameter of the network structure, which is continuously optimized during the neural network training process; W is also a network parameter that realizes the weight adjustment of two nodes during calculation; The first node vector representing the session state node i; Represents the first node vector of session state node j; sim ij represents the cosine similarity between session state node i and session state node j, wherein the cosine similarity can be calculated based on the first node vector of session state node i and the first node vector of session state node j; N i Represents a set of session state nodes consisting of all session state nodes that can participate in the relationship closeness calculation; sim ikRepresents the cosine similarity between session state node i and session state node k. When using the above formula to calculate the closeness of the relationship for the first session state node in the second session state node directed graph, session state node i corresponds to the starting session state node, and session state node j corresponds to the session state node in the first session state node directed graph whose closeness of relationship with the starting session state node is to be determined. N i Represents the set of all session state nodes in the first session state node directed graph, excluding the start session state node. It should be noted that the set of session state nodes corresponding to the first-generation determination of the next session state node is different from the set of session state nodes corresponding to the second-generation determination of the next session state node and the third-generation determination of the next session state node and thereafter. The set of session state nodes for the first-generation determination of the next session state node is the set of combinations of session state nodes in the first session state node directed graph, excluding the start session state node. The set of session state nodes for the second-generation determination of the next session state node and the third-generation determination of the next session state node and thereafter is the set of combinations of session state nodes in the first session state node directed graph, excluding the start session state node and the session state node for which the next session state node is to be determined. For example, if the third-generation determination of the next session state node is performed for session state node 1, the set of session state nodes is the set of combinations of session state nodes in the first session state node directed graph, excluding the start session state node and session state node 1. In addition, the preset relationship closeness determination rule may be to set a relationship closeness threshold and explain the relationship with the relationship closeness threshold. For example, the preset relationship closeness determination rule may be greater than the relationship closeness threshold. For example, the relationship closeness threshold is set to 0.6. When the determined relationship closeness is greater than the relationship closeness threshold, it complies with the preset relationship closeness determination rule. When the determined relationship closeness is not greater than the relationship closeness threshold, it does not comply with the preset relationship closeness determination rule.

[0046] Optionally, in an embodiment of the present invention, screening the candidate session state nodes in the preset session state node set based on the second session state node directed graph in combination with the first node vector to determine the next session state node of the current session state node may include the following contents.

[0047] Based on the session state node transition path in the second session state node directed graph and in combination with the first node vector of the session state node, the possibility of any candidate session state node in the preset session state node set being the next session state node of the current session state node is evaluated. The session state node transition path refers to a path that transitions between the start and end session state nodes in the session state node directed graph. For example, Figure 3As shown, the path consists of the start of session 1, node 1 in session 1, node 2 in session 2, node 3 in session 3, and the end of session 3, and the path consists of node 3, node 1, node 2, node 4, and node 5 in session 4. Specifically, the possibility of the candidate session state node being the next session state node of the current session state node can be evaluated by calculating a score. For example, the evaluation score corresponding to each candidate session state node being the next session state node of the current session state node is calculated to evaluate the possibility of becoming the next session state node of the current session state node. Based on the evaluation result, the candidate session state nodes in the preset session state node set are screened to determine the next session state node of the current session state node. For example, based on the evaluation score of each candidate session state node, the candidate session state node corresponding to the highest evaluation score is determined as the next session state node of the current session state node.

[0048] Optionally, in an embodiment of the present invention, for any candidate session state node in a preset session state node set, evaluating the likelihood that the candidate session state node is the next session state node of the current session state node may include the following: For any session state node transition path, a path score is determined in combination with the first node vector of the session state node. The path score indicates the likelihood that the candidate session state node, given a particular session state node transition path, will become the next session state node of the current session state node. Based on the path scores corresponding to all session state node transition paths, an evaluation score corresponding to the candidate session state node is determined to evaluate the likelihood that the candidate session state node is the next session state node of the current session state node. Filtering the candidate session state nodes in the preset session state node set based on the evaluation result includes filtering the candidate session state nodes based on the evaluation score, wherein the candidate session state node corresponding to the highest evaluation score is the next session state node of the current session state node. Optionally, in an embodiment of the present invention, there are various ways to obtain the evaluation score based on the path score. For example, the evaluation score can be obtained by summing all the path scores, or averaging all the path scores, or selecting the highest of all the path scores as the evaluation score. There are many ways to obtain the evaluation score based on the path scores, and there is no limitation on this.

[0049] Optionally, in an embodiment of the present invention, determining a path score for any session state node transition path in combination with the first node vector of the session state node may include the following: Determine the closeness of the path relationship between the session state nodes other than the session state node with no out-degree in the session state node transition path in combination with the first node vector. The session state node with no out-degree is a session state node without an out-degree session state node, for example, Figure 3 Node 5 in is a session state node with no out-degree. In addition, the path relationship closeness can be obtained based on the relationship closeness between each session state node except the session state node with no out-degree on the session state node transfer path. The relationship closeness can be calculated based on the above-mentioned preset relationship formula. It should be noted that when the relationship closeness is calculated based on the above-mentioned preset relationship formula, the session state node set is a set of session state nodes except the session state node with no out-degree on the session state node transfer path. Specifically, it can be obtained by multiplying the relationship closeness corresponding to each session state node by the first node vector of the session state node and then adding them together. For example, the calculation formula for the path relationship closeness can be Among them, session state node j is a session state node other than the session state node with no out-degree on the session state node transfer path, session state node i is a session state node with no out-degree on the session state node transfer path, N i is the set of session state nodes, α i,j Indicates the closeness of the relationship between session state node i and session state node j, Represents the first node vector of session state node j, s session Indicates the closeness of the path relationship. The path score is determined based on a preset scoring formula, combining the closeness of the path relationship, the first node vector of the session state node with no out-degree, and the first node vector of the session state node to be selected.

[0050] Optionally, in this embodiment of the present invention, the preset scoring formula may include: in, The first node vector representing the session state node with no out-degree in the session state node transition path α, represents the closeness of the path relationship corresponding to the session state node transfer path α, w n and w s represents weight, σ represents ReLU function, V β Represents the first node vector of the candidate session state node β in the preset session state node set, y αβ represents the path score corresponding to the session state node transfer path α for the candidate session state node β.n and w s They can be set to 0.5 respectively, and finally normalized by the softmax function.

[0051] Optionally, in an embodiment of the present invention, the first node vector obtained in the embodiment of the present invention may be further processed to more accurately determine the next session state node of the current session state node. Specifically, the method for assisting conversation provided in an embodiment of the present invention may further include the following: Inputting the first node vector of each session state node in the first session state node directed graph into a second preset recurrent neural network model to obtain a second node vector for each session state node, wherein the second node vector of each session state node reflects global information about the session state node. When the first node vector is used, the first node vector is replaced with the second node vector. When the second node vector is determined, the second node vector is used when determining the next session state node of the current session state node. For the same session state node, the global information reflected by the second node vector is more accurate than the global information reflected by the first node vector. The second node vector better reflects the contextual information and context-based semantic information of the session state node in the directed graph. The next session state node of the current session state node is determined based on the second node vector, thereby improving the accuracy of determining the next session state node of the current session state node. Optionally, the second preset recurrent neural network model may be an LSTM model.

[0052] Optionally, in an embodiment of the invention, the method for assisting conversations may further include the following. In the case where the selected session state node obtained by screening is a question intention state node, based on a preset transfer rule, the selected session state node obtained by screening is mapped to a reply action state node, wherein the mapped reply action state node is the next session state node of the current session state node. Optionally, based on the preset transfer rule, if there is only one reply action state node mapped to the selected session state node obtained by screening, then the mapped reply action state node is the next session state node of the current session state; based on the preset transfer rule, if there are multiple reply action state nodes mapped to the selected session state node obtained by screening, then the mapped reply action state node is the next session state node of the current session state, and the reply action state node with the highest transfer probability is selected as the next session state node of the current session state.

[0053] Figure 5 This is a logic diagram of a method for assisting a conversation provided by another embodiment of the present invention. Figure 5 The method for assisting conversation provided by an embodiment of the present invention is exemplarily introduced.

[0054] Will Figure 3 The first session state node directed graph shown is input into the GNN model, and each session state node in the first session state node directed graph is mapped into an embedding representation with global information through the GNN model, the first node vector. The GNN model is a graph neural network model that maps the cross-session directed graph into a node vector with global information through the GNN. Its calculation method is: V l+1 =σ(D -1 (Weight in V l +Weight out V l +V l )W l ), in order to obtain more graph structure information, we use weight to represent the weights between different nodes. Because it is a directed graph, all the nodes are divided into Weight in , Weight out , Weight is the frequency ratio of out-degree and in-degree; v l With v l+1 is the relationship between adjacent nodes, according to v l To calculate v l+1 ;D -1 It represents the link matrix of the node, which represents the link relationship between each node in the original network structure diagram; w l Refers to the weight matrix of the current node, which means the weight matrix obtained when the direction is not considered, which is determined by the frequency of the degree, and is the same as weight in , weight out The idea is the same, but the direction is not considered. After obtaining the first node vector, in order to obtain a node vector with context information or a node vector that can better reflect the global information of the session state node, a layer of LSTM network structure is connected. The first node vector obtained above is input into the LSTM model, and for each session state node in the directed graph of the first session state node, an embedding representation with session sequence information (i.e. global information) is obtained, and the second node vector is obtained. The LSTM model obtains the global information of the current node through a gating device, and its network structure is as follows Figure 6 As shown. Among them, Figure 6In the example, X and h represent the first node vector and the second node vector, respectively. An Attention mechanism is introduced after the LSTM model to assign weights to the in-degree and out-degree session state nodes of each session state node in the first session state node directed graph. This strengthens the vector representation of each session state node and obtains a session-level embedding representation. For the session state nodes in the first session state node directed graph, based on the second node vector, the transition relationships between the session state nodes are re-determined to reconstruct the cross-session session state node directed graph to obtain a second session state node directed graph. Specifically, the second session state node directed graph is constructed based on the degree of relationship closeness described in the above-mentioned embodiments. Based on the second session state node directed graph and in combination with the second node vector, candidate session state nodes in the preset session state node set are screened to determine the next session state node of the current session. Specifically, the next session state node of the current session state node is determined by calculating the path score as described in the above-mentioned embodiments. In the second session state node directed graph, a session state node transition path is formed from the start state node to a session state node that has only in-degree session state nodes and no out-degree session state nodes. Based on the method for calculating path scores described in the above embodiment, a path score is calculated for a candidate session state node, where the final session state node is a session state node transition path that has only in-degree session state nodes and no out-degree session state nodes. An evaluation score for the candidate session state node is calculated using the formula described in the above embodiment. Based on the evaluation score, the candidate session state nodes in the preset session state node set are screened to determine the next session state node of the current session state node. Based on the above, a reply action state node is predicted. Since question intention state nodes and reply action state nodes are treated as the same session state node in this directed graph, the predicted result may be either a question intention state node or a reply action state node. Our primary goal is to use this model to predict brokers' reply actions, thereby guiding and better serving users and ultimately achieving the goal of delegation. Therefore, when the predicted result is a user's question intent state node, we map it to the agent's response action state node based on pre-set transition rules. For example, when the predicted recommendation node is the user's question intent state node "Housing - School District," we map it to the agent's response action state node "Inquiring about Housing Requirements." This way, through the prediction process, we can effectively guide the agent to provide more appropriate action responses at the appropriate time.

[0055] The technical solution provided by the embodiment of the present invention can be based on the following background: a user chats with different brokers through IM, and his goal is the same, which is to buy (sell) a house. However, due to incomplete description of his needs with each broker in the IM session, the user demand information obtained in each session is incomplete. The technical solution provided by the embodiment of the present invention solves the problem of incomplete broker needs based on the context of a single session. By performing context analysis across sessions and recommending brokers' actions, it is easier to obtain complete information and trust about the brokers' needs, thereby helping brokers to answer more accurately, promote delegation, and increase the delegation rate of business opportunities. Through the improvement of the above model, in terms of business, on the one hand, we have given the brokers a concept of cooperation in the process of generating business opportunities; on the other hand, we have promoted the conversion of superiors, converted business opportunities into delegations, and increased the delegation rate by 3%.

[0056] The technical solution provided by the embodiment of the present invention mainly includes: A) abstracting a session by defining the user's intention type and the broker's action type; B) by analyzing the single-session transfer graph of historical successful delegation, we statistically analyze the transfer probabilities of different customer intentions and broker actions to obtain preset transfer rules; C) based on the results of B), associate the sessions that occurred within two weeks before the start time of the current session to obtain a cross-session directed graph, and represent the cross-session context representation method based on the directed graph; D) based on the directed graph constructed in C), obtain node vectors reflecting global information based on the GNN model and LSTM model, and make more accurate recommendations for the broker's actions based on the node vectors, recommending what action should be taken next in the current state of the current session, thereby completing the selection of the optimal action and promoting the achievement of delegation.

[0057] The technical solutions provided by the embodiments of the present invention mainly solve the following technical problems: 1) solving the problem of abstract representation of sessions; 2) solving the problem of user status and broker action transfer across sessions; 3) solving the problem of broker action selection based on cross-sessions.

[0058] The technical effects achieved by the technical solution provided by the embodiments of the present invention include: 1) solving the abstract representation of state transitions in a single session by effectively defining the state transition association between users and brokers; 2) obtaining the optimal transition path by analyzing the historical path of state transitions, that is, the preset transition rules described in the embodiments of the present invention; 3) connecting cross-session path representations based on the optimal state transition path, thereby obtaining the association relationship between different sessions; 4) recommending the optimal action for the current session by constructing a cross-session directed graph.

[0059] Accordingly, another aspect of an embodiment of the present invention provides an apparatus for assisting a conversation.

[0060] Figure 7 FIG is a structural block diagram of an apparatus for assisting conversation provided by another embodiment of the present invention. Figure 7 As shown, the device includes a historical session acquisition module 6, a first session state node directed graph acquisition module 7, a first node vector acquisition module 8, a second session state node directed graph acquisition module 9, and a screening module 10. Among them, the historical session acquisition module 6 is used to obtain historical sessions of the current user who is conducting the current session within a preset time period; the first session state node directed graph acquisition module 7 is used to build a cross-session session state node directed graph for the session state nodes included in the current session and the historical session based on the preset transfer rule for the transfer of session state nodes in accordance with the time sequence of the current session and the historical session, so as to obtain a first session state node directed graph; the first node vector acquisition module 8 is used to input the first session state node directed graph into a first preset graph neural network model to obtain the first node of each session state node in the first session state node directed graph. point vector, wherein the first node vector of the session state node reflects the global information of the session state node; the second session state node directed graph obtaining module 9 is used to, for the session state nodes in the first session state node directed graph, redetermine the transfer relationship between the session state nodes based on the first node vector, so as to reconstruct the cross-session session state node directed graph to obtain the second session state node directed graph; the screening module 10 is used to screen the candidate session state nodes in the preset session state node set based on the second session state node directed graph and the first node vector, so as to determine the next session state node of the current session state node.

[0061] Optionally, in an embodiment of the present invention, the module for obtaining the second session state node directed graph redetermines the transition relationship between the session state nodes based on the first node vector for the session state nodes in the first session state node directed graph to reconstruct the cross-session session state node directed graph to obtain the second session state node directed graph, including: determining, based on a preset transition rule, a start session state node of the second session state node directed graph among the session state nodes included in the first session state node directed graph; and performing the following operations for any start session state node of the second session state node directed graph to construct the second session state node directed graph: determining, in combination with the first node vector, a degree of closeness of the relationship between each session state node in the first session state node directed graph, except the start session state node, and the start session state node; determining, based on the determined degree of closeness of the relationship, whether the start session state node has a next session state node; and, if the start session state node has a next session state node, repeating the process of determining the degree of closeness of the relationship and determining whether it has a next session state node based on the next session state node of the start session state node, until the session state node for which the next session state node is to be determined does not have a next session state node.

[0062] Optionally, in an embodiment of the present invention, the device further includes: a weight assignment module for assigning weights to the in-degree session state nodes and / or out-degree session state nodes of each session state node in the directed graph of the first session state node based on an attention mechanism, wherein the determination of the degree of relationship closeness is also combined with the weight of the in-degree session state node and / or the weight of the out-degree session state node.

[0063] Optionally, in an embodiment of the present invention, the screening module screens the candidate session state nodes in the preset session state node set based on the second session state node directed graph in combination with the first node vector to determine the next session state node of the current session state node, including: based on the session state node transfer path in the second session state node directed graph and in combination with the first node vector of the session state node, evaluating the possibility that any candidate session state node in the preset session state node set is the next session state node of the current session state node; and screening the candidate session state nodes in the preset session state node set according to the evaluation result to determine the next session state node of the current session state node.

[0064] Optionally, in an embodiment of the present invention, for any candidate session state node in the preset session state node set, evaluating the possibility that the candidate session state node is the next session state node of the current session state node includes: determining a path score for any session state node transfer path in combination with the first node vector of the session state node; and determining, based on the path scores corresponding to all session state node transfer paths, an evaluation score corresponding to the candidate session state node being the next session state node of the current session state node, so as to evaluate the possibility that the candidate session state node is the next session state node of the current session state node, wherein screening the candidate session state nodes in the preset session state node set according to the evaluation result includes screening the candidate session state nodes according to the evaluation scores, wherein the candidate session state node corresponding to the highest evaluation score is the next session state node of the current session state node.

[0065] Optionally, in an embodiment of the present invention, determining a path score for any session state node transfer path in combination with the first node vector of the session state node includes: determining, in combination with the first node vector, a degree of closeness of the path relationship between the session state nodes other than the no-out-degree session state node in the session state node transfer path and the no-out-degree session state node; and determining the path score according to a preset scoring formula in combination with the degree of closeness of the path relationship, the first node vector of the no-out-degree session state node, and the first node vector of the to-be-selected session state node.

[0066] Optionally, in an embodiment of the present invention, the preset scoring formula includes: in, The first node vector representing the session state node with no out-degree in the session state node transition path α, represents the closeness of the path relationship corresponding to the session state node transfer path α, w n and w s represents weight, σ represents ReLU function, V β Represents the first node vector of the candidate session state node β in the preset session state node set, y αβ represents the path score corresponding to the session state node transition path α for the candidate session state node β.

[0067] Optionally, in an embodiment of the present invention, the device further includes: a second node vector obtaining module, used to input the first node vector of each session state node in the first session state node directed graph into a second preset recurrent neural network model to obtain a second node vector for each session state node, wherein the second node vector of each session state node reflects global information about the session state node, and wherein the first node vector is replaced with the second node vector when the first node vector is used.

[0068] Optionally, in an embodiment of the present invention, the device further includes: a mapping module for mapping the screened candidate session state node to a reply action state node based on a preset transfer rule when the screened candidate session state node is a question intention state node, wherein the mapped reply action state node is the next session state node of the current session state node.

[0069] The specific working principle and benefits of the device for assisting conversation provided by the embodiment of the present invention are similar to the specific working principle and benefits of the method for assisting conversation provided by the embodiment of the present invention, and will not be repeated here.

[0070] The device for assisting conversation includes a processor and a memory. The historical conversation acquisition module, the first conversation state node directed graph acquisition module, the first node vector acquisition module, the second conversation state node directed graph acquisition module and the screening module are all stored in the memory as program units, and the processor executes the above program units stored in the memory to implement corresponding functions.

[0071] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the accuracy of the next session state node determined can be improved by adjusting kernel parameters.

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

[0073] In addition, another aspect of the embodiments of the present invention further provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the method described in the above embodiments.

[0074] In addition, another aspect of the embodiments of the present invention further provides a processor for running a program, wherein the program is used to execute the method described in the above embodiments when it is run.

[0075] Another aspect of the present invention provides a device comprising a processor, a memory, and a program stored in the memory and executable by the processor. When the processor executes the program, the method described in the above embodiments is implemented. The device herein may be a server, a PC, a PAD, a mobile phone, or the like.

[0076] In addition, another aspect of the embodiments of the present invention further provides a computer program product, including a computer program / instruction, which implements the method described in the above embodiments when executed by a processor.

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

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

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

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

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

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

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

[0084] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0085] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A method for assisting a conversation, characterized in that: The method includes: Get the historical sessions of the current user during the preset time period; Based on a preset transfer rule for session state node transfer, and in accordance with the chronological order of the current session and the historical session, for the session state nodes included in the current session and the historical session, a cross-session session state node directed graph is constructed to obtain a first session state node directed graph, wherein the session state nodes include a start session state node, an end session state node, a question intention state node, and a reply action state node; Inputting the first session state node directed graph into a first preset graph neural network model to obtain a first node vector of each session state node in the first session state node directed graph, wherein the first node vector of the session state node reflects global information of the session state node; For the session state nodes in the first session state node directed graph, based on the first node vector, redetermining the transition relationship between the session state nodes to reconstruct the cross-session session state node directed graph to obtain a second session state node directed graph; and Based on the second session state node directed graph and in combination with the first node vector, screening the candidate session state nodes in the preset session state node set to determine the next session state node of the current session; The step of re-determining the transition relationship between the session state nodes based on the first node vector for the session state nodes in the first session state node directed graph to reconstruct the cross-session session state node directed graph to obtain the second session state node directed graph includes: Based on the preset transfer rule, determining a start session state node of the second session state node directed graph among the session state nodes included in the first session state node directed graph; and For any of the start session state nodes in the second session state node directed graph, perform the following operations to construct the second session state node directed graph: Determining, in conjunction with the first node vector, a closeness of relationship between each session state node except the start session state node in the first session state node directed graph and the start session state node; Determining whether the start session state node has a next session state node based on the determined closeness of the relationship; and In the case where the start session state node has the next session state node, the process of determining the closeness of the relationship and judging whether there is a next session state node is repeated based on the next session state node of the start session state node until the session state node for which the next session state node is to be determined does not have a next session state node.

2. The method according to claim 1, characterized in that The method further includes: Based on the attention mechanism, a weight is assigned to the in-degree session state node and / or the out-degree session state node of each session state node in the directed graph of the first session state node. The determination of the closeness of the relationship is further combined with the weight of the in-degree session state node and / or the weight of the out-degree session state node.

3. The method according to claim 1, characterized in that Screening the candidate session state nodes in the preset session state node set based on the second session state node directed graph in combination with the first node vector to determine the next session state node of the current session state node includes: Based on the session state node transition path in the second session state node directed graph and in combination with the first node vector of the session state node, evaluating the likelihood that any of the candidate session state nodes in the preset session state node set is the next session state node of the current session state node; and The candidate session state nodes in the preset session state node set are screened according to the evaluation result to determine the next session state node of the current session state node.

4. The method according to claim 3, characterized in that For any of the candidate session state nodes in the preset session state node set, evaluating the possibility that the candidate session state node is the next session state node of the current session state node includes: For any of the session state node transfer paths, determine a path score in combination with the first node vector of the session state node; and Determine, based on the path scores corresponding to all the session state node transition paths, an evaluation score corresponding to the candidate session state node being the next session state node of the current session state node, so as to evaluate the possibility that the candidate session state node is the next session state node of the current session state node. Wherein, screening the candidate session state nodes in the preset session state node set according to the evaluation result includes screening the candidate session state nodes according to the evaluation score, wherein the candidate session state node corresponding to the highest evaluation score is the next session state node of the current session state node.

5. The method according to claim 4, characterized in that Determining the path score for any session state node transfer path in combination with the first node vector of the session state node includes: Determine, in combination with the first node vector, the closeness of the path relationship between the session state nodes other than the session state node with no out-degree in the session state node transfer path and the session state node with no out-degree; and The path score is determined according to a preset scoring formula, combining the path relationship closeness, the first node vector of the no-outdegree session state node, and the first node vector of the candidate session state node.

6. The method according to claim 5, characterized in that The preset scoring formula includes: in, The first node vector representing the session state node with no out-degree in the session state node transition path α, represents the closeness of the path relationship corresponding to the session state node transfer path α, w n and w s represents weight, σ represents ReLU function, V β The first node vector y represents the session state node β to be selected in the preset session state node set. αβ represents the path score corresponding to the session state node transition path α for the candidate session state node γ.

7. The method according to any one of claims 1 to 6, characterized in that The method further includes: Inputting the first node vector of each session state node in the first session state node directed graph into a second preset recurrent neural network model to obtain a second node vector for each session state node, wherein the second node vector of each session state node reflects global information about the session state node. When the first node vector is used, the first node vector is replaced by the second node vector.

8. The method according to any one of claims 1 to 6, characterized in that The method further includes: In the case that the selected session state node obtained by screening is a question intention state node, based on the preset transfer rule, the selected session state node obtained by screening is mapped to a reply action state node, wherein the mapped reply action state node is the next session state node of the current session state node.

9. A machine-readable storage medium, characterized in that The machine-readable storage medium stores instructions, which are used to enable a machine to execute the method according to any one of claims 1 to 8.

10. A processor, characterized in that: Used to run a program, wherein the program is used to execute the method according to any one of claims 1 to 8 when run.

11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method and device for cross-type conversation, apparatus, and computer-readable storage medium

    CN109033223A

  • Visual dialogue generation method based on context perceptual map neural network

    CN110609891A

  • Cross-session recommendation method and system, storage medium and electronic equipment

    CN113449201A