Information output method and electronic equipment
By constructing historical dialogue records of graph structures and using graph neural networks, the inefficiency problem of dialogue assistants in the face of a large number of historical dialogues is solved, efficient semantic search and contextual association are achieved, and user experience is improved.
Patent Information
- Application Number
- CN202510400149.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-07-04
AI Technical Summary
When existing conversation assistants face a large number of historical conversation records, it is difficult for users to provide efficient semantic search functions, resulting in users being unable to obtain clues related to earlier conversations when they newly open conversations, and the user experience is poor.
By constructing historical dialogue records of graph structures, using graph neural network to manage dialogue models, introducing topic nodes and dialogue nodes, and semantic searches are performed with edge weights to improve search accuracy and contextual correlation.
It realizes efficient semantic-based conversation content search, improves user experience, can accurately locate relevant information and expand the user-aware context length.
Smart Images

Figure CN120256615A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and more particularly, to an information output method and an electronic device. Background Art
[0002] A dialogue assistant usually can only record the user's historical conversations and provide a simple query function. When the user looks back on historical conversations, they often can only search by keywords. This method is inefficient when faced with a large number of conversation records and it is difficult to accurately locate the required information. At the same time, as the conversation content increases, the difficulty for the user to find specific conversation information gradually increases, and the existing system cannot provide an advanced search function based on semantics. Although large language models have the ability to remember context in conversations, when the user starts a new round of conversation, the large language model will not retain most of the memories of the previous conversations with that user.
[0003] This will cause the user to be unable to obtain relevant clues from earlier conversations when starting a new conversation through the dialogue assistant, resulting in a poor user experience of using the dialogue assistant. Summary of the Invention
[0004] In view of this, the present disclosure provides an information output method, apparatus, electronic device, computer-readable storage medium, and computer program product that can integrate historical conversation records.
[0005] One aspect of the present disclosure provides an information output method, including: receiving input information; searching historical conversation records based on the input information to obtain a search result, where the historical conversation records include nodes and connection relationships between the nodes, the nodes include topic nodes and dialogue nodes, and the topic nodes represent the topics of the conversations; and using the search result and the input information as inputs to a dialogue model to obtain output information.
[0006] In some embodiments, the topic nodes correspond to historical keywords, the dialogue nodes correspond to historical conversation data, the connection relationships include direct connection relationships and indirect connection relationships, and the direct connection relationships correspond to edge weights.
[0007] In some embodiments, searching for historical conversation records based on the input information to obtain a search result includes: matching the input information with the topic nodes to obtain K first topic nodes, where K is a positive integer; obtaining W conversation nodes having a direct connection relationship with the K first topic nodes and corresponding edge weights, where W is a positive integer; screening I first conversation nodes among the W conversation nodes whose edge weights are greater than a first preset threshold; calculating the similarity between the I first conversation nodes and the input information to obtain I first similarities; screening out P first conversation nodes based on the I first similarities, where P is a positive integer; selecting, based on the edge weights, the conversation nodes having a direct connection relationship and / or an indirect connection relationship with the P first conversation nodes to obtain O second conversation nodes, where O is a positive integer; and obtaining the corresponding conversation history information of the O second conversation nodes as the search result.
[0008] In some embodiments, calculating the similarity between the I first conversation nodes and the input information to obtain I first similarities includes: calculating the second similarity between the first conversation node and the input information; calculating the third similarity between the first topic node having a direct connection relationship with the first conversation node and the input information; and combining the second similarity and the third similarity to calculate the first similarity.
[0009] In some embodiments, selecting, based on the edge weights, the conversation nodes having a direct connection relationship and / or an indirect connection relationship with the P first conversation nodes includes: screening, based on the connection relationship of the P first conversation nodes, other conversation nodes whose edge weights are greater than a second preset threshold in sequence as the second conversation nodes until the edge weight is less than the second preset threshold, where the other conversation nodes have a direct connection relationship and / or an indirect connection relationship with the P first conversation nodes.
[0010] In some embodiments, the method further includes: locally updating the historical conversation record based on the input information and the output information as new conversation nodes; and / or fully updating the historical conversation record.
[0011] In some embodiments, the local update of the historical conversation record with the input information and the output information as new conversation nodes includes: using the input information and the output information as new conversation nodes, matching a target topic node by calculating the similarity with the topic nodes in the historical conversation record; obtaining a third conversation node directly connected to the target topic node; calculating the similarity between the new conversation node and the third conversation node; screening a fourth conversation node from the third conversation nodes based on the similarity; and locally updating the historical conversation record based on the similarities between the target topic node and the fourth conversation node and the new conversation node.
[0012] In some embodiments, the full update of the historical conversation record includes: obtaining the full information of the historical conversation record, where the full information includes: A nodes, B edge weights, and the historical data corresponding to the A nodes; updating the historical data corresponding to the A nodes through a graph neural network based on the full information; and recalculating the edge weights based on the A nodes with updated historical data.
[0013] In some embodiments, the A nodes include a first node. The updating of the historical data corresponding to the A nodes through a graph neural network based on the full information includes: for the first node, obtaining the neighbor nodes of the first node and the edge weights corresponding to the neighbor nodes of the first node, where the neighbor nodes of the first node and the edge weights corresponding to the neighbor nodes of the first node are data in the full information; and updating the historical conversation data corresponding to the first node through a graph neural network based on the neighbor nodes of the neighbor nodes of the first node and the edge weights corresponding to the neighbor nodes of the first node.
[0014] Another aspect of the present disclosure provides an electronic device, including at least one processor and at least one processing model capable of running on the processor. The processing model can be called by a target application to execute receiving input information; searching for a historical conversation record based on the input information to obtain a search result, where the historical conversation record includes nodes and connection relationships between the nodes, the nodes include topic nodes and conversation nodes, and the topic nodes represent the topics of the conversation; and obtaining output information based on the search result and the input information as the input of the conversation model.
[0015] According to some embodiments of the present disclosure, first, a conversation history record is separately established outside the conversation model. This history record is implemented by a specific graph structure and can be maintained separately to facilitate users to search for historical conversation records related to the current input information, thus compensating for the defect that the current conversation model is difficult to integrate historical conversation records. Moreover, at least a super node (topic node) and ordinary nodes (conversation nodes) are set in this graph structure, which facilitates data search and maintenance. Finally, by combining the search results and the input information to communicate with the conversation model, it can ensure that the output result integrates different historical conversations, correlates the semantics of historical contexts, and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Through the following description of the embodiments of the present disclosure with reference to the drawings, the above and other objects, features, and advantages of the present disclosure will become clearer. In the drawings:
[0017] Figure 1 Schematically shown is an exemplary system architecture 100 to which an information output method, apparatus, electronic device, computer-readable storage medium, and computer program product according to embodiments of the present disclosure can be applied;
[0018] Figure 2 Schematically shown is a flowchart of an information output method according to embodiments of the present disclosure;
[0019] Figure 3 Schematically shown is a graph structure model according to embodiments of the present disclosure;
[0020] Figure 4 Schematically shown is a full-process schematic diagram of an information output according to embodiments of the present disclosure;
[0021] Figure 5 Schematically shown is a full flowchart of a partial update; and
[0022] Figure 6 Schematically shown is a block diagram of an electronic device according to embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0023] Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the following detailed description, for the sake of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, obviously, one or more embodiments can also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present disclosure.
[0024] In the technical solution of the present disclosure, the acquisition, storage, and application of the user's personal information, etc. all comply with the provisions of relevant laws and regulations, adopt necessary confidentiality measures, and do not violate public order and good customs. In the technical solution of the present disclosure, the processing of data such as acquisition, collection, storage, use, processing, transmission, provision, disclosure, and application all comply with the provisions of relevant laws and regulations, adopt necessary confidentiality measures, and do not violate public order and good customs.
[0025] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "including", "comprising", etc. used herein indicate the presence of the described features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0026] In the case of using expressions such as "at least one of A, B, or C, etc.", generally, it should be interpreted according to the meaning that those skilled in the art usually understand this expression (for example, "a system having at least one of A, B, or C" should include, but not be limited to, a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.). The terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of the described features.
[0027] Dialogue assistants usually can only record the user's historical conversations and provide simple query functions. When users look back on historical conversations, they often can only search by keywords, which is inefficient when facing a large number of conversation records and difficult to accurately locate the information needed. At the same time, as the conversation content increases, the difficulty for users to find specific conversation information gradually increases, and existing systems cannot provide advanced semantic-based search functions. Although large language models have the ability to remember context in conversations, when a user starts a new round of conversation, the large language model does not retain most of the memories of the previous conversations with that user.
[0028] This will cause users to be unable to obtain relevant clues from earlier conversations when starting a new conversation through the dialogue assistant, resulting in a poor user experience when using the dialogue assistant.
[0029] Figure 1 Exemplary system architecture 100 to which the information output method, apparatus, electronic device, computer-readable storage medium, and computer program product can be applied according to embodiments of the present disclosure is schematically shown. It should be noted that Figure 1The figure shown is only an example of the system architecture to which the embodiments of the present disclosure can be applied, to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0030] As Figure 1 shown, the system architecture 100 according to this embodiment may include access sides 101, 102, 103, a core network (Core network, CN) 104, and an operation, administration, and maintenance (Operation Administration and Maintenance, OAM) 105. The access side may include, for example, a base station, in which a centralized unit (Centralized Unit, CU) and a distributed unit (Distributed Unit, DU) may be deployed. The base station may include a hub or a convergence device HUB and a radio remote unit (Radio Remote Unit, RRU), etc. The core network is the central part of a mobile communication network, responsible for processing functions such as calls, data transmission, user authentication, and charging. The core network includes multiple network elements, such as a mobile switching center (MSC), a service control point (SCP), and an access control server (ACS), etc. The operation, administration, and maintenance is responsible for the operation, maintenance, and management of the entire system, and maintains the operation, maintenance, and management information of each access side and the core network. For example, the operation, administration, and maintenance monitors the performance and status of the access side to ensure the normal operation of the access side, discovers and solves possible problems in a timely manner; the operation, administration, and maintenance monitors the operating status of the core network, guarantees the stability and service quality of the core network, and configures and optimizes the core network.
[0031] It should be understood that Figure 1 the numbers of the access side, the core network, and the operation, administration, and maintenance in
[0032] are merely illustrative. According to the implementation requirements, there may be any number of access sides, core networks, and operation, administration, and maintenance.
[0032] Based on the Figure 1 scenario described below, the information output method of the embodiments of the present disclosure will be described in detail through Figures 2 to 5 the following.
[0033] Figure 2 Schematically shows a flowchart of the information output method according to an embodiment of the present disclosure.
[0034] As Figure 2 shown, the user equipment scheduling method based on a slice identifier of this embodiment includes operation S210 and operation S230.
[0035] In operation S210, input information is received.
[0036] Specifically, the input information is the dialogue information input by the user, that is, the question information, which is used to have a conversation with the dialogue model. Among them, the input information can be the input information when starting a new conversation, or the input information entered during the conversation process of an existing conversation.
[0037] In a typical scenario, the user can start a new conversation and then input the input information for interacting with the dialogue model to obtain the answer output by the dialogue model. It can be understood that the input information can be the input information for one round of conversation or the input information for multiple rounds of conversation, and no specific limitation is made here.
[0038] In operation S220, search the historical conversation records based on the input information to obtain a search result. Among them, the historical conversation records include nodes and the connection relationships between the nodes. The nodes include topic nodes and dialogue nodes, and the topic nodes represent the topics of the conversations.
[0039] Among them, the data structure of the historical conversation records includes: one or more of graph structure, linear structure, tree structure, graph structure, set structure, etc. Among them, various data structures can also be stored according to topic - dialogue, or only stored according to dialogue, which is defined by relevant personnel; the search result can be real historical information, such as directly recording the previous dialogue information, or historical information processed by data processing means. For example, it can be converted into a feature vector for recording. For another example, it can be first converted into a feature vector for recording, and then the feature vectors corresponding to different records are contextually associated.
[0040] Specifically, when receiving the user's input information, first search in the historical conversation records independent of the dialogue model to obtain the historical conversation records associated with the input information as the search result. Among them, the data structure of the historical conversation records can be a graph structure, and the nodes in the graph structure include topic nodes and dialogue nodes. Among them, the topic nodes correspondingly record relevant topic information (i.e., keywords), and the topic information can be configured by the maintenance personnel themselves. For example, by extracting the keywords that frequently appear in multiple conversation records, such as travel, technology, etc.; while the dialogue nodes record the historical data of the actual conversations. The dialogue nodes can record the entire conversation (such as multiple rounds of conversations), and the dialogue nodes can also record question - answer pairs, and no specific limitation is made here. The search process can be to first determine the topic nodes and then determine the dialogue nodes related to the topic nodes, or the search process can also be to directly match each dialogue node.
[0041] It is understandable that graph neural networks (GNNs), as a deep learning model capable of processing graph-structured data, have the ability to capture relationships between nodes in complex networks. Therefore, converting the user's historical conversation records into a graph structure and processing them using graph neural networks can provide richer semantic information support for semantic search and improve the accuracy of search results. However, how to combine the historical conversation records of the dialogue assistant with graph neural networks to achieve semantic-based dialogue content search, thereby enhancing the user experience. To further improve the accuracy of semantic search, the embodiments of the present disclosure introduce a hierarchical modeling of dialogue topics. By clustering historical conversations through topic models, each topic serves as a supernode and is connected to the corresponding dialogue nodes. This hierarchical graph structure can further improve the ability of GNNs to process complex semantic relationships. Figure 3 Schematically shows a graph structure model according to an embodiment of the present disclosure, such as Figure 3 shown, in this model, it includes multiple topic nodes and multiple dialogue nodes. The relationship between different nodes is determined by the connection lines, and there is no relevant relationship between nodes that are not directly connected. In this way, the hierarchical nature of data storage can be ensured.
[0042] According to an embodiment of the present disclosure, the topic nodes correspond to historical keywords, the dialogue nodes correspond to historical dialogue data, the connection relationship includes a direct connection relationship and an indirect connection relationship, and the direct connection relationship corresponds to an edge weight.
[0043] Among them, both the historical keywords and the historical dialogue data can be stored in the form of embedding vectors. Further, the embedding vectors of the historical keywords and the historical dialogue data can also be stored according to hash values.
[0044] Specifically, when modeling the dialogue records as a graph structure, the user's historical conversations need to be converted into a graph structure during the establishment process. Assume that a set of historical conversation records can be represented as , where represents the i-th dialogue content. The dialogue is modeled as an undirected graph , where: represents the nodes of the dialogue, and the node corresponds to the dialogue . represents the connection relationship between the dialogue nodes, that is, the edge (i.e., the above-mentioned direct connection relationship). Here, the edges can be constructed according to the chronological order of the dialogue, topic relevance, or context association. Define the edge weight matrix W as the association strength between the nodes . The association strength can be calculated using the semantic similarity of the dialogue. Each dialogue has a vectorized representation .
[0045] It should be noted that the role played by edge weights in processes such as node information aggregation, embedding vector update, and semantic matching ensures that the entire system can perform more accurate semantic search when facing complex conversations.
[0046] Specifically, the modeling process of historical conversation records is as follows:
[0047] Dialogue topic modeling. To further improve the accuracy of semantic search, this solution introduces hierarchical modeling of dialogue topics. By clustering historical conversations through topic models, each topic serves as a super node and is connected to the corresponding dialogue nodes. This hierarchical graph structure can further improve the ability to handle complex semantic relationships.
[0048] Among them, the node set represents topic nodes, represents dialogue nodes, and the edges between topic nodes and dialogue nodes represent the relevance between the dialogue and the topic. The embedding vector of a topic node can be obtained by aggregating all the dialogue embeddings under that topic.
[0049] Topic node modeling. When processing the user's historical conversations, the system will identify the topic according to the conversation content and construct the topic as a super node , forming the following structure: ; at the same time, for each dialogue segment calculate its topic probability distribution ; where K is the number of topics, represents the probability that dialogue d belongs to topic K.
[0050] Graph structure construction. After topic modeling, edges will be established between each super node and the relevant dialogue nodes, and these edges reflect the relevance between the topic and the conversation content. The linking and updating mechanism is as follows:
[0051] New topic connection: When new conversation content is identified as relevant to a certain topic, the system will create an edge to connect the corresponding dialogue node to the topic node , and the edge weight reflects the relevance between the topic node and the dialogue node. In the embodiments of the present disclosure, probability is used to represent the relationship strength: , where threshold is the probability threshold, ranging from 0 to 1, and can be adjusted appropriately according to system requirements.
[0052] Combined with Figure 3As shown, the graph structure in the embodiments of the present disclosure includes at least two types of nodes: topic nodes and dialogue nodes. The connection relationships include direct connections and indirect connections. There can be direct connections between topic nodes and dialogue nodes, between topic nodes and dialogue nodes, and between dialogue nodes. The edge weight can represent the similarity between two nodes. It should be emphasized that the historical data stored in the dialogue nodes can be a closed-loop dialogue (such as one question and one answer, one question and multiple answers, multiple questions and multiple answers), and the historical data stored in the dialogue nodes can also be a separate one-sided dialogue (such as a question on the user side, such as an answer on the model side). Among them, the direct connection relationship refers to two directly connected nodes (this connection relationship does not distinguish between topic nodes or dialogue nodes). The direct connection relationship can be, for example, the direct connection relationship between dialogue node 1 and dialogue node 9; the indirect connection relationship refers to two indirectly connected nodes (this connection relationship does not distinguish between topic nodes or dialogue nodes)), and there can be multiple other nodes relayed between the two nodes with an indirect connection relationship. The indirect connection relationship can be, for example, that dialogue node 1 has an indirect connection relationship with dialogue node 10 through dialogue node 9, and the indirect connection relationship can also be, for example, that dialogue node 5 has an indirect connection relationship with dialogue node 7 through dialogue node 3 and dialogue node 4.
[0053] It should be noted that in the embodiments of the present disclosure, the edge (i.e., the direct connection relationship) represents the relationship between various key entities or concepts in the dialogue, and the weight of the edge is used to represent the strength of these relationships. Specifically, the edge weight reflects the degree of association between two nodes. The higher the weight, the stronger the semantic association between these two nodes. When performing semantic search, the system adjusts the priority of node matching through the edge weight in the graph neural network, so as to more accurately find the dialogue record most relevant to the query content. The role of the edge weight in search is mainly reflected in the following aspects: 1) Improving the matching accuracy: When matching the query content with the historical dialogue nodes, considering the edge weight can better capture the dialogue nodes with higher semantic similarity and improve the relevance of the search results; 2) Dynamic optimization: The system continuously updates and optimizes the edge weight according to the user's feedback or newly added dialogue data, so that it can adapt to the changing dialogue context and further improve the search accuracy and user experience.
[0054] In operation S230, based on the search result and the input information as the input of the dialogue model, output information is obtained.
[0055] Specifically, based on the search result retrieved from the historical dialogue record combined with the input information of the current user as the input of the dialogue model, output information can be obtained and presented to the user. Among them, the dialogue model is trained by the R & D personnel themselves and has the function of interacting with the user, which is not specifically limited here.
[0056] In the embodiments of the present disclosure, at least the following beneficial effects can be achieved: 1. Improve query accuracy, efficiently manage historical conversations, and reduce the cognitive burden on users. Compared with traditional keyword searches, this solution supports users to search based on semantics by constructing a graph neural network. The system can understand the intent of the user's query and return more relevant historical conversation records, significantly improving the accuracy and precision of search results. 2. Strong context scalability. By using a graph neural network to manage the historical conversations of the dialogue model, the perceptible context length on the user side can be greatly increased.
[0057] According to an embodiment of the present disclosure, searching for historical conversation records based on the input information to obtain search results includes: matching the input information with the topic nodes to obtain K first topic nodes, where K is a positive integer; obtaining W dialogue nodes and corresponding edge weights that have a direct connection relationship with the K first topic nodes, where W is a positive integer; screening I first dialogue nodes among the W dialogue nodes whose edge weights are greater than a first preset threshold; calculating the similarity between the I first dialogue nodes and the input information to obtain I first similarities; screening out P first dialogue nodes based on the I first similarities, where P is a positive integer; selecting the dialogue nodes that have a direct connection relationship and / or an indirect connection relationship with the P first dialogue nodes based on the edge weights to obtain O second dialogue nodes, where O is a positive integer; and obtaining the dialogue history information corresponding to the O second dialogue nodes as the search results.
[0058] Specifically, when the user performs a semantic search, first, the query statement needs to be converted into an embedding vector . Then, by comparing with the embedding vectors of each node in the graph (where L represents the output of the last layer of the GNN), the similarity is calculated to find the most matching dialogue, as shown in Equation 1 below:
[0059] Equation 1
[0060] In a typical scenario, the user calculates the similarity between the input information and the topic nodes, selects the topic nodes with a similarity higher than a certain threshold to initially determine a certain range to which the current input information belongs; after determining the topic nodes, further screen the dialogue nodes by finding the dialogue nodes directly connected to the topic nodes. For example, in combination with Figure 3As shown, when it is determined that the subject nodes to which the input information belongs include subject node 1 and subject node 2, the determined W dialogue nodes include dialogue node 1, dialogue node 2, dialogue node 3, dialogue node 4, dialogue node 5, dialogue node 6, dialogue node 7, and dialogue node 8. Subsequently, through the method of edge weight screening, a certain number of dialogue nodes, namely the above-mentioned P dialogue nodes, are further determined from these dialogue nodes. Finally, starting from these P dialogue nodes, other relevant dialogue nodes are continuously searched according to the size of the edge weight. Among them, the cut-off condition for searching for a second dialogue node related to any first dialogue node can be set to stop when it is less than a certain threshold.
[0061] According to an embodiment of the present disclosure, calculating the similarity between the I first dialogue nodes and the input information to obtain I first similarities includes: calculating the second similarity between the first dialogue node and the input information; calculating the third similarity between the first subject node having a direct connection relationship with the first dialogue node and the input information; and combining the second similarity and the third similarity to calculate the first similarity.
[0062] Specifically, when determining the first dialogue node, it can be directly calculating the similarity between the input information and each dialogue node in the historical dialogue record separately, and then determining the first dialogue node that meets the conditions through threshold screening; it can also be the similarity obtained by weighting the similarity of the subject nodes, and then determining the first dialogue node through the weighted sum similarity. In this way, the factors affecting the similarity include both subject nodes and dialogue nodes, improving a certain degree of accuracy.
[0063] Among them, the association strength between two dialogues can be shown by Formula 2 below:
[0064]
[0065] Formula 2
[0066] According to an embodiment of the present disclosure, selecting the dialogue nodes having a direct connection relationship and / or an indirect connection relationship with the P first dialogue nodes based on the edge weight includes: screening other dialogue nodes with an edge weight greater than a second preset threshold as the second dialogue nodes in sequence based on the connection relationship of the P first dialogue nodes until the edge weight is less than the second preset threshold, where the other dialogue nodes have a direct connection relationship and / or an indirect connection relationship with the P first dialogue nodes.
[0067] It can be understood that during retrieval, due to the existence of edge weights, it is not necessary to calculate the similarity for all dialogue nodes every time, and based on the correlation between different dialogue nodes obtained from the graph structure, relevant dialogue nodes related to the depth of the search can be iteratively searched, rather than just based on the correlation between a single node and the question node, achieving a fast, comprehensive, and accurate retrieval effect, and extracting the most relevant set of combined dialogue nodes as the memory session for this round of dialogue. In this way, the perceivable context length of the user is greatly extended.
[0068] According to some embodiments of the present disclosure, first, a dialogue history record is separately established outside the dialogue model. This history record is implemented by a specific graph structure and can be maintained separately to facilitate the user to search for historical dialogue records related to the current input information, making up for the defect that the current dialogue model is difficult to integrate historical dialogue records. Moreover, at least a super node (topic node) and ordinary nodes (dialogue nodes) are set in this graph structure, which is convenient for data search and maintenance. Finally, by combining the search results and the input information and communicating with the dialogue model, it can ensure that the output results integrate different historical dialogues, associate the semantics of the historical context, and improve the user experience.
[0069] Figure 4 Schematically shows a full process diagram of an information output according to an embodiment of the present disclosure.
[0070] As Figure 4 shown, the specific query process is as follows:
[0071] User query processing: When the user makes a query, a search is performed in the graph structure. The system first converts the query content into a semantic vector q. At the same time, the system calculates the topic distribution of the query through the topic model. .
[0072] Calculate similarity: Calculate the correlation between the query and the topic node, that is, the probability that the query q belongs to the topic node , as shown in Equation 3 below:
[0073] Equation 3
[0074] Filter the set of dialogue nodes D whose connection weights with the topic node are greater than the threshold through the edge weights, and then calculate the correlation between the query and the dialogue nodes, as shown in Equation 4 below:
[0075] Equation 4
[0076] Combine the similarity for retrieval. According to the calculated correlation, the system can choose to perform a weighted combination of the similarities between the query and the topic node and its corresponding dialogue nodes to achieve a priority ranking of the retrieval results, as shown in Equation 5 below:
[0077]
[0078] Formula 5
[0079] Extract the top P nodes with the highest scores into the output node set O, and then use these P nodes as a new set of dialogue nodes to filter the neighbor dialogue nodes of each node in the set based on edge weights, obtaining a new set of relevant nodes D. Calculate the priority ranking again and extract the top P nodes with the highest scores and put them into the output node set O. Repeat this process until all nodes have been filtered by edge weights or similarity, obtaining the final output node set O.
[0080] Question and answer generation: After retrieving relevant conversations, the system will comprehensively generate responses based on this information and the questions input by the user, as shown in Formula 6 below:
[0081] Formula 6
[0082] Embodiments of the present disclosure propose a graph neural network (GNN) to manage and optimize historical conversation records. By converting conversations into a graph structure, the system can capture the semantic relationships between nodes (entities or concepts) in the conversation and use the graph neural network for node and edge learning and reasoning. A topic super-node and dialogue node hierarchical architecture is proposed, ultimately achieving efficient dialogue management and search based on semantics, with strong scalability and flexibility. Different from optimizing the inference performance of large models in multi-turn conversations, it is proposed to calculate the similarity of conversations using hash values and reuse the calculation results of historical conversations to reduce duplicate calculations. The focus is on being able to reuse the context calculation results of the previous few rounds of conversations through the KV Cache technology based on similarity, without the ability to calculate and manage the relevance and global semantic information between different dialogue nodes, which is also the main difference between this solution and traditional similarity matching.
[0083] According to an embodiment of the present disclosure, the method further includes: locally updating the historical conversation record based on the input information and the output information as new dialogue nodes; and / or fully updating the historical conversation record.
[0084] Specifically, after the user interacts with the dialogue model, a conversation record is formed through the user's input information and the output information of the dialogue model. This conversation record is used as a new node to locally update the historical conversation record, and / or fully update the historical conversation record after meeting certain business conditions. Generally, considering the computing power overhead, full updates need to meet some update conditions. For example, full updates are enabled when the number of new dialogue nodes reaches a certain amount, rather than fully updating the historical record dialogue model in each round.
[0085] It should be noted that the update of the historical conversation record includes the update of the graph structure, structure parameters, and historical data. Among them, the partial update refers to only considering the newly added conversation nodes and the update of the structure parameters and historical data related to the newly added conversation nodes. For example, the partial update includes establishing a direct connection relationship between the newly added conversation nodes and other nodes, and the update of the historical data in the newly added conversation nodes by the neighbor nodes after establishing the direct connection relationship (during the GNN propagation process, the newly added conversation nodes will carry certain data from adjacent conversation nodes), and the update of the edge weights; the full update refers to the update of the historical data and edge weights of all conversation nodes in the historical conversation record. During the full update process, usually, the connection relationship between conversation nodes remains unchanged, and the historical data in all conversation nodes and the edge weights between all conversation nodes are updated through the existing connection relationship. Among them, a certain degree of freedom can also be set for the full update, such as updating 80% of the nodes, 100% of the nodes, etc.
[0086] According to an embodiment of the present disclosure, the local update of the historical conversation record based on the input information and the output information as newly added conversation nodes includes: regarding the input information and the output information as newly added conversation nodes, matching a target topic node by calculating the similarity with the topic nodes in the historical conversation record; obtaining a third conversation node that has a direct connection relationship with the target topic node; calculating the similarity between the newly added conversation node and the third conversation node; screening a fourth conversation node from the third conversation nodes based on the similarity; and locally updating the historical conversation record based on the similarities between the target topic node and the fourth conversation node and the newly added conversation node.
[0087] Specifically, the steps for locally updating the historical conversation record include: first, determining the topic node to which the newly added conversation node belongs, and then calculating the similarity of each directly connected other conversation node under the determined topic node, and through threshold screening, determining the neighbor nodes that have a direct connection relationship with the newly added conversation node, and recording the corresponding edge weights as the initial edge weights; furthermore, through the embedding vectors of the neighbor nodes and the corresponding initial edge weights, updating the embedding vectors and the initial edge weights in the newly added conversation node according to the propagation rules of GNNS.
[0088] Among them, "updating the historical conversation data corresponding to the newly added conversation node through a graph neural network based on the neighbor nodes and the corresponding edge weights of the newly added node" means taking the conversation embedding as the initial feature for information propagation and update, and it is necessary to follow the propagation rules of the graph neural network. The basic propagation rules of the graph neural network are shown in Equation 6 below:
[0089] Equation 6
[0090] Where: represents the embedding vector of node i at the k-th layer; N(i) is the set of neighbor nodes of node i; is the edge weight between node i and node j; is the normalization coefficient; is the trainable weight matrix at the k-th layer; is the bias vector at the k-th layer; is the activation function. It should be noted that the dependent variables in Equation 6, except for , and are all set parameters and will not be elaborated here.
[0091] Through the propagation and update of the multi-layer GNN, the embedding vectors of the nodes gradually integrate the semantic information from the neighbor nodes, enabling the dialogue nodes to capture more context-related features.
[0092] Figure 5 Schematically shows a full flowchart of a local update according to an embodiment of the present disclosure. As Figure 5 shown, during the interaction between the user and the dialogue model, a new set of question-and-answer pairs (a conversation) is generated. The graph structure, edge weights, topic nodes, and dialogue nodes are updated according to the above steps to maintain the real-time nature of the management framework. During implementation, the graph structure can be updated regularly according to the actual needs of the user and the management end. When adding nodes to the graph structure, first determine the topic attribution of the new nodes, then initialize the edge weights between the new nodes and the topic nodes based on probability, then initialize the edge weights between the dialogue nodes based on similarity, and finally update the deep relationship between the dialogue nodes through the graph neural network, which brings about the update of the edge weights between different nodes.
[0093] Through the above steps, an efficient dialogue management and retrieval framework is implemented, which combines the advantages of the graph neural network and the flexibility of the topic nodes, improving the user experience when querying historical conversations. The system can dynamically adjust the topic according to the user's query, calculate the similarity, and generate natural and fluent answers to meet the actual needs of the user.
[0094] According to an embodiment of the present disclosure, the full update of the historical conversation record includes: obtaining the full information of the historical conversation record, where the full information includes: A nodes, B edge weights, and the historical data corresponding to the A nodes; based on the full information, updating the historical data corresponding to the A nodes through the graph neural network; and recalculating the edge weights based on the A nodes after updating the historical data.
[0095] Among them, A nodes include topic nodes and / or conversation nodes, and B edge weights are the corresponding edge weights between the A nodes.
[0096] Specifically, the process of full update includes: based on the above formula 6, obtaining the historical data of each corresponding node and the edge weights of the current update round as the dependent variables of the input of formula 6, and then based on the calculation method of the above formula 6, recalculating and updating the historical data in each node. Furthermore, through the A nodes with updated historical data, recalculate the similarity between each other as the new edge weight. Among them, the number of rounds of full update can be multiple rounds, and the number of rounds is set by the technician himself / herself and is not specifically limited here.
[0097] According to an embodiment of the present disclosure, the A nodes include a first node. Updating the historical data corresponding to the A nodes through a graph neural network based on the full information includes: for the first node, obtaining the neighbor nodes of the first node and the edge weights corresponding to the neighbor nodes of the first node, where the neighbor nodes of the first node and the edge weights corresponding to the neighbor nodes of the first node are the data in the full information; and updating the historical conversation data corresponding to the first node through a graph neural network based on the neighbor nodes of the neighbor nodes of the first node and the edge weights corresponding to the neighbor nodes of the first node.
[0098] Specifically, for the first node in the process of full update, the update method of its corresponding historical data (i.e., feature vector) can be seen in the above formula 6. It can be understood that compared with local update, full update is an update based on the existing nodes and connection relationships through formula 6, while local update needs to add nodes and connection relationships and then perform an update through formula 6.
[0099] It should be emphasized that the neighbor nodes of the first node and the edge weights corresponding to the neighbor nodes of the first node are the data in the full information. That is to say, during the update process, it is ensured that all nodes are updated in the same round, avoiding the updated data of some nodes from participating in the calculation of adjacent nodes, thus causing update disorders. For example, node 1 and node 2 are neighbor nodes. In the first round of update, node 1 has completed the update. When updating node 2, the original historical data of node 1 rather than the historical data after the first round of update needs to be used.
[0100] According to an embodiment of the present disclosure, the information output method further includes: obtaining the number of times the topic node is called within a preset time; and deleting the topic node in the historical conversation record and the corresponding direct connection relationship when the number of calls is less than a preset number threshold.
[0101] Specifically, the embodiments of the present disclosure also have a dynamic update mechanism. As the conversation progresses, the relevance between certain topic nodes and conversation nodes may change and needs to be dynamically managed. First, the system will regularly check the activity of each topic. If a certain topic has not been referenced for a long time or its relevance to the current conversation content gradually decreases, then this topic will be marked as inactive. If the relevance of a certain topic node to all current conversation nodes drops below a threshold, then this topic node and the edges connected to this topic node will be deleted from the graph structure.
[0102] Figure 6 A block diagram of an electronic device suitable for implementing the above method according to an embodiment of the present disclosure is schematically shown.
[0103] The electronic device includes at least one processor and at least one processing model that can run on the processor. The processing model can be called by a target application to execute receiving input information; searching historical conversation records based on the input information to obtain a search result, where the historical conversation records include nodes and the connection relationships between the nodes, the nodes include topic nodes and conversation nodes, and the topic nodes represent the topics of the conversation; and using the search result and the input information as the input of a conversation model to obtain an output information.
[0104] As Figure 6 shown, an electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage section 908 into a random access memory (RAM) 903. The processor 901 can include, for example, a general microprocessor (such as a CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (such as an application-specific integrated circuit (ASIC)), etc. The processor 901 can also include on-board memory for caching purposes. The processor 901 can include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0105] In the RAM 903, various programs and data required for the operation of the electronic device 900 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. The processor 901 executes various operations of the method flow according to an embodiment of the present disclosure by executing the programs in the ROM 902 and / or the RAM 903. It should be noted that the programs can also be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 can also execute various operations of the method flow according to an embodiment of the present disclosure by executing the programs stored in the one or more memories.
[0106] According to an embodiment of the present disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, and the input / output (I / O) interface 905 is also connected to the bus 904. The electronic device 900 may further include one or more of the following components connected to the I / O interface 905: an input portion 906 including a keyboard, a mouse, etc.; an output portion 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage portion 908 including a hard disk, etc.; and a communication portion 909 including a network interface card such as a LAN card, a modem, etc. The communication portion 909 performs communication processing via a network such as the Internet. The drive 910 is also connected to the input / output (I / O) interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read from it can be installed into the storage portion 908 as needed.
[0107] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist separately without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the method according to the embodiments of the present disclosure is implemented.
[0108] An embodiment of the present disclosure further includes a computer program product, which includes a computer program, and the computer program includes program codes for executing the method shown in the flowchart. When the computer program product runs in a computer system, the program codes are used to cause the computer system to implement the method of the embodiments of the present disclosure.
[0109] Those skilled in the art can understand that the features recited in the various embodiments and / or claims of the present disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly recited in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features recited in the various embodiments and / or claims of the present disclosure can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present disclosure.
[0110] The above describes the embodiments of the present disclosure. However, these embodiments are only for illustrative purposes and not for limiting the scope of the present disclosure. Although the embodiments are separately described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present disclosure.
Claims
1. An information output method, comprising: Receiving input information; Searching historical conversation records based on the input information to obtain a search result, wherein the historical conversation records include nodes and connection relationships between the nodes, the nodes include topic nodes and conversation nodes, and the topic nodes represent the topics of the conversations; And Using the search result and the input information as inputs to a conversation model to obtain output information.
2. The method according to claim 1, characterized in that, The topic nodes correspond to historical keywords, the conversation nodes correspond to historical conversation data, the connection relationships include direct connection relationships and indirect connection relationships, and the direct connection relationships correspond to edge weights.
3. The method according to claim 2, wherein The searching historical conversation records based on the input information to obtain a search result includes: Matching the topic nodes based on the input information to obtain K first topic nodes, where K is a positive integer; Obtaining W conversation nodes having direct connection relationships with the K first topic nodes and corresponding edge weights, where W is a positive integer; Filtering I first conversation nodes among the W conversation nodes whose edge weights are greater than a first preset threshold; Calculating the similarity between the I first conversation nodes and the input information to obtain I first similarities; Filtering out P first conversation nodes based on the I first similarities, where P is a positive integer; Based on the edge weights, selecting the conversation nodes having direct connection relationships and / or indirect connection relationships with the P first conversation nodes to obtain O second conversation nodes, where O is a positive integer; and Obtaining the conversation historical information corresponding to the O second conversation nodes as the search result.
4. The method according to claim 3, wherein The calculating the similarity between the I first conversation nodes and the input information to obtain I first similarities includes: Calculating the second similarity between the first conversation node and the input information; Calculating the third similarity between the first topic node having a direct connection relationship with the first conversation node and the input information; and Combining the second similarity and the third similarity to calculate the first similarity.
5. The method according to claim 3, wherein The selecting the conversation nodes having direct connection relationships and / or indirect connection relationships with the P first conversation nodes based on the edge weights includes: Based on the P first conversation nodes and through the connection relationships, sequentially filtering out other conversation nodes whose edge weights are greater than a second preset threshold as the second conversation nodes until the edge weights are less than the second preset threshold, where the other conversation nodes have direct connection relationships and / or indirect connection relationships with the P first conversation nodes.
6. The method according to claim 2, wherein The method further includes: Partially updating the historical conversation records based on the input information and the output information as newly added conversation nodes; and / or fully updating the historical conversation records.
7. The method according to claim 6, characterized in that, The partially updating the historical conversation records based on the input information and the output information as newly added conversation nodes includes: Regarding the input information and the output information as newly added conversation nodes, and matching target topic nodes by calculating the similarity with the topic nodes in the historical conversation records; Obtaining third conversation nodes having direct connection relationships with the target topic nodes; Calculate the similarity between the newly added dialogue node and the third dialogue node; Based on the similarity, screen the fourth dialogue node from the third dialogue node; Based on the similarities between the target topic node and the fourth dialogue node and the newly added dialogue node, locally update the historical dialogue record.
8. The method according to claim 7, characterized in that The full update of the historical dialogue record includes: Obtain the full information of the historical dialogue record, where the full information includes: A nodes, B edge weights, and the historical data corresponding to the A nodes; Based on the full information, update the historical data corresponding to the A nodes through a graph neural network; and Based on the A nodes after updating the historical data, recalculate the edge weights.
9. The method according to claim 8, wherein The A nodes include a first node, The updating the historical data corresponding to the A nodes through a graph neural network based on the full information includes: For the first node, obtain the neighbor nodes of the first node and the edge weights corresponding to the neighbor nodes of the first node, where the neighbor nodes of the first node and the edge weights corresponding to the neighbor nodes of the first node are data in the full information; and Based on the neighbor nodes of the neighbor nodes of the first node and the edge weights corresponding to the neighbor nodes of the first node, update the historical dialogue data corresponding to the first node through a graph neural network.
10. An electronic device includes at least one processor and at least one processing model capable of running on the processor, the processing model being callable by a target application to perform receiving input information; searching historical conversation records based on the input information to obtain a search result, where, The historical dialogue record includes nodes and the connection relationships between nodes. The nodes include topic nodes and dialogue nodes. The topic nodes represent the topics of the dialogue; and based on the search results and the input information as the input of the dialogue model, obtain the output information.
Citation Information
Cited By
Interaction method and device, equipment and medium
CN122332547A
Interaction methods, apparatuses, devices, and media
CN122332547B
