Psychological medical map retrieval method based on enhanced large model

By combining large language models with lightweight large models, the expansion of knowledge graph paths is controlled, which solves the problems of insufficient information coverage and limited intent recognition capabilities in knowledge graph retrieval in existing technologies. It achieves high adaptability in the field of mental health and logical clarity of answers, and improves the accuracy and interpretability of intelligent question-answering systems.

CN120611069AActive Publication Date: 2025-09-09TIANDA ZHITU (TIANJIN) TECHNOLOGY CO LTD +1

Patent Information

Application Number
CN202511113073.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-11
Publication Date
2025-09-09
Estimated Expiration
2045-08-11

AI Technical Summary

Technical Problem

Existing knowledge graph retrieval methods have problems in complex query scenarios, such as insufficient information coverage, limited intent recognition capabilities, lack of optimization capabilities in retrieval paths, and insufficient integration of generation models and knowledge graphs. This leads to inaccurate answers and unclear logic in the field of mental health by intelligent question-answering systems.

Method used

A large language model is used to extract topic entities, combined with a lightweight large model to obtain user intent labels, control the relationship screening and path expansion of the knowledge graph, improve retrieval capabilities through dynamic path optimization and thought chain reasoning, and generate logically clear and professional answers.

Benefits of technology

It has achieved high adaptability and technical advantages in the field of mental health, accurately identified multiple intentions, expanded search dimensions, generated more comprehensive and scientific answers, and enhanced system interpretability and user trust.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120611069A_ABST
    Figure CN120611069A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of natural language processing, and provides a psychological medical map retrieval method based on an enhanced large model, which comprises the following steps of: aiming at a user input problem, extracting a subject entity by adopting a large language model; obtaining a user intention label by adopting a light-weight large model; based on a user intention label, controlling a relationship screening and path expansion process of the knowledge graph, and constructing a semantic path set; and judging whether the semantic path set has enough semantic support to answer the user question, and if so, outputting an answer according to the question input by the user and the semantic path set. On the basis of an existing reasoning framework, a fine-tuning lightweight large language model is introduced to perform multi-level semantic intention recognition on user questions, and a relation path selection process in a knowledge graph is controlled accordingly, so that a mechanism of scoring and sequencing paths hop by hop depending on the large language model in an original framework is replaced; therefore, the user can obtain scientific and complete psychological health knowledge, and the reliability of psychological health service is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing technology, and in particular to a psychological medical graph retrieval method based on an enhanced large model. Background Art

[0002] In recent years, with the rapid development of artificial intelligence (AI), Retrieval-Augmented Generation (RAG) has become a key research direction in natural language processing (NLP). This technology combines the strengths of knowledge retrieval and generative models, enabling large language models (LLMs) to leverage external knowledge bases for information supplementation, improving the accuracy and interpretability of responses. RAG is widely used in fields such as intelligent question answering, healthcare consulting, and financial analysis to enhance models' ability to answer factual questions. However, there are many problems in the practical application of graph RAG enhanced large models: for example, when generating answers related to mental health, traditional large models mainly rely on large-scale pre-training corpus, which is easily affected by data bias, resulting in inaccurate or unscientific answers; existing large models rely on a single task classification or keyword matching in intent recognition, which makes it difficult to accurately identify complex user needs, especially when multiple intentions or implicit intentions are involved, which is prone to misjudgment or omissions; most RAG (Retrieval-Augmented Generation) based methods only perform a single path or static knowledge retrieval, resulting in insufficient coverage of user questions and difficulty in fully obtaining relevant information; in addition, the current system lacks sufficient contextual understanding and logical reasoning capabilities in the answer generation process, resulting in redundant, unclear logic or lack of professionalism in the generated answers.

[0003] In intelligent diagnosis and question-answering systems, knowledge graphs (KGs) 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 query based on the connections between entities and provide more accurate answers. However, existing knowledge graph retrieval methods face numerous challenges in complex query scenarios, such as the information limitations of a single search path, inadequate handling of multi-intent questions, limited collaborative optimization capabilities between knowledge graphs and generative models, and a lack of dynamic path adjustment capabilities.

[0004] In addition, retrieval-augmented generation (RAG) and knowledge graph (KG) have been widely used in fields such as intelligent question answering, healthcare, and information retrieval. However, they still have the following major technical shortcomings:

[0005] Single retrieval method and insufficient information coverage: Existing knowledge graph retrieval typically uses a single-path or fixed-rule query model, making it difficult to simultaneously obtain information from multiple related paths. This can lead to incomplete search results or missing information. In complex query scenarios, a single retrieval method cannot 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 problems involving multiple intents and multi-level inquiries, the recognition accuracy is low and it is unable to effectively break down users' complex queries, resulting in search results that cannot accurately match user needs.

[0007] Lack of optimization capabilities in retrieval paths: Existing knowledge graph retrieval paths are usually predefined or based on fixed rules. It is difficult to dynamically adjust retrieval strategies based on factors such as query content, historical query records, and user feedback. As a result, they are unable to flexibly adapt to different query requirements in different application scenarios, affecting retrieval efficiency and result accuracy.

[0008] Insufficient integration between generative models and knowledge graphs: Existing RAG systems mainly rely on document-level retrieval. When processing structured knowledge, generative models cannot fully utilize the entity relationships of knowledge graphs for logical reasoning, and are prone to hallucination problems. That is, the generated content may not be consistent with 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 perform complex path reasoning based on knowledge graphs, and thus unable to deeply explore the implicit connections between knowledge. As a result, they lack advanced reasoning capabilities in professional fields such as medicine and law, resulting in illogical or even erroneous answers.

[0010] In summary, how to optimize the retrieval method of knowledge graphs under the RAG framework so that it can more effectively support intelligent diagnosis, decision support and question-answering systems has become one of the core issues of current research. Summary of the Invention

[0011] In view of this, the present invention proposes a psychological medical graph retrieval method based on an enhanced large model. Through dynamic path optimization, chain of thought reasoning (CoT) and large model combined with knowledge reasoning, the retrieval capability and answer quality of the intelligent question-answering system are improved, effectively solving the problems existing in the above-mentioned existing technologies.

[0012] To achieve the above objectives, the present invention proposes a psychological medical graph retrieval method based on an enhanced large model, which is characterized by comprising:

[0013] For user input questions, a large language model is used to extract topic entities;

[0014] According to the subject entity, a lightweight large model is used to obtain the user intention label;

[0015] Control the relationship screening and path expansion process of the knowledge graph based on the user intention label to construct a semantic path set;

[0016] Determine whether the semantic path set contains semantic information sufficient to support answering the question. When the judgment result is "yes", output the answer based on the user input question and the semantic path set based on the answer generation function.

[0017] Furthermore, the relationship screening and path expansion process of the knowledge graph controlled by the user intention tag includes:

[0018] Retrieve a corresponding graph relationship tag set according to the user intention tag;

[0019] In the initialization subgraph, starting from the current entity, all adjacency relationships are traversed, and only candidate paths whose relationship types belong to the graph relationship label set are retained;

[0020] The semantic path set is constructed based on the candidate paths.

[0021] Furthermore, the relationship screening and path extension process of controlling the knowledge graph based on the user intention label also includes traversing the adjacency relationship in each hop, and using the new entity in the current hop as the extension starting point of the next hop to perform cyclic relationship screening and path extension, and constructing the semantic path set based on the cyclic result.

[0022] Furthermore, the candidate path screening method is as follows:

[0023]

[0024] in, This is the first round of path set generated under intention-driven. Represents a set of user intent labels, is the triple path in the knowledge graph, consisting of the starting entity ,relation and the target entity composition, is a knowledge graph containing all known structured triples.

[0025] Furthermore, the method for determining whether the semantic path set contains semantic information sufficient to support answering the question is as follows:

[0026]

[0027] in, represents an input pair, where For the user's original question, is a set of paths, It is a path sufficiency judgment 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 extension is continued according to the preset maximum number of hops.

[0029] Furthermore, the output function of the answer is as follows:

[0030]

[0031] in, is the generating function, represents an input pair, where For the user's original question, A collection of paths.

[0032] Furthermore, during the training process of the lightweight large model, Baidu ERNIE-4.0 model is used to classify input questions, and the correctly classified questions are used as basic data to divide the training set and validation set, and the incorrectly classified questions are used as the test set.

[0033] Furthermore, in the process of using a lightweight large model to obtain user intention labels, 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 with the existing retrieval enhancement generation (RAG) technology, the present invention has the following advantages:

[0035] The present invention has higher adaptability and technical advantages in the field of mental health. In terms of entity recognition, the present invention adopts a large language model LLM to make the recognition of entities related to mental health more accurate, and ensures that the search content is aligned with professional medical terms through standardized entity matching, reducing the generalization problem caused by keyword matching in traditional RAG. In terms of intent recognition, existing RAG systems usually only support single intent recognition, resulting in a limited search scope. The present invention uses a large model combined with COT (Chain-of-Thought) reasoning to decompose the intent of complex questions input by users, so that the system can accurately identify multiple intentions, such as querying depression symptoms, the relationship between low mood and depression, coping methods, etc., thereby expanding the search dimension and making the query results more comprehensive.

[0036] In terms of knowledge retrieval, traditional RAG often uses a single path retrieval, which may lead to missing or omitted information. The present invention is based on multi-path parallel reasoning (MPPI), combined with entity recognition and multi-intent analysis, to dynamically search multiple paths in the knowledge graph to form a more complete related subgraph, improve knowledge coverage and information accuracy, and optimize retrieval ranking through path weights to ensure priority acquisition of core information. In terms of answer generation, traditional RAG may only rely on simple splicing of retrieved documents, resulting in logical confusion or lack of professionalism in the generated content. The present invention uses a knowledge graph enhancement method to enable large models to organize and optimize based on structured reasoning relationships when answering questions, ensuring that the generated mental health advice is more scientific, logically clear, and more professional.

[0037] In addition, compared to the traditional RAG system, which has difficulty tracing the source of answers, the present invention uses knowledge graphs to construct visual reasoning paths, allowing users to intuitively understand the basis for recommended content, enhancing system interpretability and user trust. More importantly, existing RAG technology is mostly used for general question-answering, while the present invention is designed specifically for the field of psychological medicine. It combines medical knowledge graphs and mental health data to provide more accurate diagnostic assistance and consulting advice for psychological problems such as depression and anxiety, ensuring that the system has industry applicability and clinical reference, thereby significantly improving the reliability and scientific nature of intelligent mental health diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Various other advantages and benefits will become apparent to those skilled in the art by reading the detailed description of the preferred embodiment below. The accompanying drawings are only for the purpose of illustrating the preferred embodiment and are not to be considered as limiting the present invention. In the accompanying drawings:

[0039] Figure 1 This is a schematic diagram of the architectural principle of the psychological medical graph retrieval method based on the enhanced large model proposed in the present invention. DETAILED DESCRIPTION

[0040] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art. It should be noted that, unless there is a conflict, the embodiments of the present disclosure and the features described in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0041] Example 1

[0042] This embodiment proposes a psychological medical graph retrieval method based on an enhanced large model. The architecture principle is as follows: Figure 1 As shown in the figure, its core technical solution is to accurately locate the user's query intention by introducing a multi-level intent recognition mechanism, thereby directly screening out matching paths in the knowledge graph, replacing the original ToG method's reliance on a large language model (LLM) for entity relationship scoring, to improve the reasoning efficiency and accuracy of the question-answering system.

[0043] The technical solutions of the present invention are described in detail based on the above content, including:

[0044] Step 1: Initialization

[0045] In the present invention, the initialization phase is first entered, aiming to extract structured starting point information for graph reasoning from the user's natural language questions, including entities and intents.

[0046] First, a large language model with strong language understanding capabilities (such as the ChatGPT series) is used to encode the input question, and potential topic entities are extracted through prompt instructions or zero-shot question-answering methods for subsequent positioning and expansion in the knowledge graph. This process can be expressed as:

[0047]

[0048] in For user issues, is the set of identified entities.

[0049] Subsequently, a fine-tuned 1.5B-parameter lightweight model (such as Qwen2) is used to identify the intent of user questions. A hierarchical structure is adopted, including two stages: first-level classification and second-level multi-label classification. First, a softmax is used to output the first-level intention map, such as "query category", "recommendation category", "diagnosis category", etc.

[0050]

[0051] in, For the main intent label, is the weight matrix of the first-level intent classifier, For the Transformer encoder The output vector of the position represents the semantic representation of the entire sentence. is the bias term of the first-level intent classifier, It means taking the category corresponding to the maximum probability as the predicted label.

[0052] Then, based on the first-level intent, we further perform fine-grained multi-label recognition to obtain more specific intent sub-labels, such as "query symptoms" and "recommended food", which are expressed as:

[0053]

[0054] in, is the predicted probability of all secondary intent labels (multi-label), Sigmoid activation function, used for multi-label classification (each label independently determines whether to activate), is the weight matrix of the secondary intent classifier (can output multiple labels), is the output vector of the [CLS] position in the Transformer encoder, which represents the semantic representation of the entire sentence. is the bias term of the secondary intent classifier.

[0055]

[0056] in, To refine the intent label set, is the tag index, For the The predicted probability of the secondary labels, The activation threshold for the set tag.

[0057] This hierarchical structure can accurately identify mixed intentions (such as "query + recommendation") in user questions while ensuring the model is lightweight, providing a clear path control basis for the subsequent exploration stage. At this point, the initialization stage completes the structural analysis of the problem, and the output includes: entity set , Main Image Label , refine the intent label set .

[0058] Step 2: 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 that are highly relevant to the user's intent from the knowledge graph and gradually expand the subgraph to support the final answer reasoning.

[0060] In the original ToG method, the exploration phase primarily relies on a large language model to linguistically score and rank candidate relationships and entities at each hop, thereby guiding graph expansion. However, this approach suffers from frequent invocations and uncontrollable inference processes. The improved solution proposed in this paper utilizes the refined intent labels obtained during the initialization phase to directly control the relationship screening and path expansion process in the graph, thereby replacing the LLM scoring mechanism.

[0061] Specifically, the system first identifies the intent label set output by the intent recognition module. , retrieve the corresponding graph relationship label set:

[0062]

[0063] in Indicates The set of knowledge graph relationships corresponding to the intent labels is usually defined by rules or preset by graph label mapping.

[0064] Then, when initializing the subgraph In the example, starting from the current entity, traverse all its adjacency relationships and only retain the relationships of type The candidate path of . The pruning process can be expressed as:

[0065]

[0066] in This is the first round of path set generated under intention-driven. is a triple path in the knowledge graph, consisting of the starting entity ,relation and the target entity composition, For the knowledge graph, which contains all known structured triples, we skip the process of using LLM sorting for each path, which greatly reduces the computational burden in the reasoning process and ensures the semantic consistency of the path and the intent.

[0067] If the inference depth ,The above process can be recursively executed at each hop: the new entity in the current hop serves as the expansion starting point of the next hop, and the same intent relationship filtering rules are continued to gradually construct a multi-hop subgraph structure:

[0068]

[0069] in, Indicates in In the round, the graph structure after integrating the new extended path, Indicates the The graph structure during round inference, that is, the set of triples currently explored.

[0070] Use beam search or limit the maximum number of hops to control the search space and avoid the path explosion problem. Finally, the exploration phase outputs a set of structured, multi-hop semantic paths. ,These paths are all explicitly controlled by the user ,intention labels and serve as the input basis for the next stage ,of reasoning.

[0071] Step 3: Reasoning

[0072] Generate a set of multi-hop paths related to the intent during the exploration phase After that, the system enters the reasoning phase. The core goal of this phase is to determine whether the current path contains enough semantic information to answer the user's question and, if the conditions are met, use the large language model to generate a natural language answer.

[0073] (1) Path adequacy judgment

[0074] The system needs to determine the current path set Does it contain enough semantic information to support answering the question? ,in For the user's original question, is a set of paths. The input pair is encoded into a format that can be processed by the model and input into the path judgment module.

[0075] The judgment process is formalized as follows:

[0076]

[0077] in This is a path sufficiency function implemented as a binary classifier, typically implemented by a large language model through prompt engineering. Its output is a Boolean value. A 1 indicates that the path information is sufficient to answer the question; a 0 indicates that the path information is incomplete, and path expansion can be continued based on the preset maximum number of hops.

[0078] (2) Answer generation

[0079] If the path is judged to be sufficient, the answer generation phase begins. In this phase, the user question and the path set are combined and fed into the answer generation function to generate the final natural language response content. This process is modeled as a conditional language generation task:

[0080]

[0081] in To generate a function, it accepts two input modalities: user language questions and structured path information. Path collection It is linearly formatted into a sequence of triples or an embedded form to serve as contextual input together with the question text.

[0082] This generative model jointly considers 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 similar to human expression in language style.

[0083] In addition, additional functions such as path visualization marking and map traceability index can be introduced as needed to enhance the interpretability of the output content and the traceability of knowledge.

[0084] The hierarchical intent recognition module designed in this paper, based on a fine-tuned Qwen2-1.5B model, is primarily used to parse structured semantic intent in user input questions, providing clear control signals for graph path selection and answer generation. This module completes the coarse-to-fine semantic parsing process through a two-level recognition structure, consisting of first-level intent classification and second-level refined intent recognition.

[0085] During 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 identifies the macro-semantic intent of the question from the preset main category labels in a closed selection manner, such as "query category", "recommendation category" or "medical treatment category". The output results of this stage serve as the conditional control 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 performs multi-label recognition in the sub-category set and outputs multiple second-level intent labels related to the question semantics, such as "query disease symptoms" and "recommend food".

[0086] The recognition module is designed based on prompt-based input and automatically outputs the intent structure through language modeling capabilities. The system performs structured parsing on the model output, generating a standardized intent label data structure consisting of a primary category and a corresponding set of secondary sub-labels. This result is not only used to label the question intent type but, more importantly, participates in the path constraint logic of the graph reasoning module. Using mapping rules between intent labels and graph relationships, the system converts secondary intent labels into a set of graph relationships, which is used to limit the scope and direction of path searches, expanding only on relevant relationships to avoid path redundancy and semantic deviation.

[0087] This hierarchical intent recognition solution features clear input and output interfaces, clear module logic, and an easily extensible structure. By breaking down complex intent semantics through a hierarchical structure, it not only improves recognition accuracy but also provides a controllable and interpretable semantic foundation for the graph-based question-answering system, making it a crucial component of the semantically guided knowledge retrieval mechanism in this invention.

[0088] Fine-tuning of the model:

[0089] The intent recognition module adopted in this invention is constructed based on the Qwen2-1.5B open source language model. Combined with the task requirements of multi-intent classification in the mental health question-and-answer scenario, it forms an intent hierarchical recognition capability optimized for vertical fields through imperative data generation and efficient parameter fine-tuning methods.

[0090] To obtain high-quality semantically annotated data, this paper uses GPT-4o as a data generation engine to construct the question corpus required for the intent recognition task. First, GPT-4o automatically generates 3,000 diverse questions with practical task characteristics based on a predefined mental health scenario intent classification system. The content covers semantic main lines such as query, recommendation, and medical treatment, and is refined into more than ten secondary intent subcategories. After question generation, Baidu's ERNIE-4.0 model is used to classify the intent of all questions, and the classification results are used as preliminary labels to form the basic annotated data.

[0091] To ensure the quality of training data annotation, this paper stratifies the quality of ERNIE-4.0 classification results and constructs three types of data subsets based on the quality:

[0092] 1. The questions correctly classified by ERNIE-4.0 are used as the basic data and divided 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. The misclassification results of the ERNIE-4.0 model on some problems are retained to construct a difficult test set to evaluate the generalization ability of the model on complex boundary samples.

[0094] During model fine-tuning, this paper employs the LoRA (Low-Rank Adaptation) method for efficient parameter fine-tuning. This method inserts a low-rank weight update structure only in the model's key attention weight modules, significantly reducing training overhead while preserving the original model's capabilities. While keeping the main model parameters frozen, the fine-tuning process optimizes and trains only the inserted low-rank weight modules, achieving efficient fine-tuning and ensuring deployment stability and parameter controllability. The entire fine-tuning process is based on a unified intent hierarchy template, improving the model's adaptability, generalization, and robustness to the semantics of mental health.

[0095] In summary, through the above optimization method, the present invention constructs an intention recognition module with high accuracy, semantic layering capability, and embeddable deployment, providing a stable and efficient upstream semantic parsing capability for the mental health graph question-answering system.

[0096] Example 2

[0097] This example provides an alternative to the path screening method described in Example 1. The existing solution converts the results of BERT entity recognition and large-scale intent recognition into Cypher statements, and combines this with dynamic decision-making to optimize the query. An alternative approach uses 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. This means that after each query step, subsequent reasoning is performed based on the intermediate results of the graph. During this process, the model gradually infers and updates the query conditions, rather than generating a complete Cypher query statement all at once.

[0100] Selection mechanism: Each step of reasoning can select the best path by comparing different paths (such as graph-based subgraph query or local optimization query).

[0101] Dynamic Optimization: Optimize the results of each step through selective graph query and reasoning paths, thereby continuously adjusting and optimizing the final query path.

[0102] It is understandable that the alternative solution proposed in this embodiment can adjust the query path more flexibly, obtain more accurate answers through multiple reasonings, and can adapt to more complex query situations.

[0103] Example 3

[0104] This embodiment provides an alternative to the path selection method described in Example 1. In the existing solution, NL2Cypher generates Cypher statements and makes dynamic decisions to select the optimal path. In this embodiment, reinforcement learning is used to optimize graph query and reasoning.

[0105] Implementation method:

[0106] Reinforcement learning model: Using the Q-learning or Deep Q Network (DQN) method in reinforcement learning, a model is trained to select the optimal query path.

[0107] State space and action space: The state space represents the search 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 choose the most effective query path.

[0108] Reward mechanism: The model rewards the model for selecting the optimal query path based on the accuracy and relevance of the search results. As training progresses, the model automatically selects the query path most likely to produce the optimal results.

[0109] It is understandable that reinforcement learning can adapt to different query scenarios and guide the model to continuously optimize the query process through a reward mechanism, avoiding the limitations of traditional static optimization methods.

[0110] Example 4

[0111] This embodiment provides an alternative solution to the method described in Example 1 in the path screening process. Traditional graph query methods mainly rely on Cypher statements. This embodiment introduces a graph neural network (GNN) to perform graph query optimization and reasoning.

[0112] Implementation method:

[0113] Graph Neural Network Application: Graph neural networks are used to model graphs, and GNNs are used to process the graph structure and automatically extract effective query paths. In this process, graph neural networks can not only analyze the relationship between nodes and edges, but also identify potential query structures.

[0114] Query path optimization: Through the GNN transmission mechanism, 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 the large model to generate answers, further improving retrieval efficiency and answer accuracy.

[0116] It is understandable that graph neural networks can handle complex graph structures and relationships between nodes, improve the efficiency and accuracy of graph queries, and are particularly suitable for large-scale graphs and high-dimensional data.

[0117] Example 5

[0118] This example proposes an alternative to the answer generation method described in Example 1. This approach integrates graph data with external knowledge bases (such as text, images, and other data modalities) to perform multimodal reasoning. This approach can extend existing single-graph retrieval models and enable large models to perform reasoning and answer generation across multiple domains.

[0119] Implementation method:

[0120] Graph fusion with external knowledge bases: During the graph query process, external data sources (for example, open datasets, text data such as news articles, and even image data) are combined to expand the query results.

[0121] Multimodal reasoning model: Build a large multimodal model that combines structured data in the graph with external unstructured data (such as text, images, etc.) for reasoning, generating answers with more context and reasoning depth.

[0122] Joint reasoning and result integration: Use graph information and query results from external knowledge bases for joint reasoning, ultimately generating richer and more accurate answers.

[0123] It is understandable that multimodal fusion can provide a broader source of knowledge for large models, making answer generation more comprehensive, which is especially suitable for dealing with complex multi-domain problems.

[0124] This example provides an alternative to the path screening method described in Example 1, using a graph autoencoder (GAE) to reconstruct and reason about knowledge in the graph. The GAE can learn underlying low-dimensional representations from graph data and optimize graph queries based on these representations.

[0125] Implementation method:

[0126] Graph autoencoder structure: Use autoencoders to encode and decode graphs, compress graph data into low-dimensional representations, and mine potential relationship information.

[0127] Query path learning: By learning a low-dimensional graph representation, the model is able to automatically generate optimal query paths from the latent space and retrieve the most relevant information in the graph.

[0128] Reasoning process: The generated query results can be reasoned through the large model and combined with the thinking chain to generate the final answer.

[0129] It is understandable that the use of graph autoencoders can better handle the learning and query of large-scale graphs, while providing a more concise graph representation, which helps to accelerate the query process and reasoning efficiency.

[0130] According to the above technical solutions, the innovation of the present invention lies in:

[0131] 1. Introducing a hierarchical intent recognition module to control graph path selection. This paper introduces a hierarchical intent recognition mechanism into the ToG reasoning framework. Through first-level intent classification and second-level multi-label recognition, it performs structured semantic parsing of user questions, which is used to directly control the expansion direction of the graph path, replacing the original path scoring mechanism.

[0132] 2. Establish mapping rules between intent labels and graph relationships. Based on the identified fine-grained intent labels, the system limits the types of relationships that can be explored in the graph, enabling semantically driven path screening, reducing irrelevant paths, and improving reasoning accuracy and efficiency.

[0133] 3. Using the fine-tuned Qwen2-1.5B model as a lightweight intent recognition engine. This paper uses GPT-4o to generate questions, ERNIE-4.0 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. Reconstructing the ToG exploration logic into an "intention-driven path reasoning" process. This invention directly generates a set of structured paths based on intent, and uniformly inputs them into the reasoning, judgment, and generation stages, forming an overall structured and controllable knowledge question-answering 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, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.

Claims

1. A psychological medical graph retrieval method based on an enhanced large model, characterized in that: include: For user input questions, a large language model is used to extract topic entities; According to the subject entity, a lightweight large model is used to obtain the user intention label; Control the relationship screening and path expansion process of the knowledge graph based on the user intention label to construct a semantic path set; Determine whether the semantic path set contains semantic information sufficient to support answering the question. When the judgment result is "yes", output the answer based on the user input question and the semantic path set based on the answer generation function.

2. The method according to claim 1, characterized in that The relationship screening and path expansion process of controlling the knowledge graph based on the user intention label includes: Retrieve a corresponding graph relationship tag set according to the user intention tag; In the initialization subgraph, starting from the current entity, all adjacency relationships are traversed, and only candidate paths whose relationship types belong to the graph relationship label set are retained; The semantic path set is constructed based on the candidate paths.

3. The method according to claim 2, characterized in that The relationship screening and path extension process of controlling the knowledge graph based on the user intention label also includes traversing the adjacency relationship in each hop, and using the new entity in the current hop as the extension starting point of the next hop to perform cyclic relationship screening and path extension, and constructing the semantic path set based on the cyclic results.

4. The method according to claim 2, characterized in that The candidate path screening method is as follows: , in, This is the first round of path set generated under intention-driven. Represents a set of user intent labels, is the triple path in the knowledge graph, consisting of the starting entity ,relation and the target entity composition, is a knowledge graph containing all known structured triples.

5. The method according to claim 1, wherein The method for determining whether the semantic path set contains semantic information sufficient to support answering the question is as follows: , in, represents an input pair, where For the user's original question, is a set of paths, It is a path sufficiency judgment 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.

6. The method according to claim 1, characterized in that When the judgment result is "no", the path extension is continued according to the preset maximum number of hops.

7. The method according to claim 1, characterized in that The output function of the answer is as follows: , in, is the generating function, represents an input pair, where For the user's original question, A collection of paths.

8. The method according to claim 1, characterized in that During the training process of the lightweight large model, Baidu ERNIE-4.0 model is used to classify input questions, and the correctly classified questions are used as basic data to divide the training set and validation set, and the incorrectly classified questions are used as the test set.

9. The method according to claim 1, characterized in that In the process of using a lightweight large model to obtain user intention labels, 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, specifically 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.

Citation Information

Patent Citations

  • Application method of Zero-shot Learning in intelligent customer service system

    CN109033378A

  • Intelligent interactive question and answer method, system and device based on Markov logic network

    CN109902165A

  • Disease retrieval method and device based on knowledge graph enhanced large language model

    CN119691118A

  • Knowledge graph retrieval reasoning method and system based on big language model enhancement

    CN120123487A

  • Question and answer method for graph-driven fusion retrieval in field of computer networks

    CN120336477A

Cited By

  • Relationship-driven self-adaptive knowledge graph question answering and path guiding method and system

    CN121094145A

  • Multi-modal retrieval method and system based on knowledge graph

    CN121387936A

  • A multimodal retrieval method and system based on knowledge graphs

    CN121387936B

  • Large language model screening and intervention method for autism field

    CN121393827A

  • Intelligent question and answer method and system based on traditional Chinese medicine classics meta-term engine

    CN121434337A