Artificial intelligence-based interactive question and answer method and system

By constructing dependency graphs and knowledge graphs, and combining DQN and Transformer algorithms, the problems of insufficient deep semantic relationship capture and static knowledge graphs in existing interactive question answering systems are solved, thus realizing an efficient and personalized question answering system.

CN120541186BActive Publication Date: 2026-02-27HANGZHOU LUXIANG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510695776.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-28
Publication Date
2026-02-27
Estimated Expiration
2045-05-28

AI Technical Summary

Technical Problem

Existing interactive question-answering systems have limitations in text question parsing, failing to accurately capture deep semantic relationships between phrases and entities. They also lack task decomposition capabilities, cannot effectively meet the needs of real-time dynamic reasoning, and rely on static knowledge graphs for knowledge retrieval, which cannot meet real-time updates.

Method used

By constructing a dependency graph to capture the dependencies in the problem, building a nested task dependency graph, using the DQN algorithm for dynamic path planning, combining the Transformer algorithm to generate personalized prediction text, and dynamically updating it through a knowledge graph, while using API queries to query external knowledge bases to supplement knowledge.

Benefits of technology

It improves the logic and hierarchy of the question-answering system, enhances the ability to recognize task fragments, ensures that high-priority tasks are processed first, meets the needs of real-time dynamic reasoning, and improves the efficiency and accuracy of answer generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120541186B_ABST
    Figure CN120541186B_ABST
Patent Text Reader

Abstract

The application discloses an interactive question and answer method and system based on artificial intelligence, relates to the technical field of interactive question and answer, and comprises the following steps: converting a user input text question into a vector representation, combining a dependency relation tree of a text entity to construct a relation graph, capturing the dependency relation in the question as an edge weight value, composing an adjacency matrix to construct a node degree matrix, determining a normalized graph Laplacian matrix, performing feature decomposition, determining an optimal clustering number, clustering language phrases of the text question, and determining a task fragment set of different clusters. The method disclosed by the application not only has semantic association between language phrases by constructing a dependency relation graph, but also integrates syntax relation, ensures the integrity of text structure information, takes the degree of a node as a quantitative index of local strength in the graph, the information directly supports subsequent normalization processing of the Laplacian matrix, provides a uniform scale, and avoids the problem of uneven data range.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of interactive question and answer, in particular to an interactive question and answer method and system based on artificial intelligence. BACKGROUND

[0002] With the rapid development of artificial intelligence technology, intelligent interactive question and answer systems based on natural language processing (NLP) have been widely researched and applied. These question and answer systems realize the analysis of numerical problems to complex open-ended problems through technical means, helping human-computer interaction, customer support, education guidance and other multi-scenario fields. Traditional question and answer systems usually rely on search patterns based on rules or templates and shallow semantic matching methods. Their function design directly associates the text input by the user with the key index of the knowledge base, thereby returning direct answers. In recent years, the rise of deep learning has injected new vitality into question and answer technology. In particular, the use of pre-trained language models combined with knowledge graph technology can capture deep semantic relationships in the context of text and mine causal relationships from structured data, providing more support for the question and answer reasoning process.

[0003] However, the existing technology still has one-sidedness in analyzing text problems. The word segmentation and grammar-dependent modeling still stays in shallow processing, which cannot accurately capture the deep semantic relationships between phrases and entities, greatly restricting the logicality and hierarchy of the question and answer process. Secondly, the task decomposition ability is insufficient - many question and answer technologies cannot decompose complex problems into sub-problems and analyze the dependency relationships between sub-problems, thereby properly constructing task segments and their priorities, resulting in a fuzzy hierarchical structure of the reasoning path. Thirdly, knowledge calling usually relies on static knowledge graphs, and knowledge nodes are not dynamically adjusted or updated, which cannot effectively meet the real-time dynamic reasoning needs. SUMMARY

[0004] In view of the above existing problems, the present application is proposed.

[0005] Therefore, the present application provides an interactive question and answer method and system based on artificial intelligence to solve the problems of one-sidedness in analyzing text problems in the existing technology, word segmentation and grammar-dependent modeling still staying in shallow processing, which cannot accurately capture the deep semantic relationships between phrases and entities, greatly restricting the logicality and hierarchy of the question and answer process. Secondly, the task decomposition ability is insufficient - many question and answer technologies cannot decompose complex problems into sub-problems and analyze the dependency relationships between sub-problems, thereby properly constructing task segments and their priorities, resulting in a fuzzy hierarchical structure of the reasoning path. Thirdly, knowledge calling usually relies on static knowledge graphs, and knowledge nodes are not dynamically adjusted or updated, which cannot effectively meet the real-time dynamic reasoning needs.

[0006] To solve the above technical problems, the present application provides the following technical solutions:

[0007] In a first aspect, the present application provides an interactive question and answer method based on artificial intelligence, which comprises converting a user input text question into a vector representation, constructing a relationship graph combining a dependency relationship tree of a text entity, capturing the dependency relationship in the question as an edge weight value, composing an adjacency matrix to construct a node degree matrix, determining a normalized graph Laplacian matrix, and performing eigenvalue decomposition to determine the optimal number of clusters, clustering the language phrases of the text question, determining the task fragment set of different clusters, and calculating the dependency strength of different task fragment sets to construct a nested task dependency graph, calculating the complexity based on the number of nodes and edges according to the graph algorithm, and calibrating the priority;

[0008] Constructing a knowledge graph, calculating the matching score of the knowledge graph node and the language phrase through keyword matching, constructing an active edge set, using a DQN algorithm for dynamic path planning, and predicting a reasoning path;

[0009] Sorting the task fragments contained in the reasoning path, extracting user historical interaction record data, modeling the time dependence of user features, composing an input vector with the knowledge node sequence vector of the reasoning path and the user portrait embedding vector, and generating a personalized prediction text through a Transformer algorithm;

[0010] Performing fuzzy matching on the question, supplementing the question content, outputting an optimized complete question, encrypting the data for transmission, and performing cloud storage.

[0011] As a preferred scheme of the interactive question and answer method based on artificial intelligence, wherein the determination of the normalized graph Laplacian matrix, the determination of the optimal number of clusters, the clustering of the language phrases of the text question, the construction of the nested task dependency graph, and the calibration of the priority comprise,

[0012] According to the word vector set Q, the language phrase is taken as a dependency relationship tree graph node, the dependency relationship between the nodes of the relationship matrix R is taken as a graph edge, and the product of the cosine similarity distance of the language phrase and the dependency matrix value is taken as the edge weight value;

[0013] Based on the edge weight value, an adjacency matrix is composed, and the sum of the edge weight values of each node and all other nodes in the adjacency matrix is taken as the degree of the i-th node, and a node degree matrix is constructed;

[0014] The normalized graph Laplacian matrix is determined from the adjacency matrix A through the node degree matrix D ;

[0015] Eigenvalue decomposition is performed on the normalized Laplacian matrix to determine the eigenvalues and eigenvectors;

[0016] The Eigengap judgment method is used to calculate the difference between any two consecutive eigenvalues of the Laplacian matrix as the difference gap g(i).

[0017] The index at which the gap size of the feature value group at the i-th reaches a maximum value is determined as the optimal cluster number k;

[0018] According to the clustering result, the language phrases are divided into a plurality of subsets as a task fragment set ;

[0019] According to the dependency state of the nodes in different task fragment sets, all nodes m in the task fragment set and all nodes n in the task fragment are traversed The dependency degree between the fragment sets is calculated;

[0020] According to the semantic dependency strength of different task fragments, a dependency matrix is constructed, and based on the sum of the mean and twice the standard deviation of the historical semantic dependency strength as a dependency threshold, if the semantic dependency strength is greater than the dependency threshold, it is judged that there is a semantic dependency relationship between the task fragments;

[0021] Based on the dependency relationship, a nested task dependency graph D is constructed, wherein the task fragment set is taken as a node, and a directed edge is constructed according to the dependency relationship. For each task fragment set , the complexity is calculated based on the number of nodes and edges, and the priority is calibrated.

[0022] As a preferred scheme of the interactive question and answer method based on artificial intelligence, wherein: the knowledge graph is constructed by calculating the matching score of the knowledge graph node and the language phrase through keyword matching, constructing an activated edge set, and predicting a reasoning path, including,

[0023] Based on the global knowledge base, the knowledge graph is imported, wherein the node represents a calibrated question and answer knowledge entity data, and the edge set is set as the edge of the knowledge graph according to the cause-effect relationship and type relationship of the question and answer knowledge;

[0024] An embedding vector is generated for each knowledge graph node, a semantic embedding of the node description is generated through pre-trained BERT, a network structure embedding of the node is generated using a graph embedding algorithm, and the weight of the semantic embedding and the structure embedding is determined according to the history calibration to form a final node embedding;

[0025] The matching score of the knowledge graph node is calculated through keyword matching;

[0026] Based on the sum of the mean and standard deviation of the historical matching score as a matching threshold, if the semantic matching score is greater than or equal to the matching threshold, the corresponding knowledge node is activated, an activated knowledge subgraph node set is constructed, and an activated edge is determined according to the activated knowledge subgraph node to construct an activated edge set;

[0027] ​The DQN algorithm is used for dynamic path planning, the state of deep reinforcement learning is defined, the current access node of the knowledge graph, the target task fragment of the current reasoning, the recorded knowledge node visited, the action of deep reinforcement learning is defined as selecting the next knowledge node in the current state, the reward decision of deep reinforcement learning is defined, including the semantic matching score of the corresponding knowledge subgraph node, and the corresponding knowledge subgraph node of the task fragment with high priority is preferentially processed;

[0028] The deep Q-Learning reinforcement learning algorithm is used for model training to predict a reasoning path, and the path comprises a series of knowledge nodes from a task fragment to a target node;

[0029] The task fragment set And the reasoning path are subjected to knowledge missing determination, information keywords that are not covered by the knowledge graph are determined, an external knowledge base is called by using an API to obtain related node and edge information, a new knowledge graph node set and a new edge set are determined, the knowledge graph is dynamically updated, and the reasoning path is predicted again.

[0030] As a preferred scheme of the interactive question and answer method based on artificial intelligence, wherein the time dependence of the user feature is modeled by a Transformer algorithm to generate personalized prediction text, including,

[0031] According to the task priority set, the task fragments contained in the reasoning path are sorted, and the knowledge content is extracted for the sorted task fragments to generate answers, and a task answer set is constructed;

[0032] The user history interaction record is used, the asking frequency of the user related content is used as a user numerical feature, the time dependence of the user feature is modeled by using a recurrent neural network LSTM from the interaction record, and a user portrait embedding vector is output;

[0033] The reasoning path, the task answer set and the user portrait embedding are jointly input into an answer generation model, the knowledge node sequence vector of the reasoning path and the user portrait embedding vector are used to form an input vector, a Transformer algorithm is used, wherein an encoder and a decoder predict a knowledge node of a next reasoning path through an attention mechanism according to the input vector, and generate personalized prediction text according to the knowledge node.

[0034] As a preferred scheme of the interactive question and answer method based on artificial intelligence, wherein the fuzzy matching of the question is performed, and an optimized complete question is output by supplementing the question content, including,

[0035] Based on the user input question content, the SimHash algorithm is used for question fuzzy matching, and the pre-trained large language model LLM is used for question content supplement, and the complete question optimized by completion is output.

[0036] As a preferred scheme of the interactive question and answer method based on artificial intelligence, wherein: the user input text question is converted into a vector representation, and a dependency relationship tree of the text entity is constructed to build a relationship graph, including,

[0037] Collect and determine the text question for question and answer, decompose the original text into a language phrase set through a word segmentation algorithm, and convert it into a word vector set Q using a pre-trained embedding model BERT;

[0038] The syntax structure of the word vector set Q is analyzed by a dependency parsing tool to generate a dependency relationship tree, and a relationship matrix R is constructed according to the dependency relationship between the language phrases in the word vector set Q.

[0039] As a preferred scheme of the interactive question and answer method based on artificial intelligence, wherein: the data is encrypted and transmitted, and stored in the cloud, including,

[0040] Data records are made for the task fragment set, the nested task relationship graph, the task priority set, the reasoning path, the personalized prediction text, and the optimized complete question, the data is encrypted using AES-256, the encryption key is generated and stored using a secure key management service, and the data is transmitted to the cloud through an HTTPS encrypted channel for safe storage.

[0041] In a second aspect, the present application provides an interactive question and answer method system based on artificial intelligence, comprising,

[0042] A text preprocessing module, in which the user input question is preprocessed, and a dependency relationship tree is generated using a dependency parsing tool;

[0043] A task fragment division module, which clusters and divides the language phrases into a task fragment set, constructs a nested task dependency graph, analyzes the number of nodes and edges to calculate the complexity using a graph algorithm, and simultaneously calibrates the priority of the fragments;

[0044] A knowledge graph module, which constructs a question and answer knowledge graph and uses deep reinforcement learning for dynamic path prediction;

[0045] A personalized answer generation module, which sorts the task fragments contained in the reasoning path according to the task priority, and generates a prediction text answer related to the user;

[0046] A question optimization module, which processes the fuzzy matching of the question and supplements the content of the question;

[0047] The security storage module stores data in an encrypted manner.

[0048] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and wherein the computer program, when executed by the processor, implements any step of the artificial intelligence-based interactive question answering method according to the first aspect of the present application.

[0049] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any step of the artificial intelligence-based interactive question answering method according to the first aspect of the present application.

[0050] The present application has the following beneficial effects: by constructing the dependency relation graph, the semantic association between language phrases is not only ensured, but also the syntactic relation is integrated, so that the integrity of the text structure information is ensured, the degree of the node is used as a quantitative index of the local strength in the graph, this information directly supports the subsequent Laplacian matrix normalization processing, provides a uniform scale, avoids the imbalance problem of the data range, the embedding matrix reduces the high-dimensional graph relation to a clustering-friendly subspace, reduces the data complexity, enhances the operability of the clustering algorithm, can dynamically identify a task fragment set with high semantic and dependency relation, introduces the domain knowledge in the question answering field in the process of constructing the knowledge graph, through this structured organization, the dispersed question answering data is converted into a high-level graph network, the matching score of the knowledge node is calculated through the keyword matching, which makes up for the deficiency of the static rule reasoning, the API is used to query the external knowledge base to obtain new node and edge information, which improves the original knowledge resource while avoiding repeated storage of redundant data, the task fragments are sorted by combining the task priority set, so that the task fragments with high priority are processed preferentially, thereby meeting the task logic timing requirement and reducing the interference of low-priority tasks on the key problem solving. BRIEF DESCRIPTION OF DRAWINGS

[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0052] Fig. 1 The flowchart of the artificial intelligence-based interactive question answering method in embodiment 1.

[0053] Fig. 2 The structure diagram of the artificial intelligence-based interactive question answering system in embodiment 1. DETAILED DESCRIPTION

[0054] In order to make the above objectives, characteristics and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0055] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. The present application, however, can be practiced in a variety of ways other than those specifically described herein, and the present application should not be construed as being limited to the embodiments described herein as potentially specific details are described with reference to exemplary implementations to provide a thorough description of embodiments of the application.

[0056] Secondly, the "one embodiment" or "embodiment" referred to herein means that the specific features, structures or characteristics can be included in at least one implementation of the present application. "In one embodiment" appearing in different places in the specification does not mean the same embodiment, nor is it an embodiment that is independent of or mutually exclusive of other embodiments.

[0057] Embodiment 1, reference Figs. 1-2 For the first embodiment of the present application, the embodiment provides an interactive question and answer method based on artificial intelligence, including the following steps:

[0058] S1, converting the user input text question into a vector representation, constructing a relationship graph in combination with the dependency relation tree of the text entity, capturing the dependency relation in the question as an edge weight value, composing an adjacency matrix to construct a node degree matrix, determining a normalized graph Laplacian matrix, and performing feature decomposition to determine the optimal number of clusters, clustering the language phrases of the text question, determining the task fragment set of different clusters, and calculating the dependency strength of different task fragment sets, constructing a nested task dependency graph, calculating the complexity based on the number of nodes and edges according to the graph algorithm, and marking the priority;

[0059] Preferably, the user input text question is converted into a vector representation, and a relationship graph is constructed in combination with the dependency relation tree of the text entity, including,

[0060] Collect and determine the text question for question and answer, decompose the original text into a language phrase set through a word segmentation algorithm, use a pre-trained embedding model BERT to convert it into a word vector set Q;

[0061] The syntax structure of the word vector set Q is analyzed by a dependency parsing tool to generate a dependency relation tree, (the dependency relation tree reflects the syntax relationship between words), and a relationship matrix R is constructed according to the dependency relationship between the language phrases in the word vector set Q, wherein if there is a dependency relationship between two language phrases, it is recorded as 1, otherwise it is recorded as 0, and a dependency relationship matrix is constructed for different language phrases according to the language phrases of the word vector set Q.

[0062] By collecting texts suitable for the question and answer system, ensuring that the questions are targeted and diverse, the coverage and semantic expression ability of the system question and answer are improved from the data source, and the word segmentation algorithm decomposes the original text question into a set of independent language phrases, extracts semantic units from long text or complex questions, reduces the complexity of text processing, and BERT not only generates word vectors of individual language phrases, but also captures relationship information between language phrases through its context window, providing semantic background support for subsequent dependency relationship modeling;

[0063] The dependency tree clearly presents the context dependency between words at the syntactic level. Through dependency parsing, the syntactic position of different language phrases and their relationship are revealed, making the syntactic information more organically integrated into the subsequent modeling sequence, laying the foundation for subsequent inference of semantic dependencies between language units. For complex expressions such as nested clauses and modifier words in questions, dependency parsing can effectively straighten out the logic between phrases, thus simplifying the task of converting complex text into structured representation. Through matrix form, the dependency relationship between language phrases in the question is no longer dependent on the tree structure, but is expressed in a more easily operated linear algebra form. The relationship matrix usually presents a sparse characteristic because most language phrases do not directly depend on each other. The sparse representation of the matrix not only reduces the storage complexity, but also can be used as input for subsequent sparse graph algorithms, improving computational efficiency. By processing the dependency relationship between language phrases through matrix, different question and answer problems can be converted into a unified mathematical model, suitable for large-scale task processing.

[0064] Further, a standardized graph Laplacian matrix is determined, the optimal number of clusters is determined, the language phrases of the text question are clustered, and a nested task dependency graph is constructed to determine the priority, including,

[0065] According to the word vector set Q, the language phrases are taken as the nodes of the dependency relationship tree graph, and the dependency relationship between the nodes of the relationship matrix R is taken as the edges of the graph. The product of the cosine similarity distance of the language phrases and the dependency matrix value is calculated as the edge weight value, which is represented as:

[0066] ;

[0067] Wherein represents the edge weight value of the edge between the i-th and j-th language phrases, and represent the i-th and j-th language phrases, represents the dependency matrix value of the i-th and j-th language phrases;

[0068] Based on the adjacency matrix is composed of and the sum of the edge weight values between each node and all other nodes in the adjacency matrix is taken as the degree of the i-th node, and a node degree matrix is constructed, which is represented as:

[0069]

[0070] wherein denotes a node , is the i-th diagonal element of the node degree matrix D, and n denotes the total number of nodes in the task graph;

[0071] The normalized graph Laplacian matrix L is determined from the adjacency matrix A by the node degree matrix D , (wherein the off-diagonal elements of A are used to indicate whether there is a connection between nodes i and j, and the size of the connection strength), is expressed as:

[0072] ;

[0073] wherein denotes the normalized Laplacian matrix, I denotes the identity matrix (diagonal line is all 1, and the rest is all 0), denotes the inverse matrix of the square root of the node degree matrix, which is used to normalize the weight;

[0074] The normalized Laplacian matrix is subjected to eigenvalue decomposition to determine the eigenvalues and eigenvectors, which are expressed as:

[0075] ;

[0076] wherein denotes the eigenvalues of the Laplacian matrix, denotes the corresponding eigenvectors, (each eigenvector is an n-dimensional vector, indicating the projection of the node in the characteristic space);

[0077] The Eigengap judgment method is used to calculate the difference between any two consecutive eigenvalues as the difference gap g(i) according to the eigenvalues of the Laplacian matrix, which is expressed as:

[0078] ;

[0079] wherein denotes the gap size of the eigenvalue group at the i-th place, and denote the eigenvalues of the i+1-th and i-th Laplacian matrix, respectively;

[0080] The index at which the gap size of the eigenvalue group at the i-th place reaches the maximum value is determined as the optimal clustering number k, which is expressed as:

[0081] ;

[0082] ​combining eigenvectors corresponding to the first k minimum eigenvalues of the Laplacian matrix into a new embedding matrix, and performing k-means clustering, outputting as a clustering result of language phrases .

[0083] dividing language phrases into several subsets as task fragment sets according to the clustering result .

[0084] calculating the dependency degree between task fragment sets according to the dependency state of nodes in different task fragment sets , and calculating the semantic dependency strength of task fragments .

[0085] .

[0086] wherein denotes the semantic edge weight of node and node , denotes the total number of edges, denotes the semantic dependency strength of task fragments to task fragments .

[0087] constructing a dependency matrix according to the semantic dependency strength of different task fragments, taking the sum of the mean and twice the standard deviation of historical semantic dependency strength as a dependency threshold, and judging that there is a semantic dependency relationship between task fragments if the semantic dependency strength is greater than the dependency threshold;

[0088] constructing a nested task dependency graph D based on the dependency relationship, wherein the task fragment sets are taken as nodes, and directed edges are constructed according to the dependency relationship, and for each task fragment set , the complexity is calculated based on the number of nodes and edges, and the priority is calibrated, and is expressed as:

[0089] .

[0090] .

[0091] wherein denotes the task complexity of the i th task fragment set, denotes the priority of the i th task fragment set.

[0092] The nodes of the dependency graph are derived from the word vector set Q, and the edges are determined by the dependency relationship of the relationship matrix R and the cosine similarity of the language phrases, so that the dependency graph not only has the semantic association between language phrases, but also integrates the syntactic relationship, ensuring the integrity of the text structure information. The edge weight combines the syntactic dependency and semantic strength between phrases by calculating the semantic similarity of the word vector and the value of the dependency relationship matrix to construct the graph structure and form the adjacency matrix, thereby capturing more accurate and complete association information between language phrases. The adjacency matrix collects the contextual dependency and semantic information between words through the edge weight, so that the subsequent calculation can stably develop around the logical relationship between the ontology language phrases;

[0093] The degree of the node is used as a quantitative indicator of the local strength in the graph, which directly supports the subsequent Laplacian matrix normalization process, provides a uniform scale, and avoids the problem of uneven data range. The square root inverse matrix of the degree matrix is used to realize the normalization process, ensuring that the graph structure can maintain numerical stability in feature decomposition, while avoiding the risk of model distortion caused by excessive data of specific nodes. The standardized Laplacian matrix further captures the global graph structure information, making the node distribution in the feature space more uniform, which helps to improve the accuracy of clustering analysis;

[0094] The eigenvalues and eigenvectors of the Laplacian matrix directly represent the internal patterns of the graph structure (such as partitioning trend, interconnection strength), realizing the quantitative modeling of the potential substructure of the language phrase relationship network. The role of Eigengap jump analysis is to automatically select the optimal clustering number k, avoiding the unnatural or excessive division of task fragments caused by manually setting the clustering number. It allows the natural clustering number to be determined based on the jump information between the eigenvalues of the matrix, ensuring that the result conforms to the inherent characteristics of the data itself. The eigenvalues and eigenvectors of the Laplacian matrix reveal the potential subset division characteristics of the graph structure composed of language phrases. Combined with Eigengap, dynamically determining the optimal clustering number can avoid the inappropriate task fragment number set by humans, ensuring that the generated task structure is natural and reasonable, and the fragments have relative independence;

[0095] By selecting the eigenvectors corresponding to the top k eigenvalues, the embedding matrix reduces the high-dimensional graph relationship to a clustering-friendly subspace, reduces the data complexity, enhances the operability of the clustering algorithm, can dynamically identify a task fragment set with high semantic and dependency relationship, takes the task fragment set as a node, takes the dependency relationship quantization result as a directed edge in the graph, and finally generates a task dependency graph. The semantic dependency strength between task fragments explicitly represents the relevance between task fragments. The dependency matrix captures the strength, and the threshold is determined by the historical mean and standard deviation to generate a nested dependency graph between task fragments, thereby forming a task execution path with clear hierarchy and clear logic. The nested task dependency graph provides the logical dependency between task fragments, and the complexity calculation of the number of nodes and edges clearly determines the processing difficulty of the task fragments. Combined with priority calibration, an intelligent processing path optimization scheme can be generated to improve task execution efficiency.

[0096] S2, constructing a knowledge graph, calculating the matching score of the knowledge graph node and the language phrase through keyword matching, constructing an activated edge set, using a DQN algorithm for dynamic path planning, and predicting a reasoning path;

[0097] Preferably, the knowledge graph is constructed, the matching score of the knowledge graph node and the language phrase is calculated through keyword matching, the activated edge set is constructed, and the reasoning path is predicted, comprising,

[0098] Importing a knowledge graph based on a global knowledge base, wherein the nodes are calibrated question and answer knowledge entity data, and the edge set is set as the edge of the knowledge graph according to the causal relationship and type relationship of the question and answer knowledge;

[0099] Generating an embedding vector for each knowledge graph node, generating a semantic embedding of the node description through a pre-trained BERT, generating a network structure embedding of the node using a graph embedding algorithm, determining the weight of the semantic embedding and the structure embedding according to the historical calibration, and composing a final node embedding;

[0100] The matching score of the knowledge graph node is calculated through keyword matching, which is represented as:

[0101] ;

[0102] Wherein represents the semantic matching score, represents the language phrase belonging to the task fragment set , and represents the knowledge node embedding;

[0103] The sum of the mean and standard deviation of the historical matching score is taken as the matching threshold. If the semantic matching score is greater than or equal to the matching threshold, the corresponding knowledge node is activated, an activated knowledge subgraph node set is constructed, and an activated edge is determined according to the activated knowledge subgraph node to construct an activated edge set.

[0104] The DQN algorithm is used for dynamic path planning, the state of deep reinforcement learning is defined, including the current access node of the knowledge graph, the current inference target task fragment, and the record of the visited knowledge nodes (to avoid repeated inference), the action of deep reinforcement learning is defined as selecting the next knowledge node in the current state, and the reward decision of deep reinforcement learning is defined, including the semantic matching score of the corresponding knowledge subgraph node, and the corresponding knowledge subgraph node with high task fragment priority is preferentially processed, which is represented as:

[0105]

[0106] wherein represents the total reward;

[0107] The deep Q-Learning reinforcement learning algorithm is used for model training to predict the inference path, and the path contains a series of knowledge nodes from the task fragment to the target node;

[0108] The knowledge missing judgment is performed on the task fragment set and the inference path, the information keywords that the knowledge graph fails to cover are determined, and the API is called to query the external knowledge base to obtain related node and edge information, the newly added knowledge graph node set and the newly added edge set are determined, the knowledge graph is dynamically updated, and the inference path prediction is performed again.

[0109] The node represents the calibrated question and answer knowledge entity, the edge set is defined by the causal relationship and the type relationship, the domain knowledge in the question and answer field is introduced in the process of constructing the knowledge graph, through this structured organization, the scattered question and answer data is converted into a high-level graph network, so that the system has more correlation and logic in understanding the knowledge relationship, the introduction of the causal relationship and the type relationship not only reflects the structural nature of the knowledge, but also makes the knowledge have reasoning depth, the relationship-based modeling can more accurately represent the causal chain and concept category level of the problem, and provides a basis for subsequent dynamic reasoning;

[0110] The matching score of the knowledge node is calculated by keyword matching, and the mean plus standard deviation of the historical matching score is used as the activation threshold, so that the high correlation nodes can be dynamically screened out, the construction of the activated node and the corresponding activated edge set not only reduces the calculation range of the inference, but also reduces the resource consumption of the graph size, in the path planning, the path reward is calculated in real time, the reinforcement learning model not only selects the directly related knowledge, but also discovers the hidden logical relationship (i.e. explores the indirectly related nodes through multi-hop inference), which makes up for the shortcomings of the static rule-based reasoning, uses the API to query the external knowledge base to obtain new node and edge information, improves the original knowledge resources while avoiding repeated storage of redundant data, the newly introduced nodes and edges are accurately matched to the existing graph, the graph structure consistency is maintained, and the knowledge density is dynamically enhanced.​

[0111] S3, sorting the task fragments contained in the reasoning path, extracting user historical interaction record data, modeling the time dependence of user features, combining the knowledge node sequence vector of the reasoning path and the user portrait embedding vector into an input vector, and generating personalized prediction text through the Transformer algorithm;

[0112] Preferably, the time dependence of the user features is modeled, and the personalized prediction text is generated through the Transformer algorithm, including,

[0113] According to the task priority set, the task fragments contained in the reasoning path are sorted, and for the sorted task fragments, the knowledge content is extracted to generate answers, and a task answer set is constructed;

[0114] Using user historical interaction records, using the asking frequency of user-related content as a user numerical feature, using a recurrent neural network LSTM to model the time dependence of user features from the interaction records, and outputting a user portrait embedding vector;

[0115] The reasoning path, the task answer set and the user portrait embedding are jointly input into the answer generation model, the knowledge node sequence vector of the reasoning path and the user portrait embedding vector are combined into an input vector, and the Transformer algorithm is used, wherein the encoder and the decoder predict the next knowledge node of the reasoning path according to the input vector through the attention mechanism, and generate personalized prediction text according to the knowledge node.

[0116] By combining the task priority set to sort the task fragments, it is ensured that high-priority task fragments are processed first, thereby meeting the task logic timing requirements, reducing the interference of low-priority tasks on key problem solving, and significantly shortening the redundant links of assumptions or inferences in the answer generation process, making the answer generation more efficient and focused. By extracting knowledge content to generate task answers one by one, the knowledge node information in the reasoning path is converted into structured key answers, ensuring the logical integrity of the answer generation, and by using the LSTM model to capture the time trend of user features, it can dynamically adapt to the periodicity and content tendency changes of user behavior, ensuring that the portrait can reflect the user's current interests and needs in real time. The knowledge node sequence of the reasoning path, the task answer set and the user portrait embedding vector are jointly input into the generation model, realizing the end-to-end integration of semantic reasoning results and user personalized needs. The embedding coding of the knowledge node sequence in the reasoning path provides the context information of the problem solving, and the user portrait provides the support of the personalized scene. Both of them are jointly coded, and the finally generated answer takes into account the correctness of the problem itself and the pertinence of the user experience;

[0117] The attention mechanism of the Transformer enables the model to effectively capture the association between distant knowledge points in the input sequence, especially in the reasoning path node sequence. The model can mine the semantic logic between multiple nodes to ensure that the final generated answer has cross-scene logical coherence. The multi-layer network of the encoder and decoder strengthens the association of the reasoning path knowledge nodes through the attention mechanism, while dynamically adjusting the generated expression style in combination with the user portrait features to make the answer content more in line with the actual needs of the user.

[0118] S4, fuzzy matching of the question sentence is performed, the content of the question sentence is supplemented, and an optimized and completed question is output, the data is encrypted and transmitted, and cloud storage is performed;

[0119] Preferably, the fuzzy matching of the question sentence is performed, the content of the question sentence is supplemented, and an optimized and completed question is output, including,

[0120] Based on the question content input by the user, the SimHash algorithm is used for fuzzy matching of the question sentence, and the pre-trained large language model LLM is used for question content supplementation, and an optimized and completed question is output.

[0121] Through the combination of fuzzy matching by SimHash and semantic supplementation by LLM, the question is converted from a fuzzy or non-standard expression into a concise and clear target question. The optimized and completed question not only has accurate semantics, but also has content that is more in line with the associated nodes in the knowledge graph, effectively shortening the path from question analysis to answer generation.

[0122] Further, the data is encrypted and transmitted, and cloud storage is performed, including,

[0123] Data records are performed on the task fragment set, the nested task relationship graph, the task priority set, the reasoning path, the personalized prediction text, and the optimized and completed question. The data is encrypted using AES-256, the encryption key is generated and stored using a secure key management service, and the data is transmitted to the cloud for secure storage through an HTTPS encrypted channel.

[0124] The task fragment set and the nested task relationship graph depict the division and dependency relationship of the task, the task priority set clearly defines the execution order, the reasoning path records the decision path of the knowledge points, and the personalized prediction text and the completed question record the final user response result. After encrypting the task fragment and the high-priority task processing information, even if there is a potential risk (such as storage attacks) in the shared or storage service, the decryption difficulty is extremely high, thereby minimizing the security problems caused by data leakage. Through cloud encryption storage and secure communication, the user capacity and processing capacity of the question and answer system are expanded, and high security protection is provided for the communication between the edge node and the center cloud.

[0125] The embodiment also provides an interactive question and answer system based on artificial intelligence, comprising,

[0126] A text preprocessing module, in which a question input by a user is preprocessed, and a dependency relation tree is generated by using a dependency parsing tool;

[0127] A task fragment division module, which clusters language phrases, divides a task fragment set, constructs a nested task dependency graph, analyzes node and edge numbers to calculate complexity by using a graph algorithm, and labels a priority of the fragment;

[0128] A knowledge graph module, which constructs a question and answer knowledge graph and uses deep reinforcement learning to perform dynamic path prediction;

[0129] A personalized answer generation module, which sequentially sorts task fragments contained in a reasoning path according to a task priority, and generates a predicted text answer related to the user;

[0130] A question optimization module, which processes fuzzy matching of a question and supplements content of the question;

[0131] A secure storage module, which encrypts storage of data.

[0132] The embodiment also provides a computer device suitable for the case of the interactive question and answer method based on artificial intelligence, comprising a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions to realize the interactive question and answer method based on artificial intelligence provided in the above embodiment.

[0133] The computer device can be a terminal, and the computer device comprises a processor, a memory, a communication interface, a display screen and an input device which are connected through a system bus. The processor of the computer device is used to provide calculation and control capability. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to perform wired or wireless communication with an external terminal. The wireless communication can be realized by WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or can be a key, a trackball or a touchpad arranged on the shell of the computer device, or can be an external keyboard, a touchpad or a mouse and the like.

[0134] The embodiment also provides a storage medium having a computer program stored thereon, the program being executed by a processor to implement the method for implementing an interactive question and answer based on artificial intelligence as proposed in the above embodiment; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic storage, a flash memory, a magnetic disk, or an optical disk.

[0135] To sum up, the application ensures the integrity of text structure information by constructing a dependency relation graph, which not only has semantic association between language phrases, but also integrates syntactic relations, ensures the integrity of text structure information, and directly supports subsequent Laplacian matrix normalization processing by using the degree of nodes as a quantitative indicator of local strength in the graph, provides a uniform scale, avoids the problem of uneven data range, reduces the dimension of high-dimensional graph relations to a clustering-friendly subspace through embedding matrix, reduces data complexity, enhances the operability of the clustering algorithm, can dynamically identify a task fragment set with high semantic and dependency relations, introduces domain knowledge in the field of question and answer in the process of constructing a knowledge graph, converts scattered question and answer data into a high-level graph network through such structured organization, calculates a matching score of a knowledge node through keyword matching, makes up for the deficiency of static rule-based reasoning, uses an API to query an external knowledge base to obtain new node and edge information, improves original knowledge resources while avoiding repeated storage of redundant data, sorts task fragments by combining a task priority set, ensures that high-priority task fragments are processed first, thereby meeting the requirements of task logic timing and reducing the interference of low-priority tasks on the solution of key problems.

[0136] It should be noted that the above embodiments are only used to illustrate the technical solutions of the application rather than limit the application, although the application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the application can be modified or replaced equivalently without departing from the spirit and scope of the technical solutions of the application, and all of them should be covered in the scope of the claims of the application.

Claims

1. An interactive question and answer method based on artificial intelligence, characterized by, The method comprises the following steps: Converting the user input text question into a vector representation, constructing a relationship graph combining the dependency tree of the text entity, capturing the dependency relationship in the question as the edge weight, composing an adjacency matrix to construct a node degree matrix, determining a normalized graph Laplacian matrix, performing feature decomposition, determining the optimal number of clusters, clustering the language phrases of the text question, determining the task fragment set of different clusters, calculating the dependency strength of different task fragment sets, constructing a nested task dependency graph, calculating the complexity based on the number of nodes and edges, and marking the priority; Building a knowledge graph, calculating the matching score of the knowledge graph node and the language phrase through keyword matching, constructing an activated edge set, using a DQN algorithm for dynamic path planning, and predicting a reasoning path; Sorting the task fragments contained in the reasoning path, extracting user historical interaction record data, modeling the time dependence of user features, composing an input vector with the knowledge node sequence vector of the reasoning path and the user portrait embedding vector, and generating a personalized prediction text through a Transformer algorithm; Performing fuzzy matching on the question, supplementing the question content, outputting an optimized complete question, encrypting the data for transmission, and storing it in the cloud; The method of building a knowledge graph, calculating the matching score of the knowledge graph node and the language phrase through keyword matching, and predicting a reasoning path comprises the following steps: Importing a knowledge graph based on a global knowledge base, wherein the nodes represent calibrated question and answer knowledge entity data, and the edge set is set as the edge of the knowledge graph based on the causal relationship and type relationship of the question and answer knowledge; Generating an embedding vector for each knowledge graph node, generating a semantic embedding of the node description through a pre-trained BERT, generating a network structure embedding of the node using a graph embedding algorithm, determining the weight of the semantic embedding and the structure embedding based on historical calibration, and composing a final node embedding; Calculating the matching score of the knowledge graph node through keyword matching; Using the sum of the mean and standard deviation of the historical matching score as the matching threshold, if the semantic matching score is greater than or equal to the matching threshold, activating the corresponding knowledge node, constructing an activated knowledge subgraph node set, and determining the activated edge based on the activated knowledge subgraph node to construct an activated edge set; Using a DQN algorithm for dynamic path planning, defining the state of deep reinforcement learning, including the current access node of the knowledge graph, the target task fragment of the current reasoning, and the recorded visited knowledge nodes, defining the action of deep reinforcement learning as selecting the next knowledge node in the current state, and defining the reward decision of deep reinforcement learning, including the semantic matching score of the corresponding knowledge subgraph node and the corresponding knowledge subgraph node with high task fragment priority; Using a deep Q-Learning reinforcement learning algorithm to train the model and predict a reasoning path, the path including a series of knowledge nodes from the task fragment to the target node; Task fragment set Knowledge missing determination is performed on the reasoning path, information keywords that the knowledge graph fails to cover are determined, an external knowledge base is called by using an API to obtain related node and edge information, a new knowledge graph node set and a new edge set are determined, dynamic updating of the knowledge graph is performed, and reasoning path prediction is performed again. 2.The AI-based interactive question and answer method of claim 1, wherein: The method of determining a normalized graph Laplacian matrix, determining the optimal number of clusters, clustering the language phrases of the text question, constructing a nested task dependency graph, and marking the priority comprises the following steps: Based on the word vector set Q, language phrases are used as nodes in the dependency tree graph, and the dependency relationships between nodes in the relation matrix R are used as graph edges. The product of the cosine similarity distance of the language phrases and the dependency matrix value is calculated as the edge weight. An adjacency matrix is ​​constructed based on edge weights, and the degree of the i-th node is determined by the sum of the edge weights of each node and all other nodes in the adjacency matrix. A node degree matrix is ​​then constructed. determining a normalized graph Laplacian matrix from the adjacency matrix A by a node degree matrix D ; Perform eigenvalue decomposition on the standardized Laplacian matrix to determine eigenvalues ​​and eigenvectors; The Eigengap judgment method is used to calculate the difference between any two consecutive eigenvalues ​​of the Laplace matrix as the difference gap g(i). The index at which the gap size of the eigenvalue group reaches its maximum value at position i is determined as the optimal number of clusters k; dividing the language phrases into several subsets as the task segment set according to the clustering result ; According to the dependency state of the nodes within the different task fragment sets, all nodes m in the task fragment set and all nodes n of the task fragment set are traversed to calculate the dependency degree between the fragment sets . ​ A dependency matrix is ​​constructed based on the semantic dependency strength of different task segments. The sum of the mean and twice the standard deviation of the historical semantic dependency strength is used as the dependency threshold. If the semantic dependency strength is greater than the dependency threshold, it is determined that there is a semantic dependency relationship between the task segments. A nested task dependency graph D is constructed based on the dependency relationship, wherein a task fragment set is taken as a node, a directed edge is constructed according to the dependency relationship, and the priority of each task fragment set is calibrated based on the number of nodes and edges , and the complexity is calculated based on a graph algorithm. 3.The AI-based interactive question and answer method of claim 2, wherein: The modeling of the time dependence of user features, and the generation of personalized predictive text through the Transformer algorithm, includes... The task fragments in the reasoning path are sorted according to the task priority set. For the sorted task fragments, the knowledge content is extracted in turn to generate answers, and a task answer set is constructed. Using user history interaction records, the frequency of user-related questions is used as the user's numerical feature. A recurrent neural network LSTM is used to model the time dependence of user features from the interaction records and output the user profile embedding vector. The reasoning path, task answer set, and user profile are embedded into a joint input answer generation model. The knowledge node sequence vector of the reasoning path and the user profile embedding vector are combined to form the input vector. The Transformer algorithm is used, where the encoder and decoder predict the knowledge node of the next reasoning path based on the input vector through an attention mechanism, and generate personalized prediction text based on the knowledge node. 4.The AI-based interactive question and answer method of claim 3, wherein: The process of performing fuzzy matching on the question and supplementing the question content to output an optimized and complete question includes: Based on the user's input question content, the SimHash algorithm is used for fuzzy matching of the question, and a pre-trained large language model LLM is used to supplement the question content, outputting an optimized and complete question. 5.The AI-based interactive question and answer method of claim 4, wherein: The process of transforming the user-input text question into a vector representation and constructing a relation graph by combining it with a dependency tree of text entities includes: Collect and determine the text questions for question answering, decompose the original text into a set of language phrases using a word segmentation algorithm, and transform it into a word vector set Q using a pre-trained embedding model BERT; The syntactic structure of the word vector set Q is analyzed using a dependency parsing tool to generate a dependency relation tree. A relation matrix R is then constructed based on the dependency relations between language phrases in the word vector set Q. 6.The AI-based interactive question and answer method of claim 5, wherein: The encrypted transmission and cloud storage of data include, Data records are made for the task fragment set, nested task relationship graph, task priority set, reasoning path, personalized prediction text, and complete question for optimization completion, the data is encrypted using AES-256, the encrypted key is generated and stored using a secure key management service, and is transmitted to the cloud through an HTTPS encrypted channel for safe storage.

7. The interactive question-answering system based on artificial intelligence, according to any one of claims 1-6, characterized in that: The method comprises the following steps: A text preprocessing module preprocesses the user input question and generates a dependency relationship tree using a dependency parsing tool; A task fragment division module clusters and divides the language phrases into a task fragment set, constructs a nested task dependency graph, uses a graph algorithm to analyze the node and edge number to calculate the complexity, and simultaneously calibrates the priority of the fragment; A knowledge graph module constructs a question and answer knowledge graph and uses deep reinforcement learning for dynamic path prediction; A personalized answer generation module sequentially sorts the task fragments contained in the reasoning path according to the task priority to generate a prediction text answer related to the user; An interrogative sentence optimization module processes the fuzzy matching of the interrogative sentence and supplements the content of the interrogative sentence; A secure storage module encrypts and stores the data.

8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that: The processor executes the computer program to realize the steps of the interactive question and answer method based on artificial intelligence according to any one of claims 1-6.

9. A computer readable storage medium having stored thereon a computer program, characterized in that: The computer program is executed by the processor to realize the steps of the interactive question and answer method based on artificial intelligence according to any one of claims 1-6.

Citation Information

Patent Citations

  • Knowledge graph character attribute value completion method based on adaptive graph convolution

    CN115329090A

  • Multi-hop time sequence knowledge graph question and answer method and system

    CN117829298A