A method, device, terminal device and storage medium for generating reply information
By constructing a graph structure and information propagation path and combining multi-source information, personalized reply information is generated, which solves the problem of difficulty in processing complex query information in the existing technology and improves the accuracy and personalization of reply information.
Patent Information
- Application Number
- CN202410354969.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-27
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-03-27
AI Technical Summary
Existing technology is difficult to handle complex customer query information, making it difficult to improve the accuracy and personalization of reply information.
By building a graph structure, the information propagation path is generated, and combined with user information, product information and historical query information, a preset reply generation model is used to generate personalized reply information.
It achieves efficient processing of complex semantics, generates highly accurate and highly personalized reply information, and meets the diverse and complex needs of customers.
Smart Images

Figure CN118260394B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a reply information generation method, apparatus, terminal device and storage medium. Background Art
[0002] With the development of social economy, the digitalization and diversity of banking products have also developed, which means that banks need to face a large amount of inquiry information from many customers at all times and respond to these inquiry information. How to efficiently and accurately process these inquiry information and provide customers with targeted responses in a timely manner is a huge challenge facing banks.
[0003] The banking industry has adopted a variety of technologies to process customer queries and provide personalized responses, including rules engines, keyword matching, template-based responses, machine learning-based methods, and natural language generation (NLG).
[0004] The above technologies usually adopt rule-based, keyword matching or fixed template methods, and are unable to handle complex queries and semantics. Although the above technologies can generate reply information for customer query information in a short period of time, it is difficult to generate personalized replies, resulting in the accuracy of the generated reply information being difficult to guarantee. Summary of the invention
[0005] In view of this, an embodiment of the present application provides a reply information generation method, which can solve the problem in the prior art that complex semantics cannot be processed and reference information is limited, making it difficult to improve the accuracy of the generated reply information.
[0006] A first aspect of an embodiment of the present application provides a method for generating a reply message, comprising:
[0007] Obtain user information, product information, historical query information, and current query information;
[0008] generating a graph structure according to the historical query information;
[0009] Generate an information propagation path according to the graph structure, the current query information and a preset information propagation path generation model;
[0010] Reply information is generated according to the user information, the product information, the current query information, the information propagation path and a preset reply generation model.
[0011] A second aspect of an embodiment of the present application provides a reply information generating device, including:
[0012] Information acquisition module, used to obtain user information, product information, historical query information, and current query information;
[0013] A graph structure generation module, used to generate a graph structure according to the historical query information;
[0014] an information propagation path generation module, configured to generate an information propagation path according to the graph structure, the current query information and a preset information propagation path generation model; and
[0015] The reply generation module is used to generate reply information according to the user information, the product information, the current query information, the information propagation path and a preset reply generation model.
[0016] A third aspect of an embodiment of the present application provides a terminal device, which includes a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and when the processor executes the computer program, the steps of the reply information generation method as described in any one of the first aspects above are implemented.
[0017] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, comprising: storing a computer program, characterized in that when the computer program is executed by a processor, the steps of the reply information generation method as described in any one of the above-mentioned first aspects are implemented.
[0018] A fifth aspect of an embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device executes the reply information generation method described in any one of the first aspects above.
[0019] Compared with the prior art, the embodiments of the present application have the following beneficial effects: by constructing the process of information propagation in conversation data, multi-source information such as customer historical conversation records, bank product and service information, and customer information can be effectively integrated and utilized to process highly diverse and complex semantics in query content, thereby generating highly accurate personalized responses to customer query content. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0021] Figure 1 This is a schematic diagram of the implementation flow of the reply information generation method provided in Example 1 of the present application;
[0022] Figure 2This is a schematic diagram of the implementation flow of the reply information generation method provided in Example 2 of the present application;
[0023] Figure 3 This is a schematic diagram of the implementation flow of the reply information generation method provided in Example 3 of the present application;
[0024] Figure 4 This is a schematic diagram of the implementation flow of the reply information generation method provided in Example 4 of the present application;
[0025] Figure 5 This is a schematic diagram of the implementation flow of the reply information generation method provided in Example 5 of the present application;
[0026] Figure 6 This is a schematic diagram of the implementation flow of the reply information generation method provided in Example 6 of the present application;
[0027] Figure 7 It is a structural block diagram of a reply information generating device provided in Embodiment 7 of the present application;
[0028] Figure 8 It is a schematic diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0030] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.
[0031] Figure 1 The following is a flowchart of the method for generating a reply message according to the first embodiment of the present application, which is described in detail as follows:
[0032] Step S101, obtaining user information, product information, historical query information, and current query information.
[0033] In this embodiment, user information refers to the user's personal information, account information, transaction records, etc. Product information includes detailed information on various products and services provided by the bank, such as account type, loan interest rate, credit card policy, etc. Historical query information refers to the historical conversation information between the user and the bank, including text information of user queries and customer service replies, and each historical conversation text information contains a timestamp. Current query information refers to the text information currently entered by the user into the system to query the bank's business. User information, product information, historical query information, and current query information are all obtained in real time from the bank's IT system.
[0034] Step S102: Generate a graph structure according to the historical query information.
[0035] In this embodiment, the historical conversation information between the user and the bank in the historical query information is used to construct the graph structure. The time sequence between the text messages is determined according to the timestamp, and the information propagation direction is determined according to the timestamp, thereby establishing the association between the text messages. Each historical conversation message is mapped to a vector of a fixed dimension, and each historical conversation message is represented as a graph node in the graph, and the association between the historical conversation messages is represented as the edge of the graph node in the graph structure. The information propagation direction is from the replying party to the querying party, thereby realizing the construction of the graph structure.
[0036] Step S103, generating an information propagation path according to the graph structure, the current query information and a preset information propagation path generation model.
[0037] In this embodiment, at the initial stage of information propagation, one or more starting nodes need to be selected for the constructed graph structure. These starting nodes represent the origin of the information. Usually, the starting node is the user's current query information, because the user's question or demand will trigger information propagation. The information propagation path is simulated in the constructed graph structure using a preset information propagation path generation model. The starting node is marked as an activated state, and then the propagation path is gradually extended in the constructed graph structure until no new nodes are activated. Finally, the information propagation path is generated according to all activated nodes and the propagation direction between nodes.
[0038] In this embodiment, preferably, the preset information propagation path generation model can adopt a graph convolutional network (Graph Convolutional Networks, GCN) or a graph attention network (Graph Attention Networks, GAT). Among them, the graph attention network (Graph Attention Networks, GAT) introduces an attention mechanism on the basis of the graph convolutional network (Graph Convolutional Networks, GCN), so that the efficiency and accuracy of analyzing the correlation between the graphic nodes in the graph structure are higher. Among them, before training the preset information propagation path generation model, it is necessary to construct an objective function in the information propagation modeling to measure the difference between the simulated information propagation process and the actual situation. The maximum likelihood estimation method can be used to construct the objective function, as follows:
[0039] A graph structure reflecting the information dissemination scenario of banking scenario dialogue data includes a set of nodes V, a set of edges E, and a set of information dissemination paths D. For each dissemination path d in the set of information dissemination paths D, it is represented as a sequence of nodes (v1, v2, ..., v t ), where t is the length of the propagation path d. The goal of training the preset information propagation path generation model is to maximize the likelihood of the information propagation path D.
[0040] First, define the likelihood of each propagation path d. Assume that in the graph structure, node v i Spread information to node v j The probability of P(v i →v j ), the node sequence in the propagation path d is (v1,v2,…,v t ), the likelihood of propagation path d can be defined as:
[0041]
[0042] Next, define the likelihood of the entire information propagation path D and multiply the likelihoods of all propagation paths d:
[0043]
[0044] The goal of training the preset information propagation path generation model is to maximize the likelihood L(D) of the information propagation path D. In order to transform it into a minimization problem, the log likelihood is taken to obtain the log likelihood function:
[0045]
[0046] Finally, the objective function can be defined as the inverse of the log-likelihood function, which is the loss function to be minimized:
[0047]
[0048] This objective function J(D) measures the information propagation modeling ability of the model. The smaller it is, the better the model can fit the observed information propagation data. By minimizing the objective function J(D), the trained information propagation path generation model can more flexibly construct the information propagation process in the bank conversation data.
[0049] Step S104, generating reply information according to the user information, the product information, the current query information, the information propagation path and a preset reply generation model.
[0050] In this embodiment, user information, product information, current query information, all graphic nodes in the information propagation path, and the associations between graphic nodes are input into a preset reply generation model to integrate and analyze multi-source information as a reference to generate highly personalized and accurate reply information.
[0051] In this embodiment, preferably, the preset reply generation model can adopt a natural language generation model. Specifically, the natural language generation model that can be adopted includes but is not limited to a Seq2Seq model or GPT-3.
[0052] A reply information generation method provided in an embodiment of the present application introduces historical query information, user information and product information as references, integrates and analyzes the historical query information through a preset information propagation path generation model, thereby parsing the complex semantics in the current query information, and combines the text association between the contexts to generate a personalized reply with high accuracy and strong pertinence.
[0053] Figure 2 The following is a flowchart of the method for generating a reply message according to the second embodiment of the present application, which is described in detail as follows:
[0054] Step S201, generating a graph node according to the historical query text and the historical query time.
[0055] In this embodiment, the historical query text refers to the historical conversation text information between the user and the bank in the historical query information, and the historical query time refers to the timestamp contained in each historical conversation text information. Each historical conversation text information is represented as a graph node in the graph, and the generated graph node contains text information and corresponding time information, wherein the time information is used to determine the time sequence and context association degree between nodes.
[0056] Step S202: Generate edges of graph nodes according to the historical query text and the historical information propagation direction.
[0057] In this embodiment, the time sequence between text messages is determined according to the timestamps in the historical query text, and which message is a reply to which message is determined according to the timestamps to determine the direction of information transmission, thereby establishing the association between text messages. The association between historical conversation messages is represented as the edge of the graph node in the graph structure, and the direction of the edge represents the direction of information transmission, that is, it is used to indicate which message is a reply to which message.
[0058] In this embodiment, optionally, a pre-trained word embedding model (including but not limited to Word2Vec or BERT) is used to convert each text message into a vector of fixed dimension and retain semantic information, wherein the starting point of the vector is the graph node and the direction of the vector is the edge of the graph node.
[0059] Step S203: determining the weight of the edge according to the historical query time.
[0060] In this embodiment, the edge has a weight, and the edge weight is used to reflect the speed of information propagation. The edge weight is determined by the timestamps of the two graph nodes. The smaller the time difference between the two timestamps, the more timely the information reply is, and the greater the edge weight.
[0061] Step S204: Generate a graph structure according to the graph nodes, the edges of the graph nodes, and the weights of the edges.
[0062] In this embodiment, a visualization tool (including but not limited to NetworkX, Gephi, etc.) can be used to combine the graph nodes, the graph edges, and the weights of the graph edges to form a graph structure of unlimited dimensions, and the constructed graph structure can be visualized to have a more intuitive understanding of its structure.
[0063] A reply information generation method provided in an embodiment of the present application converts the conversation data into a graph structure, represents each conversation information as a graph node, and represents the relationship between the information as the edge of the graph node, thereby converting the conversation data into a more structured and easier to process form, making it easier for the computer to perceive and analyze the conversation text data.
[0064] Figure 3 The following is a flowchart of the method for generating a reply message according to the third embodiment of the present application, which is described in detail as follows:
[0065] Step S301: Generate a starting node according to the current query information.
[0066] In this embodiment, the user's current query information is converted into a graph node and imported into the constructed graph structure. Because the user's question or demand will trigger information dissemination, the user's current query information is used as the starting node of the graph structure.
[0067] Step S302: determining neighbor nodes according to the starting node and the graph structure.
[0068] In this embodiment, within the graph structure, graph nodes are connected by edges, and the edge of the starting node is determined according to the timestamp of the starting node, thereby determining the neighbor nodes of the starting node in the graph structure according to the edges between the starting nodes.
[0069] Step S303, generating an information propagation path according to the graph structure, the starting node, the neighboring nodes and a preset information propagation path generation model.
[0070] In this embodiment, the entire graph structure is input into a preset information propagation path generation model, which determines the information propagation path according to the start node and the neighbor nodes. The information propagation path includes at least two graph nodes for reference in generating the content of the reply information.
[0071] The embodiment of the present application provides a reply information generation method, which converts text information into graphic nodes and determines the neighbor nodes in the graphic nodes through the dialogue relationship of the context, so that the computer can parse the text information more efficiently. At the same time, by determining the starting node and the neighbor node, the relationship of the context is sorted, analyzed and integrated to generate an information propagation path, thereby determining the semantically related text according to the correlation between the graphic nodes.
[0072] Figure 4 The following is a flowchart of the method for generating a reply message according to the fourth embodiment of the present application, which is described in detail as follows:
[0073] Step S401, determining the weight of the edge of the starting node according to the starting node and the neighboring nodes.
[0074] In this embodiment, the weight of the edge connecting the start node and the neighbor node is determined according to the timestamps of the start node and the neighbor node, wherein the smaller the time difference between the two timestamps, the greater the weight of the edge.
[0075] Step S402: determining an activation threshold of each graphic node in the graphic structure according to the graphic structure and the preset information propagation path generation model.
[0076] In this embodiment, the activation threshold of each graphic node in the graphic structure is determined by the information propagation rules in the preset information propagation path generation model. The information propagation rules are usually represented by a threshold model, and the threshold model sets the activation threshold based on the importance or influence of the node. Among them, the importance of the node can be evaluated based on factors such as its position in the network, connectivity, and historical information propagation. For example, network indicators such as the degree (number of connections), betweenness centrality, and closeness centrality of the node can be used to measure the importance of the node, which in turn affects the setting of its activation threshold. The ultimate goal is to make the activation threshold reasonably reflect the role and influence of the node in information propagation, so as to better construct the information propagation process in real situations.
[0077] In this embodiment, according to the threshold model, each node is assigned an activation threshold (θ i ), indicating that the node will be activated when the threshold is reached. The activation threshold can be determined based on the characteristics of the node or random distribution.
[0078] In this embodiment, preferably, the threshold model may adopt a linear threshold model (Linear Threshold Model) or an independent cascade model (Independent Cascade Model), as follows:
[0079] In the linear threshold model, the activation state of a node is determined by comparing the weighted sum of its neighbor nodes with the node's own activation threshold. The activation state of a node can be expressed by the following formula:
[0080]
[0081] Among them, A i represents the activation state of node i, N(i) represents the set of neighbor nodes of node i, and w ij represents the weight of edge (i,j), θ i represents the activation threshold of node i.
[0082] In the independent cascade model, the activation state of a node is determined through multiple independent information propagation simulations.
[0083] The probability of node i propagating information to node j can be expressed as:
[0084] p ij ∈[0,1]
[0085] Among them, each edge (i, j) has a probability p ij , represents the probability of information propagating from node i to node j.
[0086] Step S403: When it is determined that the weight of the edge of the starting node is greater than the activation threshold of the neighboring node, the neighboring node is marked as an initial activation node.
[0087] In this embodiment, when the weight of the edge of the starting node is judged to be greater than the activation threshold of the neighbor node, the neighbor node is in an activated state, and the activated neighbor node is marked as an initial activated node; when the weight of the edge of the starting node is judged to be less than the activation threshold of the neighbor node, the neighbor node cannot be activated, and the neighbor node cannot be made activated.
[0088] Step S404: determining a destination node according to the graph structure and the initial activation node.
[0089] In this embodiment, the neighbor nodes of the initially activated node are determined in the graph structure, and it is determined whether the neighbor nodes are activated. This process indicates that information is transferred from the activated graph node to the neighbor nodes, and then continues to propagate. This transfer process can be continued until no new nodes are activated, and then the last activated node is determined to be the destination node.
[0090] Step S405, generating an information propagation path according to the starting node, the graph structure, the initial activation node, the destination node and the preset information propagation path generation model.
[0091] In this embodiment, the entire graph structure is input into the information propagation path generation model, which determines the destination node based on the start node and the initial activation node, and generates the information propagation path according to all the nodes in the activated state.
[0092] A reply information generation method provided in an embodiment of the present application determines the activation state of a graphic node, and then generates an information propagation path according to all graphic nodes in an activated state in a graphic structure. The activation state of the graphic node is used to reasonably reflect the role and influence of the node in information propagation, and then the information propagation process in a real situation is constructed through the graphic nodes in an activated state, so as to facilitate the determination of text information with a high correlation with the current query information from among a large amount of text information for reference of reply information, thereby improving the accuracy of parsing the complex semantics in the current query information.
[0093] Figure 5 The following is a flowchart of the method for generating a reply message according to the fourth embodiment of the present application, which is described in detail as follows:
[0094] Step S501: determining a first neighbor node according to the graph structure and the initial activated node.
[0095] In this embodiment, the edge of the initial activated node in the graph structure is determined according to the initial activated node, and thus the first neighbor node connected to the initial activated node is determined according to the edge of the initial activated node.
[0096] Step S502: determining the weight of the edge of the initial activated node according to the initial activated node and the first neighboring node.
[0097] In this embodiment, the conversation time difference between the initial activation node and the first neighbor node is determined according to the timestamps of the initial activation node and the first neighbor node, thereby determining the weight of the edge of the initial activation node. When the conversation time difference between the initial activation node and the first neighbor node is smaller, it indicates that the information importance of the first neighbor node is higher, and the weight of the edge of the initial activation node is greater.
[0098] Step S503: When it is determined that the weight of the edge of the initial activated node is greater than the activation threshold of the first neighboring node, the first neighboring node is marked as an intermediate activated node.
[0099] In this embodiment, when the weight of the edge of the initial activation node is greater than the activation threshold of the first neighbor node, the first neighbor node is in an activated state, so the first neighbor node is marked as an intermediate activated node; when the weight of the edge of the initial activation node is less than the activation threshold of the first neighbor node, the first neighbor node cannot be in an activated state, and there is no need to mark the first neighbor node as an intermediate activated node.
[0100] Step S504: determining a second neighbor node according to the graph structure and the intermediate activated node.
[0101] In this embodiment, the edges of the intermediate activated node in the graph structure are determined, and then the neighbor nodes of the intermediate activated node are determined according to the edges of the intermediate activated node, so that the neighbor nodes are marked as second neighbor nodes.
[0102] Step S505, determine whether the weight of the edge of the intermediate activation node is greater than the activation threshold of the second neighbor node. If so, mark the second neighbor node as the initial activation node and return to step S501; if not, mark the intermediate activation node as the destination node.
[0103] In this embodiment, when the weight of the edge of the intermediate activated node is greater than the activation threshold of the second neighbor node, the second neighbor node is in an activated state, and the second neighbor node is marked as the initial activated node. The neighbor nodes of the second neighbor node continue to be judged until no new graphic nodes are activated, and the last activated graphic node is marked as the destination node.
[0104] A reply information generation method provided in an embodiment of the present application determines the activation state of a graphic node, and then determines more graphic nodes in an activated state based on the neighbor nodes of all activated graphic nodes in the graphic structure, so that the generated information propagation path has more graphic nodes, thereby introducing more text information for reference in generating reply information, so as to improve the parsing accuracy of the complex semantics and contextual coherence in the current query information.
[0105] Figure 6 The following is a flowchart of the method for generating a reply message according to the fourth embodiment of the present application, which is described in detail as follows:
[0106] Step S601, determining the weight of each graph node in the graph structure according to a preset information propagation path generation model.
[0107] In this embodiment, the constructed graph structure is input into the information propagation path generation model, and different weights are assigned to all graph nodes based on the information propagation path generation model, so that the model can pay more attention to important graph nodes and ignore unimportant nodes, which is used to improve the modeling ability of complex relationships between nodes and make the node representation more accurate and distinctive.
[0108] In this embodiment, preferably, the information propagation path generation model can adopt Graph Attention Networks (GAT), and stack multiple layers of Graph Neural Networks (GNN) inside the Graph Attention Networks (GAT), so that each layer of GNN can independently learn the representation of the node and can capture contextual information and relationships at different levels, so that the weight of the graph node can more accurately and intuitively reflect the importance of the graph node.
[0109] In this embodiment, GAT introduces an attention mechanism to assign different weights to each node, so that important neighbor nodes receive higher attention weights. For node i and its neighbor node j, GAT's update rule for the node is:
[0110]
[0111] in, represents the representation of node i at layer l, N(i) represents the set of neighbor nodes of node i, and W (l) represents the weight matrix of the lth layer, σ represents the activation function; α ij represents the attention weight of node i to node j, which can be calculated by the following formula:
[0112]
[0113]
[0114] in, is the learned attention parameter vector, || represents the vector concatenation operation, e ij represents the weight of the one-dimensional edge of node i, and LeakyReLU is the activation function.
[0115] Step S602: Determine a second graphic node according to the graphic structure, the first graphic node, and the edge of the first graphic node.
[0116] In this embodiment, the edge of the first graphic node in the graphic structure is determined according to the first graphic node, and then the neighbor node of the first graphic node is determined according to the edge of the first graphic node, and the neighbor node is determined as the second graphic node.
[0117] Step S603, generating a model based on the weight of the second graphic node and a preset information propagation path, and updating the weight of the first graphic node.
[0118] In this embodiment, the weights of the first graph node and the second graph node are determined based on the information propagation path generation model, and then a simple weighted sum can be used to combine the information of the neighboring nodes and the characteristics of the node itself, so that the representation of the node is richer and more representative, because it considers the information from the neighboring nodes while retaining the characteristics of the node itself. This update can make the information representation in the node more distinguishable and expressive.
[0119] In this embodiment, preferably, the information propagation path generation model can adopt Graph Attention Networks (GAT), and stack multiple layers of Graph Neural Networks (GNN) inside the Graph Attention Networks (GAT), so that each layer of GNN can independently learn the representation of the node, so that each GNN layer calculates according to the node weight output by the previous layer, and then passes the calculated result to the next layer. In this way, the information representation of each node will be gradually enriched and updated in the iteration of the multi-layer GNN until a predetermined number of layers is reached or a stop condition is reached.
[0120] Step S604, generating a new graphic node according to the weight of the second graphic node, the updated weight of the first graphic node and a preset information propagation path generation model.
[0121] In this embodiment, the weight of the second graph node and the updated weight of the first graph node are determined based on the information propagation path generation model, and a new node is generated based on the second graph node and the first graph node, aiming to combine the information transmitted by the neighboring nodes with the characteristics of the nodes themselves to generate a new node representation for enriching the node information in the graph structure.
[0122] A reply information generation method provided in an embodiment of the present application integrates multi-source information by combining the information transmitted by neighbor nodes with the characteristics of the nodes themselves, and generates new graphic nodes at the same time, so that the constructed information propagation path better reflects the surrounding environment and context of the nodes, which is conducive to improving the accuracy of parsing complex semantics in query information.
[0123] Corresponding to the method of the above embodiment, Figure 7 A structural block diagram of a reply information generating device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown. Figure 7 The exemplary reply information generating device may be an executing entity of the reply information generating method provided in the aforementioned first embodiment.
[0124] Reference Figure 7 , the reply information generating device comprises:
[0125] Information acquisition module 710, used to acquire user information, product information, historical query information, and current query information;
[0126] A graph structure generating module 720, configured to generate a graph structure according to the historical query information;
[0127] An information propagation path generation module 730, configured to generate an information propagation path according to the graph structure, the current query information and a preset information propagation path generation model; and
[0128] The reply generation module 740 is used to generate reply information according to the user information, the product information, the current query information, the information propagation path and a preset reply generation model.
[0129] The process of each module in the reply information generation device provided in the embodiment of the present application realizing its own function can be specifically referred to the aforementioned Figure 1 The description of the first embodiment is not repeated here.
[0130] The information propagation path generation module 730 includes:
[0131] A starting node generating unit, used to generate a starting node according to the current query information;
[0132] a neighbor node determining unit, configured to determine neighbor nodes according to the starting node and the graph structure; and
[0133] An information propagation path generation unit, configured to generate an information propagation path according to the graph structure, the start node, the neighbor nodes, and a preset information propagation path generation model;
[0134] Wherein, the information propagation path generation unit includes:
[0135] An edge weight determination subunit, used to determine the edge weight of the starting node according to the starting node and the neighboring nodes;
[0136] An activation threshold determination subunit, used to determine the activation threshold of each graphic node in the graphic structure according to the graphic structure and the preset information propagation path generation model;
[0137] a node marking subunit, configured to mark the neighboring node as an initial activation node when it is determined that the weight of the edge of the starting node is greater than the activation threshold of the neighboring node; and
[0138] The node determination subunit is used to determine the destination node according to the graph structure and the initial activation node.
[0139] The process of each unit in the information propagation path generation module 730 provided in the embodiment of the present application realizing its respective function can be specifically referred to the aforementioned Figure 3 The description of the third embodiment is not repeated here.
[0140] The process of each subunit in the information propagation path generation unit provided in the embodiment of the present application realizing its respective function can be specifically referred to the aforementioned Figure 4 The description of the fourth embodiment is not repeated here.
[0141] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0142] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0143] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0144] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0145] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish descriptions, and cannot be understood as indicating or suggesting relative importance. It should also be understood that although the terms "first", "second", etc. are used to describe various elements in some embodiments of the present application in the text, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, the first table can be named as the second table, and similarly, the second table can be named as the first table without departing from the scope of the various described embodiments. The first table and the second table are both tables, but they are not the same table.
[0146] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0147] The reply information generation method provided in the embodiment of the present application can be applied to terminal devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiment of the present application does not impose any restrictions on the specific type of the terminal device.
[0148] For example, the terminal device can be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a vehicle networking terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite wireless device, a wireless modem card, a TV set top box (STB), a customer premises equipment (CPE) and / or other devices for communicating on a wireless system and a next-generation communication system, such as a mobile terminal in a 5G network or a mobile terminal in a future evolved Public Land Mobile Network (PLMN) network, etc.
[0149] As an example but not limitation, when the terminal device is a wearable device, the wearable device can also be a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not just hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are fully functional, large in size, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.
[0150] Figure 8 Schematic diagram of the structure of a terminal device provided by an embodiment of the present application. Figure 8 As shown, the terminal device 8 of this embodiment includes: at least one processor 80 ( Figure 8 Only one is shown in the figure), a memory 81, wherein the memory 81 stores a computer program 82 that can be run on the processor 80. When the processor 80 executes the computer program 82, the steps in the above-mentioned various reply information generation method embodiments are implemented, such as Figure 1 Alternatively, when the processor 80 executes the computer program 82, the functions of each module / unit in the above-mentioned device embodiments are realized, for example, Figure 7Functions of modules 710 to 740 are shown.
[0151] The terminal device 8 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 80 and a memory 81. Those skilled in the art will appreciate that Figure 8 It is only an example of the terminal device 8 and does not constitute a limitation of the terminal device 8. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include an input sending device, a network access device, a bus, etc.
[0152] The processor 80 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0153] In some embodiments, the memory 81 may be an internal storage unit of the terminal device 8, such as a hard disk or memory of the terminal device 8. The memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device 8. Further, the memory 81 may also include both an internal storage unit of the terminal device 8 and an external storage device. The memory 81 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory 81 may also be used to temporarily store data that has been sent or is to be sent.
[0154] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0155] An embodiment of the present application also provides a terminal device, which includes at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor, wherein when the processor executes the computer program, the terminal device implements the steps in any of the above-mentioned method embodiments.
[0156] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0157] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0158] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0159] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0160] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0161] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0162] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for generating a reply message, characterized in that: include: Obtain user information, product information, historical query information, and current query information; generating a graph structure according to the historical query information; Generate an information propagation path according to the graph structure, the current query information and a preset information propagation path generation model; Generate reply information according to the user information, the product information, the current query information, the information propagation path and a preset reply generation model; The historical query information includes historical query text, historical information propagation direction and historical query time; The step of generating a graph structure according to the historical query information specifically includes: Generate a graph node according to the historical query text and the historical query time; Generate edges of graph nodes according to the historical query text and the historical information propagation direction; Determine the weight of the edge according to the historical query time; Generate a graph structure according to the graph nodes, the edges of the graph nodes and the weights of the edges; The step of generating the information propagation path according to the graph structure, the current query information and a preset information propagation path generation model specifically includes: Generate a starting node according to the current query information; Determining neighbor nodes according to the starting node and the graph structure; Generate an information propagation path according to the graph structure, the starting node, the neighboring nodes, and a preset information propagation path generation model; The step of generating the information propagation path according to the graph structure, the starting node, the neighboring nodes and the preset information propagation path generation model specifically includes: Determine the weight of the edge of the starting node according to the starting node and the neighboring nodes; Determining an activation threshold of each graphic node in the graphic structure according to the graphic structure and the preset information propagation path generation model; When it is determined that the weight of the edge of the starting node is greater than the activation threshold of the neighboring node, the neighboring node is marked as an initial activation node; Determining a destination node according to the graph structure and the initial activation node; Generate an information propagation path according to the starting node, the graph structure, the initial activation node, the destination node, and the preset information propagation path generation model; The step of determining the destination node according to the graph structure and the initial activation node specifically includes: Determining a first neighbor node according to the graph structure and the initial activated node; Determining a weight of an edge of the initial activated node according to the initial activated node and the first neighboring node; When it is determined that the weight of the edge of the initial activated node is greater than the activation threshold of the first neighboring node, marking the first neighboring node as an intermediate activated node; Determining a second neighbor node according to the graph structure and the intermediate activated node; Determine whether the weight of the edge of the intermediate activation node is greater than the activation threshold of the second neighbor node. If so, mark the second neighbor node as the initial activation node, and return to the step of determining the first neighbor node based on the graph structure and the initial activation node; if not, mark the intermediate activation node as the destination node.
2. The reply information generating method according to claim 1, characterized in that: After the step of generating a graph structure according to the graph nodes, the edges of the graph nodes and the weights of the edges, the method further includes: Determine the weight of each graphic node in the graphic structure according to a preset information propagation path generation model; Determine a second graphic node according to the graphic structure, the first graphic node, and the edge of the first graphic node; Generate a model based on the weight of the second graphic node and a preset information propagation path, and update the weight of the first graphic node; A new graphic node is generated according to the weight of the second graphic node, the updated weight of the first graphic node and a preset information propagation path generation model.
3. A reply information generating device, characterized in that: include: Information acquisition module, used to obtain user information, product information, historical query information, and current query information; A graph structure generation module, used to generate a graph structure according to the historical query information; An information propagation path generation module, used to generate an information propagation path according to the graph structure, the current query information and a preset information propagation path generation model; as well as A reply generation module, used to generate reply information according to the user information, the product information, the current query information, the information propagation path and a preset reply generation model; The historical query information includes historical query text, historical information propagation direction and historical query time; The step of generating a graph structure according to the historical query information specifically includes: Generate a graph node according to the historical query text and the historical query time; Generate edges of graph nodes according to the historical query text and the historical information propagation direction; Determine the weight of the edge according to the historical query time; Generate a graph structure according to the graph nodes, the edges of the graph nodes and the weights of the edges; The information propagation path generation module includes: A starting node generating unit, used to generate a starting node according to the current query information; a neighbor node determining unit, configured to determine neighbor nodes according to the starting node and the graph structure; and An information propagation path generation unit, configured to generate an information propagation path according to the graph structure, the start node, the neighbor nodes, and a preset information propagation path generation model; Wherein, the information propagation path generation unit includes: An edge weight determination subunit, used to determine the edge weight of the starting node according to the starting node and the neighboring nodes; An activation threshold determination subunit, used to determine the activation threshold of each graphic node in the graphic structure according to the graphic structure and the preset information propagation path generation model; a node marking subunit, configured to mark the neighboring node as an initial activation node when it is determined that the weight of the edge of the starting node is greater than the activation threshold of the neighboring node; and A node determination subunit, used to determine a destination node according to the graph structure and the initial activation node; An information propagation path is generated according to the starting node, the graph structure, the initial activation node, the destination node and the preset information propagation path generation model.
4. A terminal device, characterized in that: The terminal device includes a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor implements the steps of the method according to any one of claims 1 to 2 when executing the computer program.
5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 2 are implemented.
