A mental health atlas retrieval method based on an enhanced large model
By employing a psychological and medical graph retrieval method based on an enhanced large model, the problems of insufficient information coverage and limited intent recognition capabilities in complex query scenarios of knowledge graph retrieval are solved. This achieves high adaptability and technological advantages in the field of mental health, generates logically clear and professional answers, and improves the accuracy and interpretability of intelligent diagnosis and question-answering systems.
Patent Information
- Application Number
- CN202511113073.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-08-11
AI Technical Summary
Existing knowledge graph retrieval methods suffer from insufficient information coverage, limited intent recognition capabilities, lack of retrieval path optimization capabilities, and insufficient integration of generative models with knowledge graphs in complex query scenarios, resulting in insufficient accuracy and interpretability of intelligent diagnosis and question answering systems.
This paper adopts a psycho-medical graph retrieval method based on an enhanced large model. By combining dynamic path optimization, CoT reasoning, and knowledge reasoning with a large model, it improves the retrieval capability and answer quality of the intelligent question answering system. This includes extracting topic entities using a large language model, obtaining user intent tags using a lightweight large model, controlling the relationship filtering and path expansion of the knowledge graph based on intent tags, constructing a semantic path set, and outputting the answer through an answer generation function.
It achieves high adaptability and technological advantages in the field of mental health, accurately identifies multiple intentions, expands search dimensions, generates more comprehensive, logically clear, and professional answers, enhances the interpretability of the system and user trust, and improves the reliability and scientific nature of intelligent diagnosis of mental health.
Smart Images

Figure CN120611069B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and more specifically, to a method for retrieving a psychomedical graph based on an enhanced large model. Background Technology
[0002] In recent years, with the rapid development of artificial intelligence technology, Retrieval-Augmented Generation (RAG) has become an important research direction in the field of Natural Language Processing (NLP). This technology combines the advantages of knowledge retrieval and generative models, enabling Large Language Models (LLMs) to utilize external knowledge bases for information supplementation, thereby improving the accuracy and interpretability of their answers. RAGs are widely used in fields such as intelligent question answering, medical and health consultation, and financial analysis to enhance the model's ability to answer factual questions. However, large-scale models augmented with graph-based RAG (Retrieval-Augmented Generation) suffer from several problems in practical applications: For example, traditional large-scale models rely heavily on large-scale pre-training corpora when generating answers related to mental health, making them susceptible to data bias and resulting in inaccurate or unscientific answers; existing large-scale models rely on single task classifications or keyword matching for intent recognition, making it difficult to accurately identify complex user needs, especially when multiple or implicit intents are involved, leading to misjudgments or omissions; most RAG-based methods only perform single-path or static knowledge retrieval, resulting in insufficient coverage of user questions and difficulty in comprehensively acquiring relevant information; furthermore, current systems lack sufficient contextual understanding and logical reasoning capabilities during answer generation, leading to redundant, illogical, or unprofessional answers.
[0003] In intelligent diagnostics and question-answering systems, knowledge graphs (KG) are widely used for information retrieval and reasoning due to their structured knowledge representation capabilities. Knowledge graphs store a large number of entities and their relationships, enabling the system to perform queries based on the associations between entities and provide more accurate answers. However, existing knowledge graph retrieval methods face many challenges in complex query scenarios, such as the information limitations of a single retrieval path, insufficient handling of multi-intent questions, limited collaborative optimization capabilities between knowledge graphs and generative models, and a lack of dynamic path adjustment capabilities.
[0004] Furthermore, while Retrieval Enhancement Generation (RAG) and Knowledge Graph (KG) have been widely used in fields such as intelligent question answering, healthcare, and information retrieval, they still suffer from the following major technical shortcomings:
[0005] Limited search methods and insufficient information coverage: Existing knowledge graph retrieval typically employs single-path or fixed-rule query patterns, making it difficult to retrieve information from multiple related paths simultaneously. This results in potentially incomplete or missing information in the search results. In complex query scenarios, a single search method is insufficient to meet users' needs for comprehensive information.
[0006] Limited intent recognition capabilities make it difficult to handle complex problems: Traditional methods mostly use single intent classification or keyword-based matching. When faced with complex questions involving multiple intents and multi-level queries, the recognition accuracy is low, and the methods cannot effectively break down the user's complex query, resulting in search results that cannot accurately match the user's needs.
[0007] The retrieval path lacks optimization capabilities: Existing knowledge graph retrieval paths are usually predefined or based on fixed rules, making it difficult to dynamically adjust the retrieval strategy according to factors such as query content, historical query records, and user feedback. As a result, they cannot flexibly adapt to different query needs in different application scenarios, affecting retrieval efficiency and result accuracy.
[0008] Insufficient integration of generative models with knowledge graphs: Existing RAG systems mainly rely on document-level retrieval. When processing structured knowledge, generative models cannot fully utilize the entity relationships in knowledge graphs for logical reasoning, which can easily lead to hallucination problems, i.e., the generated content may not conform to the facts, affecting the credibility and interpretability of the system.
[0009] Insufficient reasoning ability and lack of deep information integration: Existing methods mostly rely on static rules or shallow reasoning, making it difficult to conduct complex path reasoning based on knowledge graphs. As a result, they cannot deeply explore the implicit connections between knowledge, which leads to a lack of advanced reasoning ability in professional fields such as medicine and law, resulting in illogical or even erroneous answers.
[0010] In summary, optimizing knowledge graph retrieval methods within the RAG framework to more effectively support intelligent diagnosis, decision support, and question-answering systems has become one of the core research issues. Summary of the Invention
[0011] In view of this, the present invention proposes a psychomedical graph retrieval method based on an enhanced large model. By combining dynamic path optimization, CoT reasoning, and knowledge reasoning with a large model, the retrieval capability and answer quality of the intelligent question answering system are improved, effectively solving the problems existing in the above-mentioned prior art.
[0012] To achieve the above objectives, this invention proposes a psychomedical atlas retrieval method based on an enhanced large model, characterized by comprising:
[0013] To address user input issues, a large language model is used to extract topic entities;
[0014] Based on the aforementioned topic entities, a lightweight large model is used to obtain user intent tags;
[0015] Based on the user intent tags, control the relationship filtering and path expansion process of the knowledge graph to construct a semantic path set;
[0016] Determine whether the set of semantic paths contains sufficient semantic information to support answering the question. If the determination result is "yes", output the answer based on the answer generation function, according to the user input question and the set of semantic paths.
[0017] Furthermore, the process of relationship filtering and path expansion based on the user intent tags to control the knowledge graph includes:
[0018] Retrieve the corresponding graph relationship tag set based on the user intent tag;
[0019] In the initialization subgraph, starting from the current entity, all adjacency relationships are traversed, and only candidate paths whose relationship type belongs to the graph relationship label set are retained;
[0020] The semantic path set is constructed based on the candidate paths.
[0021] Furthermore, the process of relation filtering and path expansion based on the user intent tag to control the knowledge graph also includes traversing the adjacency relationship in each hop, and using the new entity in the current hop as the starting point for the next hop to perform cyclic relation filtering and path expansion, and constructing the semantic path set based on the cyclic results.
[0022] Furthermore, the method for filtering the candidate paths is as follows:
[0023]
[0024] in, This is the first set of paths generated under intent-driven conditions. Represents a set of user intent tags. For triple paths in a knowledge graph, starting from the entity ,relation and target entity composition, It is a knowledge graph containing all known structured triples.
[0025] Furthermore, the method for determining whether the semantic path set contains sufficient semantic information to support answering the question is as follows:
[0026]
[0027] in, Indicates an input pair, where For the user's original question, For a set of paths, This is a path sufficiency assessment function. When the output is 1, it means that the path information is sufficient to support the answer to the question; when the output is 0, it means that the path information is not yet complete.
[0028] Furthermore, when the judgment result is "no", the path expansion continues according to the preset maximum number of hops.
[0029] Furthermore, the output function for the answer is as follows:
[0030]
[0031] in, For generating functions, Indicates an input pair, where For the user's original question, It is a set of paths.
[0032] Furthermore, during the training process of the lightweight large model, the Baidu ERNIE-4.0 model is used to classify the input questions, and the correctly classified questions are used as the basic data for the training set and validation set, while the incorrectly classified questions are used as the test set.
[0033] Furthermore, in the process of acquiring user intent tags using a lightweight large model, according to the classification task requirements of the mental health question-and-answer scenario, the parameters of the lightweight large model are fine-tuned using imperative data generation and the LoRA method, including: inserting a low-rank weight update structure into the key attention weight module of the lightweight large model, keeping the main structure of the model unchanged during the fine-tuning process, and only updating the parameters of the low-rank weight update structure.
[0034] Compared to existing search enhancement generation (RAG) techniques, the advantages of this invention are as follows:
[0035] This invention offers greater adaptability and technological advantages in the field of mental health. Regarding entity recognition, it employs a large-scale language model (LLM), resulting in more accurate recognition of mental health-related entities. Standardized entity matching ensures that the retrieved content aligns with professional medical terminology, reducing the generalization problems associated with keyword matching in traditional RAG systems. In terms of intent recognition, existing RAG systems typically only support single intent recognition, limiting the search scope. This invention, however, uses a large model combined with COT (Chain-of-Thought) reasoning to decompose complex user input questions into intents, enabling the system to accurately identify multiple intents, such as queries about symptoms of depression, the relationship between low mood and depression, and coping strategies. This expands the search dimensions and makes the search results more comprehensive.
[0036] In knowledge retrieval, traditional RAGs often employ single-path retrieval, potentially leading to missing or incomplete information. This invention, based on Multi-Path Parallel Inference (MPPI), combines entity recognition and multi-intent analysis to dynamically retrieve information along multiple paths within the knowledge graph, forming a more complete relevant subgraph. This improves knowledge coverage and information accuracy, and optimizes retrieval ranking through path weights, ensuring priority access to core information. Regarding answer generation, traditional RAGs may rely solely on simple splicing of retrieved documents, resulting in logically confused or unprofessional content. This invention, however, uses knowledge graph enhancement, enabling large models to organize and optimize their responses based on structured reasoning relationships, ensuring that generated mental health advice is more scientific, logically clear, and professional.
[0037] Furthermore, compared to traditional RAG systems where tracing the source of answers is difficult, this invention utilizes knowledge graphs to construct visualized reasoning paths, allowing users to intuitively understand the basis for recommended content and enhancing system explainability and user trust. More importantly, while existing RAG technology is mostly applied to general question answering, this invention is specifically designed for the field of mental health. By combining medical knowledge graphs and mental health data, it provides more accurate diagnostic assistance and counseling suggestions for mental health issues such as depression and anxiety, ensuring the system's industry applicability and clinical reference value, thereby significantly improving the reliability and scientific rigor of intelligent mental health diagnosis. Attached Figure Description
[0038] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. In the drawings:
[0039] Figure 1 This is a schematic diagram illustrating the architecture principle of the psychomedical graph retrieval method based on enhanced large models proposed in this invention. Detailed Implementation
[0040] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the disclosure to those skilled in the art. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0041] Example 1
[0042] This embodiment proposes a psychomedical atlas retrieval method based on an enhanced large model, the architecture of which is as follows: Figure 1 As shown, its core technical solution is to introduce a multi-level intent recognition mechanism to accurately locate the user's query intent, thereby directly filtering out the matching path in the knowledge graph, replacing the step of relying on the Large Language Model (LLM) for entity relationship scoring in the original ToG method, so as to improve the reasoning efficiency and accuracy of the question answering system.
[0043] The technical solution of the present invention will be described in detail based on the above content, specifically including:
[0044] Step 1: Initialization
[0045] In this invention, the initialization phase is initiated, which aims to extract structured starting point information for graph reasoning from the user's natural language questions, including entities and intents.
[0046] First, the input question is encoded using a large language model with strong language understanding capabilities (such as the ChatGPT series), and potential topic entities are extracted through prompts or zero-shot question answering for subsequent location and expansion in the knowledge graph. This process can be represented as:
[0047]
[0048] in For user issues, The set of entities identified.
[0049] Subsequently, a lightweight, large-scale model with a finely tuned 1.5B parameter range (such as Qwen2) is used to identify user intent, employing a hierarchical structure including two stages: primary classification and secondary multi-label classification. First, a primary intent graph is output using softmax, such as "query," "recommendation," and "diagnosis" categories.
[0050]
[0051] in, Main intent label, This is the weight matrix of the first-level intent classifier. For Transformer encoders The output vector representing the position indicates the semantic representation of the entire sentence. This is the bias term for the first-level intent classifier. This means taking the category with the highest probability as the predicted label.
[0052] Next, based on the primary intent, further fine-grained multi-label recognition is performed to obtain more specific intent sub-labels, such as "query symptoms" and "recommend food," represented as:
[0053]
[0054] in, Predicted probabilities for all secondary intent labels (multi-label). This is the Sigmoid activation function, used for multi-label classification (each label is independently determined whether to activate). This is the weight matrix for the secondary intent classifier (which can output multiple labels). This is the output vector at position [CLS] in the Transformer encoder, representing the semantic representation of the entire sentence. This is the bias term for the secondary intent classifier.
[0055]
[0056] in, To refine the intent tag set, For tag indexing, For the first The predicted probability of each secondary label. The set tag activation threshold.
[0057] This hierarchical structure, while ensuring a lightweight model, enables accurate identification of mixed intents in user queries (such as "query + recommendation"), providing a clear path control basis for subsequent exploration phases. At this point, the initialization phase completes the structural analysis of the problem, and the output includes: entity sets. Idea / Image Label Refine the intent tag set .
[0058] Step Two: Exploration Phase
[0059] After initializing the question entity and intent structure, the exploration phase begins. The goal of this phase is to filter out paths highly relevant to the user's intent from the knowledge graph and gradually expand the subgraph to support the final answer reasoning.
[0060] In traditional ToG methods, the exploration phase primarily relies on a large language model to score and rank candidate relations and entities at the language level for each hop, thereby guiding graph expansion. However, this approach suffers from frequent calls and uncontrollable inference processes. The proposed improvement utilizes refined intent tags obtained during the initialization phase to directly control the relation selection and path expansion process in the graph, thus replacing the LLM scoring mechanism.
[0061] Specifically, the system first uses the intent label set output by the intent recognition module. Retrieve the corresponding set of graph relation tags:
[0062]
[0063] in Indicates the relationship with the first The set of knowledge graph relationships corresponding to each intent tag is usually defined by rules or preset by graph tag mapping.
[0064] Subsequently, in the initialization of the subgraph In the process, starting from the current entity, traverse all its adjacency relationships, retaining only those relationships that belong to the same type. The candidate paths. This pruning process can be represented as:
[0065]
[0066] in This is the first set of paths generated under intent-driven conditions. A triple path in a knowledge graph, starting from the entity ,relation and target entity composition, As a knowledge graph, it contains all known structured triples, skipping the process of sorting each path using LLM, greatly reducing the computational burden in the reasoning process, and ensuring semantic consistency between paths and intentions.
[0067] If the depth of reasoning The above process can be executed recursively at each hop: the new entity in the current hop serves as the starting point for the next hop, and the same intent relationship filtering rules are applied to gradually build a multi-hop subgraph structure.
[0068]
[0069] in, Indicates the first In the cycle, the graph structure after incorporating the new extended paths, Indicates the first The graph structure during round-robin reasoning, i.e. the set of triplets that have been explored so far.
[0070] Beam search or limiting the maximum number of hops is used to control the search space and avoid path explosion. Finally, the exploration phase outputs a set of structured, multi-hop semantic paths. These paths are all explicitly controlled by user intent tags and serve as input for the next stage of reasoning.
[0071] Step 3: Reasoning Stage
[0072] During the exploration phase, generate a set of intent-related multi-hop paths. Afterward, the system enters the inference phase. The core objective of this phase is to determine whether the current path contains sufficient semantic information to answer the user's question, and if the conditions are met, to generate a natural language response using a large language model.
[0073] (1) Path sufficiency judgment
[0074] The system needs to determine the current set of paths. Does it contain sufficient semantic information to support an answer to the question? To this end, construct input pairs. ,in For the user's original question, This is a set of paths. The input pair is encoded into a format that the model can process and then fed into the path determination module.
[0075] The formal representation of this judgment process is as follows:
[0076]
[0077] in This is the path sufficiency assessment function, implemented as a binary classifier, typically built from a large language model through prompting engineering. The output is a Boolean value. A 1 indicates sufficient path information to support a question answer; a 0 indicates incomplete path information, in which case path expansion can continue based on a preset maximum number of hops.
[0078] (2) Answer generation
[0079] If the path determination is sufficient, the process proceeds to the answer generation stage. In this stage, the user's question and the set of paths are jointly input into the answer generation function to generate the final natural language response. This process is modeled as a conditional language generation task:
[0080]
[0081] in The generator function accepts two input modalities: a user's language question and structured path information. (Path set) The text is linearly formatted into a sequence of triples or an embedded form, which is then used as contextual input along with the question text.
[0082] This generative model combines the problem context and knowledge path content through conditional modeling to achieve natural language generation based on graph structure support. The generated results are semantically consistent with the path and linguistically similar to human expression.
[0083] In addition, additional functions such as path visualization markers and graph traceability indexes can be introduced as needed to enhance the interpretability and knowledge traceability of the output content.
[0084] The intent-layered recognition module designed in this invention is based on a finely tuned Qwen2-1.5B model. It is primarily used to parse the structured semantic intent in user input questions, providing explicit control signals for graph path selection and answer generation. This module completes a coarse-to-fine semantic parsing process through a two-level recognition structure, including a first-level intent classification and a second-level refined intent recognition stage.
[0085] In the implementation process, the system first receives the user's natural language question text and inputs it into the intent recognition module. The first-level classification stage uses a closed-loop selection method to identify the macro-level semantic intent of the question from preset main category labels, such as "query," "recommendation," or "medical consultation." The output of this stage serves as a condition for entering the next stage. Subsequently, based on the first-level classification results, the system activates the refined intent recognition path under the corresponding category. The model then performs multi-label recognition within that sub-category set, outputting multiple second-level intent labels related to the question's semantics, such as "query disease symptoms" or "recommend food."
[0086] The recognition module is designed based on prompt-based input and automatically completes the intent structure output through language modeling capabilities. The system performs structured parsing of the model output, uniformly generating a standard intent label data structure, including a primary category and its corresponding secondary sub-label set. This result is not only used to label the question intent type, but more importantly, it participates in the path constraint logic of the graph reasoning module. The system transforms secondary intent labels into a graph relationship set through mapping rules between intent labels and graph relationships, which is used to limit the scope and direction of path search, expanding only on relevant relationships to avoid path redundancy and semantic deviation.
[0087] This hierarchical intent recognition scheme features clear input / output interfaces, well-defined internal logic, and an easily expandable structure. By decomposing complex intent semantics through a hierarchical structure, it not only improves recognition accuracy but also provides a controllable and interpretable semantic foundation for graph question-answering systems, making it a crucial component of the semantically guided knowledge retrieval mechanism in this invention.
[0088] Model fine-tuning:
[0089] The intent recognition module used in this invention is built based on the Qwen2-1.5B open-source language model. Combined with the task requirements of multi-intent classification in the psychological health question-and-answer scenario, it forms an intent hierarchical recognition capability optimized for vertical domains through instruction-based data generation and efficient parameter fine-tuning methods.
[0090] To obtain high-quality semantically labeled data, this invention employs GPT-4o as the data generation engine to construct the question corpus required for the intent recognition task. First, GPT-4o automatically generates 3000 diverse questions with practical task characteristics according to a predefined intent category system for mental health scenarios. The content covers semantic main lines such as querying, recommendation, and medical consultation, and is refined to more than ten secondary intent subcategories. After question generation, the Baidu ERNIE-4.0 model is used to classify the intent of all questions, and the classification results are used as preliminary labels to constitute the basic labeled data.
[0091] To ensure the quality of the training data annotation, this invention performs quality stratification on the classification results of ERNIE-4.0 and constructs three data subsets accordingly:
[0092] 1. Using the correctly classified questions from ERNIE-4.0 as the basic data, divide them into an 80% training set and a 20% validation set. The training set is used to fine-tune the model parameters, and the validation set is used to test the recognition accuracy.
[0093] 2. Retain the misclassification results of the ERNIE-4.0 model on some problems and construct a difficult test set to evaluate the model's generalization ability on complex boundary samples.
[0094] During model fine-tuning, this invention employs the LoRA (Low-Rank Adaptation) method for efficient parameter fine-tuning. Low-rank weight update structures are inserted only into the model's key attention weight modules, significantly reducing training overhead while preserving the original model's capabilities. The fine-tuning process maintains the core model parameters frozen, optimizing only the inserted low-rank weight modules to achieve efficient fine-tuning and ensure deployment stability and parameter controllability. The entire fine-tuning process is based on a unified intent hierarchy template, enhancing the model's adaptability, generalization, and robustness to semantics in the mental health domain through fine-tuning.
[0095] In summary, through the above optimization methods, this invention constructs a highly accurate intent recognition module with semantic layering capabilities and embeddable deployment, providing stable and efficient upstream semantic parsing capabilities for the mental health graph question answering system.
[0096] Example 2
[0097] This embodiment provides an alternative to the method described in Embodiment 1 for the path selection process. In the existing solution, the results of BERT entity recognition and large model intent recognition are converted into Cypher statements, and dynamic decision-making is used to optimize the query statements. The alternative solution can employ a graph-based multi-step reasoning approach for query optimization.
[0098] Implementation method:
[0099] Graph reasoning: When performing queries, a multi-step reasoning algorithm can be introduced, where after each query step, subsequent reasoning continues based on the intermediate results of the graph. In this process, the model progressively reasons and updates the query conditions, rather than generating a complete Cypher query statement all at once.
[0100] Selection mechanism: Each step of the reasoning can select the best path by comparing different paths (such as graph-based subgraph queries or local optimization queries).
[0101] Dynamic optimization: By selectively querying the graph and inference paths, the results of each step are optimized, thereby continuously adjusting and optimizing the final query path.
[0102] It is understood that the alternative proposed in this embodiment can adjust the query path more flexibly, obtain more accurate answers through multiple inferences, and adapt to more complex query scenarios.
[0103] Example 3
[0104] This embodiment provides an alternative to the method described in Embodiment 1 for the path selection process. In existing solutions, Cypher statements are generated using NL2Cypher and dynamic decision-making is performed to select the optimal path. In this embodiment, reinforcement learning is used to optimize graph querying and inference.
[0105] Implementation method:
[0106] Reinforcement learning model: A model is trained to select the optimal query path using Q-learning or Deep Q Network (DQN) methods in reinforcement learning.
[0107] State space and action space: The state space represents the retrieval results of the current graph, while the action space represents the available query paths. By continuously optimizing the model's behavior, reinforcement learning can learn to select the most effective query path.
[0108] Reward mechanism: When selecting the optimal query path, the model rewards the user based on the accuracy and relevance of the search results. As training progresses, the model will automatically select the query path most likely to produce the optimal results.
[0109] Understandably, reinforcement learning can adapt to different query scenarios and guide the model to continuously optimize the query process through a reward mechanism, thus avoiding the limitations of traditional static optimization methods.
[0110] Example 4
[0111] This embodiment provides an alternative to the method described in Embodiment 1 in the path filtering process. Traditional graph query methods mainly rely on Cypher statements. In this embodiment, a graph neural network (GNN) is introduced to optimize graph query and inference.
[0112] Implementation method:
[0113] Graph Neural Network Applications: Graph neural networks (GNNs) are used to model graphs, processing the graph structure and automatically extracting effective query paths. In this process, GNNs can not only analyze the relationships between nodes and edges but also identify potential query structures.
[0114] Query path optimization: Through the transmission mechanism of GNN, the network can propagate information between graph nodes and automatically identify the most relevant query path, thereby providing accurate query results for large models.
[0115] Integration with large models: After GNN optimizes the query path, the results can be directly input into large models to generate answers, further improving retrieval efficiency and answer accuracy.
[0116] Understandably, graph neural networks can handle complex graph structures and relationships between nodes, improving the efficiency and accuracy of graph queries, and are especially suitable for large-scale graphs and high-dimensional data.
[0117] Example 5
[0118] This embodiment proposes an alternative to the method described in Embodiment 1 for the answer generation process. It achieves multimodal reasoning by fusing graph data with external knowledge bases (such as text, images, and other data modalities). This approach can extend existing single graph retrieval models and enable large models to perform reasoning and answer generation across domains.
[0119] Implementation method:
[0120] Integrating graphs with external knowledge bases: During graph queries, external data sources (such as open datasets, text data from news articles, and even image data) are combined to expand the query results.
[0121] Multimodal reasoning model: Construct a large multimodal model that combines structured data from the graph with external unstructured data (such as text, images, etc.) to generate answers with more contextual information and reasoning depth.
[0122] Joint reasoning and result integration: Joint reasoning is performed using graph information and query results from external knowledge bases to generate richer and more accurate answers.
[0123] Understandably, multimodal fusion can provide a wider range of knowledge sources for large models, making the generation of answers more comprehensive, and is especially suitable for handling complex multi-domain problems.
[0124] This embodiment provides an alternative to the method described in Embodiment 1 for the path selection process, employing a Graph Autoencoder (GAE) to reconstruct and infer knowledge from the graph. The Graph Autoencoder can learn potential low-dimensional representations from graph data and optimize graph queries based on these representations.
[0125] Implementation method:
[0126] Graph autoencoder structure: The autoencoder is used to encode and decode the graph, compressing the graph data into a low-dimensional representation and mining potential relational information.
[0127] Query path learning: By learning low-dimensional graph representations, the model can automatically generate the optimal query path from the latent space and retrieve the most relevant information from the graph.
[0128] Reasoning process: The generated query results can be used to reason through a large model, and the final answer can be generated by combining the thought process.
[0129] Understandably, using a graph autoencoder can better handle the learning and querying of large-scale graphs, while providing a more concise graph representation, which helps to accelerate the query process and improve inference efficiency.
[0130] As can be seen from the above technical solutions, the innovation of this invention lies in:
[0131] 1. Introducing a hierarchical intent recognition module to control graph path selection. This invention introduces a hierarchical intent recognition mechanism into the ToG inference framework. Through first-level intent classification and second-level multi-label recognition, it performs structured semantic parsing of user questions to directly control the expansion direction of the graph path, replacing the original path scoring mechanism.
[0132] 2. Establish mapping rules between intent tags and graph relationships. Based on the identified fine-grained intent tags, the system limits the types of relationships that can be explored in the graph, enabling semantic-driven path filtering, reducing irrelevant paths, and improving the accuracy and efficiency of reasoning.
[0133] 3. A fine-tuned Qwen2-1.5B model is used as a lightweight intent recognition engine. This invention utilizes GPT-4o to generate questions and ERNIE-4.0 for classification-assisted annotation to construct a dataset, and fine-tunes the model using the LoRA method to achieve high-precision intent recognition capabilities with low resource costs.
[0134] 4. The exploration logic of ToG is reconstructed into an "intent-driven path reasoning" process. This invention directly generates a set of structured paths based on intent, which are uniformly input into the reasoning and generation stages, forming an overall structured and controllable knowledge question-and-answer process guided by intent.
[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for retrieving a psychomedical atlas based on an enhanced large model, characterized in that, include: To address user input issues, a large language model is used to extract topic entities; Based on the aforementioned topic entities, a lightweight large model is used to obtain user intent tags; Based on the user intent tags, control the relationship filtering and path expansion process of the knowledge graph to construct a semantic path set; Determine whether the semantic path set contains sufficient semantic information to support answering the question. If the determination result is "yes", output the answer based on the answer generation function, according to the user input question and the semantic path set. The process of obtaining user intent tags using a lightweight, large model is as follows: , in, Main intent label, This is the weight matrix of the first-level intent classifier. For Transformer encoders The output vector representing the position indicates the semantic representation of the entire sentence. This is the bias term for the first-level intent classifier. This means taking the category with the highest probability as the predicted label; Next, based on the primary intent, further fine-grained multi-label recognition is performed to obtain more specific intent sub-labels, represented as: , in, For all secondary intent labels, the predicted probability is given; for multi-label applications, ... The Sigmoid activation function is used for multi-label classification, where activation is determined independently for each label. This is the weight matrix for a two-level intent classifier, which can output multiple labels. This is the output vector at position [CLS] in the Transformer encoder, representing the semantic representation of the entire sentence. This is the bias term for the secondary intent classifier; , in, To refine the intent tag set, For tag indexing, For the first The predicted probability of each secondary label. The set tag activation threshold; The process of relation filtering and path expansion based on the user intent tags to control the knowledge graph includes: Retrieve the corresponding graph relationship tag set based on the user intent tag; In the initialization subgraph, starting from the current entity, all adjacency relationships are traversed, and only candidate paths whose relationship type belongs to the graph relationship label set are retained. This process is represented as follows: , in This is the first set of paths generated under intent-driven conditions. A triple path in a knowledge graph, starting from the entity ,relation and target entity composition, It is a knowledge graph containing all known structured triples; Construct the semantic path set based on the candidate paths; The process of relation filtering and path expansion based on the user intent tag-controlled knowledge graph also includes traversing the adjacency relationships in each hop, and using the new entity in the current hop as the starting point for the next hop to perform cyclic relation filtering and path expansion. The semantic path set is constructed based on the cyclic results. The method for filtering the candidate paths is as follows: , in, Indicates the first In the cycle, the graph structure after incorporating the new extended paths, Indicates the first The graph structure during round reasoning, i.e. the set of triplets that have been explored so far; The method for determining whether the set of semantic paths contains sufficient semantic information to support answering the question is as follows: , in, Indicates an input pair, where For the user's original question, For a set of paths, This is a path sufficiency assessment function. When the output is 1, it means that the path information is sufficient to support the answer to the question; when the output is 0, it means that the path information is not yet complete.
2. The method according to claim 1, characterized in that, If the judgment result is "no", the path expansion continues according to the preset maximum number of hops.
3. The method according to claim 1, characterized in that, The output function for the answer is shown below: , in, For generating functions, Indicates an input pair, where For the user's original question, It is a set of paths.
4. The method according to claim 1, characterized in that, During the training process of the lightweight large model, the Baidu ERNIE-4.0 model is used to classify the input questions. The correctly classified questions are used as the basic data for the training set and validation set, while the incorrectly classified questions are used as the test set.
5. The method according to claim 1, characterized in that, In the process of acquiring user intent tags using a lightweight large model, based on the classification task requirements of the mental health question-and-answer scenario, the parameters of the lightweight large model are fine-tuned using imperative data generation and the LoRA method. Specifically, this includes inserting a low-rank weight update structure into the key attention weight module of the lightweight large model, keeping the main structure of the model unchanged during the fine-tuning process, and only updating the parameters of the low-rank weight update structure.
Citation Information
Patent Citations
Question and answer method for graph-driven fusion retrieval in field of computer networks
CN120336477A