Medical question answering method, device and equipment and storage medium

CN121614593BActive Publication Date: 2026-08-11BEIJING HONGTENG INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-30
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0004]本申请的主要目的在于提供一种医疗问答方法、装置、设备及存储介质,旨在解决医疗问答等场景下的模型幻觉问题

Benefits of technology

为了缓解模型推理思考过程中的幻觉,引入高质量医疗知识图谱,模型可以基于用户输入的医疗查询信息和作为正确参考的医疗知识图谱,共同确定医疗查询信息对应的目标推理路径,并基于该目标推理路径推理出医疗查询信息对应的目标回答信息,模型在进行医疗问答的过程中通过医疗知识图谱辅助作答,有效缓解了大语言模型普遍存在模型幻觉问题,进而提高了医疗问答场景下模型输出回答的准确率,使模型得以有效应用在医疗问答场景中。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121614593B_ABST
    Figure CN121614593B_ABST
Patent Text Reader

Abstract

This application discloses a medical question-answering method, apparatus, device, and storage medium, relating to the field of data processing technology. The disclosed medical question-answering method includes: acquiring medical query information input by a user; inputting the medical query information into a pre-trained medical question-answering model to obtain target answer information; wherein the medical question-answering model is trained based on a medical knowledge graph, which assists the medical question-answering model in determining the target reasoning path corresponding to the medical query information within the medical knowledge graph, so that the medical question-answering model can determine the target answer information corresponding to the medical query information based on the target reasoning path. The model in this application embodiment, by using a medical knowledge graph to assist in answering medical questions, effectively alleviates the model illusion problem commonly found in large language models, thereby improving the accuracy of the model's output answer in medical question-answering scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to medical question-and-answer methods, apparatus, devices and storage media. Background Technology

[0002] With the rapid development of artificial intelligence, knowledge question-answering systems based on Large Language Models (LLMs) have become one of the core tools for information retrieval. These systems extract knowledge from massive amounts of structured or unstructured data through natural language understanding and generation technologies, providing users with the answers they need.

[0003] However, current large language models generally suffer from model illusion, which refers to the phenomenon that large language models generate content that appears reasonable but is actually erroneous, fictitious, or lacks factual basis. For scenarios such as medical question answering, model illusion has become a core obstacle restricting its clinical application. Specifically, it manifests as deviations between the generated content and medical facts, logic, or contextual semantics, making it difficult to meet the high accuracy requirements of medical question answering. Summary of the Invention

[0004] The main purpose of this application is to provide a medical question-and-answer method, apparatus, device and storage medium, which aims to solve the model illusion problem in medical question-and-answer scenarios.

[0005] To achieve the above objectives, this application proposes a medical question-and-answer method, the method comprising: Obtain medical query information input by the user; The medical query information is input into a pre-trained medical question-answering model to obtain the target answer information. The medical question-answering model is trained based on a medical knowledge graph, which is used to assist the medical question-answering model in determining the target reasoning path corresponding to the medical query information in the medical knowledge graph, so that the medical question-answering model can determine the target answer information corresponding to the medical query information based on the target reasoning path.

[0006] In one embodiment, inputting the medical query information into a pre-trained medical question-answering model to obtain the target answer information includes: The medical query information is input into a pre-trained medical question-answering model, which then performs the following steps: Based on the medical query information, the corresponding first reasoning path is determined; If the first reasoning path contains information that is not available in the medical question-answering model, a second reasoning path is determined based on the medical knowledge graph and the first reasoning path. Based on the second reasoning path, the target answer information is obtained.

[0007] In one embodiment, the method further includes: Through multiple rounds of reflection, the knowledge boundary information between the medical question-answering model and the medical knowledge graph is determined; wherein, the knowledge boundary information is used to characterize the first information that is included in the medical knowledge graph but not included in the medical question-answering model; The step of determining the second inference path based on the medical knowledge graph and the first inference path includes: Based on the first information that is included in the medical knowledge graph but not in the medical question-answering model, the number of queries of the first reasoning path in the medical knowledge graph is determined. Based on the number of queries, query the second information required in the first reasoning path in the medical knowledge graph; Based on the first reasoning path, the third information in the medical question-answering model, and the second information, a second reasoning path is determined.

[0008] In one embodiment, querying the second information required in the first reasoning path within the medical knowledge graph includes: In the medical knowledge graph, the currently accessed target corresponding to the input information of the first reasoning path is determined; Starting from the currently accessed target, determine the number of targets to be accessed in the medical knowledge graph corresponding to the currently accessed target; If the number of targets to be accessed is greater than 1, target expectation values ​​are determined for each of the targets to be accessed; wherein the target expectation value is related to the immediate reward value and the estimated future reward value, and the target expectation value is related to the input information of the first inference path; Based on the target expectation value, a target to be accessed is determined from a plurality of targets to be accessed and accessed accordingly. Take the target to be accessed as the current target being accessed, and return to the step of determining the number of targets to be accessed corresponding to the current target being accessed in the medical knowledge graph, starting from the current target being accessed, until the number of targets to be accessed corresponding to the current target being accessed is 0. Based on all the targets visited during the traversal, determine the information required in the first inference path.

[0009] In one embodiment, determining the currently accessed target corresponding to the input information of the first inference path in the medical knowledge graph includes: Based on the semantic information of the medical query information, entity nodes or relation edges that match the semantic information are determined from the medical knowledge graph and used as the current accessed target corresponding to the input information of the first reasoning path.

[0010] In one embodiment, determining the target to be accessed from a plurality of targets to be accessed based on the target expectation value includes: At least one target to be visited is determined from the plurality of targets to be visited in descending order of the expected target values.

[0011] In one embodiment, the method further includes: Based on pre-constructed candidate question texts, multiple target question texts are constructed using various semantic representations; wherein, the candidate question texts are related to medical knowledge; The multiple target question texts are input into a pre-trained teacher model, which predicts the corresponding answer texts based on the multiple target question texts and outputs the thought process information and answer texts during the prediction process. The target question text, the thought process information during the prediction process, and the answer text are used as a set of candidate question-answer pairs. From the multiple sets of candidate question-answer pairs corresponding to the multiple target question texts, select the target question-answer pairs that meet the preset conditions; Based on the target question-answer pair, the medical knowledge graph is constructed.

[0012] In one embodiment, the construction of multiple target question texts based on pre-constructed candidate question texts, employing various semantic representations, includes: The candidate question text is input into the teacher model, and the teacher model performs the following steps if it determines that the candidate question text is relevant to a preschool or pediatric medical scenario: Extract multiple knowledge entities from the candidate question text; Based on the aforementioned knowledge entities, multiple target question texts are constructed.

[0013] In one embodiment, constructing the medical knowledge graph based on the target question-answer pair includes: Cluster the semantically similar questions and answers in the multiple target question-answer pairs to obtain clustered questions and clustered answers; The clustered questions and answers are input into a pre-trained extraction model, which then extracts multiple knowledge triples from the clustered questions and answers. Determine the labels corresponding to the multiple knowledge triples respectively; The medical knowledge graph is constructed based on the multiple knowledge triples and their corresponding tags.

[0014] In one embodiment, before inputting the medical query information into a pre-trained medical question-answering model, the method further includes: Obtain pre-trained candidate question-answering models; The parameter update formula is determined using the value function estimation method; wherein the parameter update formula is related to the target expected value of the model in multiple inference paths in the medical knowledge graph, and the target expected value is equal to the sum of the immediate reward value and the estimated future reward value; Based on the parameter update formula, the parameters in the candidate question-answering model are updated to obtain the updated candidate question-answering model as the medical question-answering model.

[0015] In one embodiment, before determining the parameter update formula using the value function estimation method, the method further includes: The expected value of the target is determined based on the sum of the actual scores of all accessed targets in the reasoning path under the candidate access strategy in the medical knowledge graph. or, The expected value of the target is determined based on the actual score of the currently accessed target in the inference path, the future benefit decay factor, and the predicted score of the target to be accessed under the candidate access strategy in the inference path in the medical knowledge graph.

[0016] Furthermore, to achieve the above objectives, this application also proposes a medical question-and-answer device, the device comprising: The acquisition module is used to acquire medical query information input by the user; The question-answering module is used to input the medical query information into a pre-trained medical question-answering model to obtain the target answer information. The medical question-answering model is trained based on a medical knowledge graph, which is used to assist the medical question-answering model in determining the target reasoning path corresponding to the medical query information in the medical knowledge graph, so that the medical question-answering model can determine the target answer information corresponding to the medical query information based on the target reasoning path.

[0017] In one embodiment, the question-and-answer module is specifically used for: The medical query information is input into a pre-trained medical question-answering model, which then performs the following steps: Based on the medical query information, the corresponding first reasoning path is determined; If the first reasoning path contains information that is not available in the medical question-answering model, a second reasoning path is determined based on the medical knowledge graph and the first reasoning path. Based on the second reasoning path, the target answer information is obtained.

[0018] In one embodiment, the device further includes: The determination module is used to: determine the knowledge boundary information between the medical question-answering model and the medical knowledge graph through a multi-round reflection process; wherein, the knowledge boundary information is used to characterize first information that is included in the medical knowledge graph but not included in the medical question-answering model; The question-and-answer module is also specifically used for: Based on the first information that is included in the medical knowledge graph but not in the medical question-answering model, the number of queries of the first reasoning path in the medical knowledge graph is determined. Based on the number of queries, query the second information required in the first reasoning path in the medical knowledge graph; Based on the first reasoning path, the third information in the medical question-answering model, and the second information, a second reasoning path is determined.

[0019] In one embodiment, the question-answering module is further specifically used for: In the medical knowledge graph, the currently accessed target corresponding to the input information of the first reasoning path is determined; Starting from the currently accessed target, determine the number of targets to be accessed in the medical knowledge graph corresponding to the currently accessed target; If the number of targets to be accessed is greater than 1, target expectation values ​​are determined for each of the targets to be accessed; wherein the target expectation value is related to the immediate reward value and the estimated future reward value, and the target expectation value is related to the input information of the first inference path; Based on the target expectation value, a target to be accessed is determined from a plurality of targets to be accessed and accessed accordingly. Take the target to be accessed as the current target being accessed, and return to the step of determining the number of targets to be accessed corresponding to the current target being accessed in the medical knowledge graph, starting from the current target being accessed, until the number of targets to be accessed corresponding to the current target being accessed is 0. Based on all the targets visited during the traversal, determine the information required in the first inference path.

[0020] In one embodiment, the question-answering module is further configured to: determine, based on the semantic information of the medical query information, an entity node or relation edge that matches the semantic information from the medical knowledge graph, and use it as the currently accessed target corresponding to the input information of the first reasoning path.

[0021] In one embodiment, the question-answering module is further configured to: determine at least one target to be accessed from among the plurality of targets to be accessed, in descending order of the target expectation value.

[0022] In one embodiment, the apparatus further includes a construction module for: Based on pre-constructed candidate question texts, multiple target question texts are constructed using various semantic representations; wherein, the candidate question texts are related to medical knowledge; The multiple target question texts are input into a pre-trained teacher model, which predicts the corresponding answer texts based on the multiple target question texts and outputs the thought process information and answer texts during the prediction process. The target question text, the thought process information during the prediction process, and the answer text are used as a set of candidate question-answer pairs. From the multiple sets of candidate question-answer pairs corresponding to the multiple target question texts, select the target question-answer pairs that meet the preset conditions; Based on the target question-answer pair, the medical knowledge graph is constructed.

[0023] In one embodiment, the construction module is specifically used for: The candidate question text is input into the teacher model, and the teacher model performs the following steps if it determines that the candidate question text is relevant to a preschool or pediatric medical scenario: Extract multiple knowledge entities from the candidate question text; Based on the aforementioned knowledge entities, multiple target question texts are constructed.

[0024] In one embodiment, the construction module is further specifically used for: Cluster the semantically similar questions and answers in the multiple target question-answer pairs to obtain clustered questions and clustered answers; The clustered questions and answers are input into a pre-trained extraction model, which then extracts multiple knowledge triples from the clustered questions and answers. Determine the labels corresponding to the multiple knowledge triples respectively; The medical knowledge graph is constructed based on the multiple knowledge triples and their corresponding tags.

[0025] In one embodiment, the apparatus further includes a processing module for: Obtain pre-trained candidate question-answering models; The parameter update formula is determined using the value function estimation method; wherein the parameter update formula is related to the target expected value of the model in multiple inference paths in the medical knowledge graph, and the target expected value is equal to the sum of the immediate reward value and the estimated future reward value; Based on the parameter update formula, the parameters in the candidate question-answering model are updated to obtain the updated candidate question-answering model as the medical question-answering model.

[0026] In one embodiment, the processing module is further configured to: The expected value of the target is determined based on the sum of the actual scores of all accessed targets in the reasoning path under the candidate access strategy in the medical knowledge graph. or, The expected value of the target is determined based on the actual score of the currently accessed target in the inference path, the future benefit decay factor, and the predicted score of the target to be accessed under the candidate access strategy in the inference path in the medical knowledge graph.

[0027] In addition, to achieve the above objectives, this application also proposes a medical question-and-answer device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the medical question-and-answer method as described above.

[0028] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and which, when executed by a processor, implements the steps of the medical question-and-answer method described above.

[0029] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the medical question-and-answer method described above.

[0030] One or more technical solutions proposed in this application have at least the following technical effects: To alleviate the illusion problem in the model's reasoning process, a high-quality medical knowledge graph is introduced. The model can jointly determine the target reasoning path corresponding to the medical query information based on the user's input medical query information and the medical knowledge graph as a correct reference. Based on the target reasoning path, the model can infer the target answer information corresponding to the medical query information. In the process of medical question answering, the model uses the medical knowledge graph to assist in answering, which effectively alleviates the model illusion problem that is common in large language models. This improves the accuracy of the model's output answer in medical question answering scenarios, enabling the model to be effectively applied in medical question answering scenarios. Attached Figure Description

[0031] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0032] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 This is one of the flowcharts illustrating the medical question-and-answer method provided in this application; Figure 2 This is the second flowchart illustrating the medical question-and-answer method provided in this application; Figure 3 This is the third flowchart illustrating the medical question-and-answer method provided in this application; Figure 4 This is a schematic diagram of the medical question-and-answer device provided in this application; Figure 5 This is a schematic diagram of the medical question-and-answer device provided in this application.

[0034] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0035] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0036] Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit this application; the terms "comprising" and "having" and any variations thereof in the specification, claims and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0037] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0038] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.

[0039] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0040] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0041] In related technologies, large models can acquire knowledge through pre-training and learn how to apply knowledge for reasoning through post-training, mastering the pattern of reasoning using parameterized knowledge. However, in the process of using the reasoning pattern they have mastered to apply external expert knowledge, the model illusion problem will occur, that is, the model will generate content that seems reasonable but is actually wrong, fictitious, or lacks factual basis.

[0042] For specific application scenarios such as medical question answering, the model illusion problem has become a core obstacle restricting its clinical implementation. Specifically, it manifests as a deviation between the generated content and medical facts, logic, or contextual semantics, making it difficult to meet the high accuracy requirements of medical question answering.

[0043] To address the aforementioned issues, this application provides a medical question-answering method that aims to alleviate the model illusion problem by using a high-accuracy medical knowledge graph as a reference. Specifically, for scenarios such as children's medical knowledge question-answering, it is necessary to model the interaction process between the large model and the medical knowledge graph, and use reinforcement learning to train the large model to improve its interaction ability with the medical knowledge graph.

[0044] The embodiments of this application and the following embodiments will be described in detail below.

[0045] This application provides a medical question-and-answer method, referring to... Figure 1 , Figure 1 This is one of the flowcharts of the medical question-and-answer method provided in this application, which includes steps S101-S102: Step S101: Obtain the medical query information entered by the user.

[0046] It should be noted that medical query information, such as "What should I do if my child sprains his ankle and it is red and swollen," is related to the medical field. The core need for such medical query information can be understood as emergency treatment and follow-up care. Users may want to quickly obtain key steps and avoid duplication and redundancy. This is just an example. It can also be other non-urgent query information related to the medical field. This application embodiment does not limit this.

[0047] Step S102: Input the medical query information into the pre-trained medical question-answering model to obtain the target answer information; The medical question-answering model is trained based on a medical knowledge graph. The medical knowledge graph is used to assist the medical question-answering model in determining the target reasoning path corresponding to the medical query information in the medical knowledge graph, so that the medical question-answering model can determine the target answer information corresponding to the medical query information based on the target reasoning path.

[0048] It should be noted that the above-mentioned medical question-answering model can be pre-trained based on a pre-set medical query information sample set, and then trained based on a high-accuracy medical knowledge graph. The medical query information sample set can enable the model to understand basic medical knowledge, but the trained model may suffer from model illusion. At this time, it is necessary to use a high-accuracy medical knowledge graph to ensure the accuracy of the reasoning path, thereby alleviating or even eliminating the model illusion.

[0049] Optionally, the aforementioned medical knowledge graph may be in the form of a graph database, etc., provided that the medical knowledge graph contains correct knowledge. This application does not impose any restrictions on this.

[0050] This application provides a medical question-answering method. To alleviate the illusion during the model's reasoning process, a high-quality medical knowledge graph is introduced. The model can jointly determine the target reasoning path corresponding to the medical query information based on the user's input medical query information and the medical knowledge graph as a correct reference, and infer the target answer information corresponding to the medical query information based on the target reasoning path. In the process of medical question answering, the model uses the medical knowledge graph to assist in answering, which effectively alleviates the model illusion problem that is common in large language models, thereby improving the accuracy of the model's output answer in medical question-answering scenarios, and enabling the model to be effectively applied in medical question-answering scenarios.

[0051] In some embodiments, a specific implementation of a medical question-answering model for determining target answer information is provided. Step S102 above may include the following steps: The medical query information is input into a pre-trained medical question-answering model, which then performs the following steps: Step S1-1: Based on the medical query information, determine the corresponding first reasoning path; Step S1-2: If there is information in the first reasoning path that is not available in the medical question-answering model, determine the second reasoning path based on the medical knowledge graph and the first reasoning path.

[0052] It should be noted that the model can proactively perceive its own knowledge boundaries. If the medical question-answering model does not possess the relevant knowledge, it can obtain the correct reference knowledge by querying the medical knowledge graph, thereby mitigating the problem of model illusion.

[0053] Steps S1-3: Based on the second reasoning path, obtain the target answer information.

[0054] In some embodiments, step S102 may further include: Steps S1-4 involve determining the knowledge boundary information between the medical question-answering model and the medical knowledge graph through a multi-round reflection process; wherein the knowledge boundary information is used to characterize the first information that is included in the medical knowledge graph but not included in the medical question-answering model.

[0055] It should be noted that the above steps S1-4 can occur before steps S1-1 or S1-2, and this application does not impose any restrictions on this.

[0056] Accordingly, step S1-2 may include the following steps: Step S1-21: Based on the first information that is included in the medical knowledge graph but not in the medical question-answering model, determine the number of queries of the first reasoning path in the medical knowledge graph.

[0057] Steps S1-22: According to the number of queries, query the second information required in the first reasoning path in the medical knowledge graph.

[0058] Steps S1-23: Determine the second inference path based on the first inference path, the third information in the medical question-answering model, and the second information.

[0059] It should be noted that a reasoning path can be understood as a chain of thoughts (COT). A trajectory can contain multiple reflection sub-paths. In each reflection process, it can actively perceive the knowledge boundaries of the model itself, and if it does not have the relevant knowledge, it will query the graph database to obtain the required information.

[0060] In some embodiments, a specific implementation method for querying information in a medical knowledge graph is provided. Steps S1-22 above can be implemented through the following steps: In the medical knowledge graph, the currently accessed target corresponding to the input information of the first reasoning path is determined; Starting from the currently accessed target, determine the number of targets to be accessed in the medical knowledge graph corresponding to the currently accessed target; If the number of targets to be accessed is greater than 1, target expectation values ​​are determined for each of the targets to be accessed; wherein the target expectation value is related to the immediate reward value and the estimated future reward value, and the target expectation value is related to the input information of the first inference path; Based on the target expectation value, a target to be accessed is determined from a plurality of targets to be accessed and accessed accordingly. Take the target to be accessed as the current target being accessed, and return to the step of determining the number of targets to be accessed corresponding to the current target being accessed in the medical knowledge graph, starting from the current target being accessed, until the number of targets to be accessed corresponding to the current target being accessed is 0. Based on all the targets visited during the traversal, determine the information required in the first inference path.

[0061] In some embodiments, a specific implementation method for determining the currently accessed target is provided. The specific implementation method for determining the currently accessed target corresponding to the input information of the first inference path in the medical knowledge graph may include: Based on the semantic information of the medical query information, entity nodes or relation edges that match the semantic information are determined from the medical knowledge graph and used as the current accessed target corresponding to the input information of the first reasoning path.

[0062] For example, the aforementioned entity nodes are used to represent drugs, disease symptoms, disease names, treatment methods, etc., and the aforementioned relational edges are used to represent the connections between these entities. For example, a drug can relieve a certain symptom of a certain disease, while another drug can treat a certain disease. This application does not impose any restrictions on this.

[0063] Optionally, based on the semantic information of medical query information, the more complex questions corresponding to the medical query information can be broken down into multiple simpler sub-questions. Then, based on the semantic information of these sub-questions, matching can be performed in the medical knowledge graph to match the corresponding entity nodes or relation edges. The entity nodes or relation edges corresponding to these sub-questions can be used as the current accessed targets to find the required information. If the number of current accessed targets is greater than 1, reasoning can be performed based on multiple current accessed targets to find the required information.

[0064] For example, if the number of targets to be accessed is equal to 1, then the query path is considered to be determined, and the targets to be accessed can be accessed directly to ultimately determine the required information.

[0065] In some embodiments, another specific implementation method is provided for determining the currently accessed target. This specific implementation method, based on the target expectation value, for determining the target to be accessed from a plurality of targets to be accessed, may include: At least one target to be visited is determined from the plurality of targets to be visited in descending order of the expected target values.

[0066] Specifically, since the target expectation value can represent the probability of matching between the query path corresponding to each target to be accessed and the medical query information, the target to be accessed with the larger target expectation value can be selected first as the target to be accessed. This selection can increase the probability of selecting the target reasoning path that is more matched with the medical query information, thereby improving the accuracy of medical question answering.

[0067] Optionally, targets whose expected values ​​are within a certain range can be selected as the targets to be accessed. Specific settings can also be made according to the actual situation. This application does not impose any restrictions on this.

[0068] In some embodiments, a specific implementation of constructing a medical knowledge graph is provided. Figure 2 This is the second flowchart of the medical question-and-answer method provided in this application, such as... Figure 2 As shown, the method includes steps S201 to S205: Step S201: Based on the pre-constructed candidate question texts, construct multiple corresponding target question texts using various semantic representations; The candidate question texts are related to medical knowledge.

[0069] Specifically, the aforementioned pre-constructed candidate question texts can be used as a basis to generalize the candidate question texts into specific questions using various semantic expressions, thereby constructing a large number of generalized target question texts, which can then be used to ultimately construct a high-quality medical knowledge graph.

[0070] In some embodiments, a specific implementation method for constructing multiple target question texts is provided. Specifically, step S201 above can be implemented through the following steps: The candidate question text is input into the teacher model, and the teacher model performs the following steps if it determines that the candidate question text is relevant to a preschool or pediatric medical scenario: Extract multiple knowledge entities from the candidate question text; Based on the aforementioned knowledge entities, multiple target question texts are constructed.

[0071] For example, the model can extract knowledge entities from candidate question texts and construct sub-queries containing multiple knowledge entities. These sub-queries can be considered as the target question texts mentioned above. The model can then use these target question texts to initiate queries on the graph and retrieve knowledge related to the knowledge entities.

[0072] Specifically, a teacher model can be used to generalize specific questions. When a teacher model determines that a candidate question text fits the specific application scenario of early childhood or pediatric medical care, it can construct multiple target question texts corresponding to the candidate question text.

[0073] Optionally, if the teacher model determines that the candidate question text does not conform to the specific application scenario of early childhood or pediatric medical care, then the target question text or prompt information may not be constructed. This is to avoid the generalization of question texts from non-specific application scenarios into the construction of a medical knowledge graph. In this embodiment, after the teacher model selects candidate question texts that conform to the specific application scenario of early childhood or pediatric medical care, the candidate question texts are then generalized. This ensures that the medical knowledge graph constructed based on the generalized target question text is strongly correlated with the specific application scenario, thereby improving the accuracy of the model in using the medical knowledge graph to assist in medical question answering.

[0074] Step S202: Input the multiple target question texts into the pre-trained teacher model, and the teacher model predicts the corresponding answer texts based on the multiple target question texts, and outputs the thought process information and answer texts in the prediction process; Step S203: The target question text, the thought process information and the answer text in the prediction process are taken as a set of candidate question-answer pairs; Step S204: Select target question-answer pairs that meet preset conditions from multiple sets of candidate question-answer pairs corresponding to the multiple target question texts; Step S205: Construct the medical knowledge graph based on the target question-answer pair.

[0075] In some embodiments, a specific implementation of constructing a medical knowledge graph based on target question-answer pairs is provided. Specifically, step S205 above can be implemented through the following steps: Step S2051: Cluster the semantically similar questions and semantically similar answers in the multiple target question-answer pairs to obtain clustered questions and clustered answers; Step S2052: Input the clustered questions and the clustered answers into a pre-trained extraction model, and the extraction model extracts multiple knowledge triples from the clustered questions and the clustered answers. Step S2053: Determine the tags corresponding to the plurality of knowledge triples respectively; Step S2054: Construct the medical knowledge graph based on the multiple knowledge triples and their corresponding tags.

[0076] In some embodiments, a specific implementation of training a medical question-answering model is provided. Figure 3 This is the third flowchart of the medical question-and-answer method provided in this application, such as... Figure 3 As shown, the method includes steps S301 to S303: Step S301: Obtain the pre-trained candidate question-answering model; Step S302: Determine the parameter update formula using the value function estimation method; The parameter update formula is related to the target expected value of the model in multiple inference paths in the medical knowledge graph, and the target expected value is equal to the sum of the immediate reward value and the estimated future reward value.

[0077] For example, the above parameter update formula can be: =

[0078] in, The parameterized value function characterizing time t, which may include, for example, weights and biases. The parameterized value function characterizing the updated value at time t+1. The expected value representing the target can be understood as the expected value of the total score of the Chain-of-Thought (COT) reasoning link in the model, used to represent the expected value of the action value function. The update coefficients are represented by q, which represents the model predictions used to approximate the model. , Characterizing the state at time t, Characterizing the action at time t, The value function that represents the action.

[0079] Step S303: Based on the parameter update formula, update the parameters in the candidate question-answering model to obtain the updated candidate question-answering model as the medical question-answering model.

[0080] In some embodiments, a specific implementation method for determining the target expected value is provided. Prior to step S302 above, the following steps may be included: The expected value of the target is determined based on the sum of the actual scores of all accessed targets in the reasoning path under the candidate access strategy in the medical knowledge graph. Alternatively, the expected value of the target can be determined based on the actual score of the currently accessed target in the inference path, the future benefit decay factor, and the predicted score of the target to be accessed under the candidate access strategy in the inference path in the medical knowledge graph.

[0081] For example, the Monte Carlo (also known as MC-error) algorithm or the Temperol Difference (also known as TD-error) algorithm can be introduced in combination with a value function to approximate the expected value of the target.

[0082] Specifically, the calculation based on the MC-error algorithm can be performed using the following formula:

[0083] Where t represents the t-th sampling step, Characterizing the future earnings decay factor, It represents the actual score of the k-th visited target in the reasoning path.

[0084] Specifically, the TD-error algorithm can be calculated using the following formula:

[0085] Among them, the above The loss is determined by the TD-error algorithm, which approximates the value function distribution through the t-th sampling iteration. This represents the immediate reward value, which is the actual score of the currently accessed target in the reasoning path within the medical knowledge graph. The predicted score of the target to be visited in the inference path under the candidate access strategy is the optimization objective of the value function distribution algorithm. The smaller the value of the future return decay factor, the less importance is placed on future returns.

[0086] In some embodiments, an iterative formula for the gradient function parameters of the reinforcement learning policy is also provided: =

[0087] in, The parameterized value function characterizing the updated value at time t+1. The parameterized value function characterizing time t, Characterization, Characterization, Characterization.

[0088] It should be noted that the difference between the MC-error algorithm and the TD-error algorithm is that the MC-error algorithm needs to sample multiple complete COT inference links to learn the model parameters, while the TD-error algorithm estimates the value of the next few steps and then estimates the value of the entire trajectory.

[0089] The following example illustrates the medical question-answering method provided in this application. This method requires modeling the interaction process between a large model and a medical knowledge graph, and using reinforcement learning to train the large model to master the interaction ability with the expert knowledge base of the graph.

[0090] (a) Modeling: 1) Modeling the thinking process: The thought process is contained in the identifier <think>< / think> In the model-generated query graph expert knowledge base, the query is contained within the identifier. <queryinfo>< / queryinfo> In the context of the graph expert knowledge base query result response, it is included in the identifier. <information>< / information> middle.

[0091] For example, <think> <queryinfo> < / queryinfo> <infomation> <patient status accessment> < / patient status accessment> <emergency for help> < / emergency for help> <Immediate treatment> < / Immediate treatment> <vital note> < / vital note> <medicine> < / medicine> < / infomation> < / think> .

[0092] 2) Example of the thought process: <think>When a user asks, "What should I do if my child sprains their ankle? It's red and swollen." First, extract the user's key information. The core need is still emergency treatment and follow-up care, and the user likely wants quick access to crucial steps to avoid repetition. The first principle should be extracted: "Immediate immobilization + cold compress to reduce swelling." This is key to relieving redness, swelling, and pain and should be emphasized first.

[0093] Next, the emergency response phase needs to simplify the steps: <queryinfo> <Age: Child><Illness: Sprained ankle><Symptoms: Redness and swelling><Duration of illness:><Seeking medical help:><Inquiring about medication:>< / queryinfo> <information> <patient status accessment> Airway is open; breathing is normal; radial artery pulsation is present; skin is warm and pink; patient is conscious and oriented; upon exposure, left ankle deformity is observed, with significant swelling and tenderness.< / patientstatus accessment> <emergency for help> If a child is unable to stand or walk, or experiences severe pain upon touch; if the ankle is visibly deformed or abnormally bent; if swelling or pain does not lessen within 48 hours but worsens; or if the toes turn purple, become cold, numb, or lose sensation, immediately take the child to the emergency department; simultaneously notify the receiving hospital of any suspected fractures and vital signs; before moving the child, immobilize the ankle joint with a splint or rigid brace.< / emergency for help> <Immediate treatment> Within 48 hours (acute phase): Cold compresses are the primary treatment; avoid promoting blood circulation. Wrap an ice pack or a frozen mineral water bottle in a towel and apply it to the red and swollen area for 15-20 minutes each time, 3-4 times a day. The purpose is to constrict blood vessels and reduce bleeding and swelling. At this time, it is absolutely forbidden to soak or rub the area with hot water, nor to apply safflower oil, liniment, or other medications that promote blood circulation and remove blood stasis, as this will make the redness and swelling worse. After 48 hours (recovery period), apply warm compresses to promote absorption: If the redness and swelling no longer worsen, switch to warm compresses with a warm towel (15 minutes each time) to promote local blood circulation and help reduce swelling. At this time, there is no need to rush to use medication, as most mild redness and swelling will gradually subside with rest.

[0094] RICE principle: Rest: Stop all activity and keep the child still.

[0095] Ice: Wrap an ice pack in a towel and apply it for 15–20 minutes.

[0096] Compression: Gently wrap the leg from the toes to the middle of the calf with an elastic bandage.

[0097] Elevation: Use a pillow to elevate the affected limb above heart level.

[0098] < / Immediate treatment> <vital note> Age, weight, severity of redness and swelling, and exclusion of contraindicated medications, such as traditional Chinese medicine for promoting blood circulation and removing blood stasis (safflower oil, liniment).< / vital note> <medicine>Nonsteroidal anti-inflammatory drugs for children; External medication: Yunnan Baiyao spray or children's special anti-swelling ointment; Pain relievers: ibuprofen gel, acetaminophen drops; < / medicine> < / information> Combining the previously mentioned RICE principle, but breaking it down in simpler terms to ensure parents can quickly implement it: Rest (stop activity), Cold compress (specific duration and precautions, such as avoiding direct skin contact), Compression (tightness of the elastic bandage), Elevation (above heart level). Each step should have clearly defined operational points to avoid ambiguity.

[0099] Then comes the follow-up care, which requires different treatment methods before and after 48 hours (from cold compresses to hot compresses). At the same time, parents should be reminded to avoid folk remedies (such as massage and blood-activating and stasis-removing ointments), as this is a common mistake made by parents and must be clearly prohibited to prevent aggravating the injury.

[0100] Key medical signals are important. Specific symptoms (severe pain, deformity, persistent swelling, fever, etc.) should be listed so that parents can clearly determine whether medical attention is needed and avoid delaying treatment for serious conditions (such as fractures or ligament tears).

[0101] Finally, the summary section should concisely review the core steps to reinforce memory. The follow-up questions section should provide practical services, incorporating tools that parents might need, such as a "Children's Sprained Ankle Care Schedule," to facilitate reference and meet users' need for clear guidance, while maintaining a single service principle and not offering multiple options.

[0102] The entire thought process should revolve around "conciseness, practicality, and highlighting key points" to ensure that parents can quickly understand and implement it. It should also cover the three core aspects of emergency treatment, follow-up care, and medical judgment to avoid omitting key information, while using plain language that is easy for parents to use.

[0103] 3) Autoregressive large language models utilize conditional probability to model the language generation process. The model learns conditional probabilities using self-supervised signals and focuses on the decision boundary loss using cross-entropy as the objective function. The information represented cannot fully characterize ( The relevant relationships, and consequently the distribution of historical and external expert knowledge. The expression is insufficient. This application proposes to utilize the co-occurrence relationship between joint probabilistic modeling model knowledge and external expert knowledge (using the aforementioned medical knowledge graph in the embodiments of this application) to enable the model to integrate model and external expert knowledge during the learning and reasoning process.

[0104] In the process of reflecting on COT, the autoregressive large language model utilizes conditional probability to model the generative process. Large models, however, learn conditional probabilities using self-supervised signals, and the supervised fine-tuning process uses cross-entropy as the objective function. The mode covering effect of KV divergence focuses on the decision boundary loss, but cannot fully characterize (…). , (Relationship). When new knowledge is distributed... Adding this to the discussion of forgetting caused by prioritizing model memory and knowledge distribution drift during continuous training. Simultaneously, model learning This application uses a joint probabilistic modeling model to parameterize the co-occurrence relationships of knowledge, historical dialogue knowledge, and newly added external expert knowledge, and leverages the mode-seeking effect of KL divergence to simultaneously approximate the distribution of historical dialogue data. Distribution of expert knowledge in the currently retrieved graph This enables the model to integrate its internal knowledge distribution with external expert knowledge distribution during business scenario reasoning. This application leverages the on-policy algorithm in reinforcement learning to fully utilize the parameterized knowledge distribution of the base model itself, utilizes the replay buffer to utilize historical knowledge, and uses parameterized knowledge boundaries (entropy measures the information gain of model actions, and PPL measures the confidence of model actions) to determine whether to perform a graph knowledge base query, thereby training the model's ability to proactively utilize expert graph knowledge.

[0105] The innovation of the modeling process in this application embodiment lies in: <1> During training, the importance sampling is adjusted to balance external expert knowledge and model internalized knowledge, thereby improving the learning efficiency of expert knowledge while reducing the model's forgetting of internalized knowledge. <2> Due to lack To fully utilize prior knowledge of historical experience samples, a maximum entropy strategy of scattering uniform sampling using a replay buffer is employed. This indicates the medical question-answering model's response to the current question after repeatedly considering the details and user questions at time T-1; <3> To incorporate real-time dynamic signals from the global spectrum during querying, calculations are performed. The steady-state distribution is represented by eigenvectors and eigenvalues. Simultaneously, dynamic change factors for nodes and edges in the graph knowledge base are introduced. ,in, The eigenvectors of a matrix given that its eigenvalues ​​are all 1 are used to represent the steady-state distribution of the state transition. , Representation in context state The following model answers The model transitions to the state. The probability, This represents the degree of a graph node in the current query state s.

[0106] The innovation of this modeling process lies in: 1) During the training process, the deviation between the distribution of external expert knowledge and the distribution of internalized knowledge in the model is measured based on semantic similarity. In the reinforcement learning training entropy-based solution space search strategy, the deviation is introduced to guide the model to improve the learning efficiency of expert knowledge while reducing the model's forgetting of internalized knowledge.

[0107] 2) Due to the lack of sample knowledge for real-world scene graph queries To address sparsity, a maximum entropy strategy is employed to scatter uniformly sampled data using a replay buffer.

[0108] 3) To incorporate real-time global dynamic signals of the graph during queries, dynamic change factors for node out-degree and edge degree of the graph knowledge base are introduced. During training, a batch of graph query path sets is sampled for computation. The steady-state distribution of state transitions is represented by the eigenvectors and eigenvalues ​​of the matrix. ,use The normalized value is used as an independent search strategy for graph nodes. State value function The estimated value, of which, Indicates the context state The following model answers Receive reward The probability of.

[0109] 4) In reinforcement learning, the on-policy algorithm is introduced to provide a process reward function during the solution space exploration process.

[0110] (II) Ideology: In the context of children's medical knowledge question-and-answering, to alleviate the illusion of thought process in the COT (Consideration, Opinion, and Response) model, a high-quality medical knowledge graph is introduced, and an LLM (Limited Least Merger) agent is trained and used for inference based on the knowledge graph. The innovation of this application's embodiment lies in using reinforcement learning to model the interaction between the COT inference process and the medical knowledge graph, and then modeling a scoring system for the COT inference process.

[0111] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the medical question-and-answer method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0112] This application also provides a medical question-and-answer device. Figure 4 This is a schematic diagram of the medical question-and-answer device provided in this application, such as... Figure 4 As shown, the medical question-and-answer device includes: The acquisition module 401 is used to acquire medical query information input by the user; The question-answering module 402 is used to input the medical query information into a pre-trained medical question-answering model to obtain target answer information; wherein, the medical question-answering model is trained based on a medical knowledge graph, and the medical knowledge graph is used to assist the medical question-answering model in determining the target reasoning path corresponding to the medical query information in the medical knowledge graph, so that the medical question-answering model can determine the target answer information corresponding to the medical query information based on the target reasoning path.

[0113] In some embodiments, the question-answering module 402 is specifically used for: The medical query information is input into a pre-trained medical question-answering model, which then performs the following steps: Based on the medical query information, the corresponding first reasoning path is determined; If the first reasoning path contains information that is not available in the medical question-answering model, a second reasoning path is determined based on the medical knowledge graph and the first reasoning path. Based on the second reasoning path, the target answer information is obtained.

[0114] In some embodiments, the apparatus further includes: The determination module is used to: determine the knowledge boundary information between the medical question-answering model and the medical knowledge graph through a multi-round reflection process; wherein, the knowledge boundary information is used to characterize first information that is included in the medical knowledge graph but not included in the medical question-answering model; The question-and-answer module 402 is also specifically used for: Based on the first information that is included in the medical knowledge graph but not in the medical question-answering model, the number of queries of the first reasoning path in the medical knowledge graph is determined. Based on the number of queries, query the second information required in the first reasoning path in the medical knowledge graph; Based on the first reasoning path, the third information in the medical question-answering model, and the second information, a second reasoning path is determined.

[0115] In some embodiments, the question-answering module 402 is further specifically used for: In the medical knowledge graph, the currently accessed target corresponding to the input information of the first reasoning path is determined; Starting from the currently accessed target, determine the number of targets to be accessed in the medical knowledge graph corresponding to the currently accessed target; If the number of targets to be accessed is greater than 1, target expectation values ​​are determined for each of the targets to be accessed; wherein the target expectation value is related to the immediate reward value and the estimated future reward value, and the target expectation value is related to the input information of the first inference path; Based on the target expectation value, a target to be accessed is determined from a plurality of targets to be accessed and accessed accordingly. Take the target to be accessed as the current target being accessed, and return to the step of determining the number of targets to be accessed corresponding to the current target being accessed in the medical knowledge graph, starting from the current target being accessed, until the number of targets to be accessed corresponding to the current target being accessed is 0. Based on all the targets visited during the traversal, determine the information required in the first inference path.

[0116] In some embodiments, the question-answering module 402 is further specifically used to: determine, based on the semantic information of the medical query information, an entity node or relation edge that matches the semantic information from the medical knowledge graph, and use it as the currently accessed target corresponding to the input information of the first reasoning path.

[0117] In some embodiments, the question-answering module 402 is further configured to: determine at least one target to be accessed from among the plurality of targets to be accessed in descending order of the target expectation value.

[0118] In some embodiments, the apparatus further includes a construction module for: Based on pre-constructed candidate question texts, multiple target question texts are constructed using various semantic representations; wherein, the candidate question texts are related to medical knowledge; The multiple target question texts are input into a pre-trained teacher model, which predicts the corresponding answer texts based on the multiple target question texts and outputs the thought process information and answer texts during the prediction process. The target question text, the thought process information during the prediction process, and the answer text are used as a set of candidate question-answer pairs. From the multiple sets of candidate question-answer pairs corresponding to the multiple target question texts, select the target question-answer pairs that meet the preset conditions; Based on the target question-answer pair, the medical knowledge graph is constructed.

[0119] In some embodiments, the construction module is specifically used for: The candidate question text is input into the teacher model, and the teacher model performs the following steps if it determines that the candidate question text is relevant to a preschool or pediatric medical scenario: Extract multiple knowledge entities from the candidate question text; Based on the aforementioned knowledge entities, multiple target question texts are constructed.

[0120] In some embodiments, the construction module is further specifically used for: Cluster the semantically similar questions and answers in the multiple target question-answer pairs to obtain clustered questions and clustered answers; The clustered questions and answers are input into a pre-trained extraction model, which then extracts multiple knowledge triples from the clustered questions and answers. Determine the labels corresponding to the multiple knowledge triples respectively; The medical knowledge graph is constructed based on the multiple knowledge triples and their corresponding tags.

[0121] In some embodiments, the apparatus further includes a processing module for: Obtain pre-trained candidate question-answering models; The parameter update formula is determined using the value function estimation method; wherein the parameter update formula is related to the target expected value of the model in multiple inference paths in the medical knowledge graph, and the target expected value is equal to the sum of the immediate reward value and the estimated future reward value; Based on the parameter update formula, the parameters in the candidate question-answering model are updated to obtain the updated candidate question-answering model as the medical question-answering model.

[0122] In some embodiments, the processing module is further configured to: The expected value of the target is determined based on the sum of the actual scores of all accessed targets in the reasoning path under the candidate access strategy in the medical knowledge graph. or, The expected value of the target is determined based on the actual score of the currently accessed target in the inference path, the future benefit decay factor, and the predicted score of the target to be accessed under the candidate access strategy in the inference path in the medical knowledge graph.

[0123] The medical question-and-answer device provided in this application, employing the medical question-and-answer method in the above embodiments, can solve the technical problem of model illusion in scenarios such as medical question-and-answer. Compared with the prior art, the beneficial effects of the medical question-and-answer device provided in this application are the same as those of the medical question-and-answer method provided in the above embodiments, and other technical features in the medical question-and-answer device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0124] This application provides a medical question-and-answer device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the medical question-and-answer method in the above embodiments.

[0125] The following is for reference. Figure 5 , Figure 5 This is a structural schematic diagram of the medical question-and-answer device provided in this application, illustrating a structural schematic diagram suitable for implementing the medical question-and-answer device of the embodiments of this application. The medical question-and-answer device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The medical question-and-answer device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0126] like Figure 5 As shown, the medical question-and-answer device may include a processing unit 501 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 503 into a random access memory (RAM) 504. The RAM 504 also stores various programs and data required for the operation of the medical question-and-answer device. The processing unit 501, ROM 502, and RAM 504 are interconnected via a bus 505. An input / output (I / O) interface 506 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 506: input devices 507 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 508 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 503 including, for example, magnetic tape, hard disk, etc.; and communication devices 509. Communication device 509 allows the medical question-and-answer device to communicate wirelessly or wiredly with other devices to exchange data. While the figures show medical question-and-answer devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.

[0127] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 503, or installed from ROM 502. When the computer program is executed by processing device 501, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0128] The medical question-and-answer device provided in this application, employing the medical question-and-answer method in the above embodiments, can solve the technical problem of model illusion in scenarios such as medical question-and-answer. Compared with the prior art, the beneficial effects of the medical question-and-answer device provided in this application are the same as those of the medical question-and-answer method provided in the above embodiments, and other technical features in this medical question-and-answer device are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.

[0129] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0130] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0131] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the medical question-and-answer method in the above embodiments.

[0132] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0133] The aforementioned computer-readable storage medium may be included in the medical question-and-answer device; or it may exist independently and not be assembled into the medical question-and-answer device.

[0134] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the medical question-and-answer device, cause the medical question-and-answer device to perform the following steps: Obtain medical query information input by the user; The medical query information is input into a pre-trained medical question-answering model to obtain the target answer information. The medical question-answering model is trained based on a medical knowledge graph, which is used to assist the medical question-answering model in determining the target reasoning path corresponding to the medical query information in the medical knowledge graph, so that the medical question-answering model can determine the target answer information corresponding to the medical query information based on the target reasoning path.

[0135] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0136] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0137] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0138] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described medical question-and-answer method, which can solve the technical problem of model illusion in scenarios such as medical question-and-answer. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the medical question-and-answer method provided in the above embodiments, and will not be repeated here.

[0139] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the medical question-and-answer method described above.

[0140] The computer program product provided in this application can solve the technical problem of model illusion in scenarios such as medical question answering. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the medical question answering method provided in the above embodiments, and will not be repeated here.

[0141] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

[0142] This application discloses A1, a medical question-answering method, the method comprising: Obtain medical query information input by the user; The medical query information is input into a pre-trained medical question-answering model to obtain the target answer information. The medical question-answering model is trained based on a medical knowledge graph, which is used to assist the medical question-answering model in determining the target reasoning path corresponding to the medical query information in the medical knowledge graph, so that the medical question-answering model can determine the target answer information corresponding to the medical query information based on the target reasoning path.

[0143] A2. As described in A1, the step of inputting the medical query information into a pre-trained medical question-answering model to obtain the target answer information includes: The medical query information is input into a pre-trained medical question-answering model, which then performs the following steps: Based on the medical query information, the corresponding first reasoning path is determined; If the first reasoning path contains information that is not available in the medical question-answering model, a second reasoning path is determined based on the medical knowledge graph and the first reasoning path. Based on the second reasoning path, the target answer information is obtained.

[0144] A3. The method described in A2, further comprising: Through multiple rounds of reflection, the knowledge boundary information between the medical question-answering model and the medical knowledge graph is determined; wherein, the knowledge boundary information is used to characterize the first information that is included in the medical knowledge graph but not included in the medical question-answering model; The step of determining the second inference path based on the medical knowledge graph and the first inference path includes: Based on the first information that is included in the medical knowledge graph but not in the medical question-answering model, the number of queries of the first reasoning path in the medical knowledge graph is determined. Based on the number of queries, query the second information required in the first reasoning path in the medical knowledge graph; Based on the first reasoning path, the third information in the medical question-answering model, and the second information, a second reasoning path is determined.

[0145] A4. As described in A3, querying the second information required in the first reasoning path within the medical knowledge graph includes: In the medical knowledge graph, the currently accessed target corresponding to the input information of the first reasoning path is determined; Starting from the currently accessed target, determine the number of targets to be accessed in the medical knowledge graph corresponding to the currently accessed target; If the number of targets to be accessed is greater than 1, target expectation values ​​are determined for each of the targets to be accessed; wherein the target expectation value is related to the immediate reward value and the estimated future reward value, and the target expectation value is related to the input information of the first inference path; Based on the target expectation value, a target to be accessed is determined from a plurality of targets to be accessed and accessed accordingly. Take the target to be accessed as the current target being accessed, and return to the step of determining the number of targets to be accessed corresponding to the current target being accessed in the medical knowledge graph, starting from the current target being accessed, until the number of targets to be accessed corresponding to the current target being accessed is 0. Based on all the targets visited during the traversal, determine the information required in the first inference path.

[0146] A5. As described in A4, the step of determining the currently accessed target corresponding to the input information of the first inference path in the medical knowledge graph includes: Based on the semantic information of the medical query information, entity nodes or relation edges that match the semantic information are determined from the medical knowledge graph and used as the current accessed target corresponding to the input information of the first reasoning path.

[0147] A6. The method as described in A4, wherein determining the target to be accessed from a plurality of targets to be accessed based on the target expectation value includes: At least one target to be visited is determined from the plurality of targets to be visited in descending order of the expected target values.

[0148] A7. The method described in any one of A1 to A6, the method further comprising: Based on pre-constructed candidate question texts, multiple target question texts are constructed using various semantic representations; wherein, the candidate question texts are related to medical knowledge; The multiple target question texts are input into a pre-trained teacher model, which predicts the corresponding answer texts based on the multiple target question texts and outputs the thought process information and answer texts during the prediction process. The target question text, the thought process information during the prediction process, and the answer text are used as a set of candidate question-answer pairs. From the multiple sets of candidate question-answer pairs corresponding to the multiple target question texts, select the target question-answer pairs that meet the preset conditions; Based on the target question-answer pair, the medical knowledge graph is constructed.

[0149] A8. As described in A7, the step of constructing multiple target question texts based on pre-constructed candidate question texts using various semantic representations includes: The candidate question text is input into the teacher model, and the teacher model performs the following steps if it determines that the candidate question text is relevant to a preschool or pediatric medical scenario: Extract multiple knowledge entities from the candidate question text; Based on the aforementioned knowledge entities, multiple target question texts are constructed.

[0150] A9. As described in A7, the step of constructing the medical knowledge graph based on the target question-answer pair includes: Cluster the semantically similar questions and answers in the multiple target question-answer pairs to obtain clustered questions and clustered answers; The clustered questions and answers are input into a pre-trained extraction model, which then extracts multiple knowledge triples from the clustered questions and answers. Determine the labels corresponding to the multiple knowledge triples respectively; The medical knowledge graph is constructed based on the multiple knowledge triples and their corresponding tags.

[0151] A10. The method described in any one of A1 to A6, wherein before inputting the medical query information into the pre-trained medical question-answering model, the method further includes: Obtain pre-trained candidate question-answering models; The parameter update formula is determined using the value function estimation method; wherein the parameter update formula is related to the target expected value of the model in multiple inference paths in the medical knowledge graph, and the target expected value is equal to the sum of the immediate reward value and the estimated future reward value; Based on the parameter update formula, the parameters in the candidate question-answering model are updated to obtain the updated candidate question-answering model as the medical question-answering model.

[0152] A11. The method described in A10, before determining the parameter update formula using the value function estimation method, further includes: The expected value of the target is determined based on the sum of the actual scores of all accessed targets in the reasoning path under the candidate access strategy in the medical knowledge graph. or, The expected value of the target is determined based on the actual score of the currently accessed target in the inference path, the future benefit decay factor, and the predicted score of the target to be accessed under the candidate access strategy in the inference path in the medical knowledge graph.

[0153] This application also discloses B1, a medical question-and-answer device, the device comprising: The acquisition module is used to acquire medical query information input by the user; The question-answering module is used to input the medical query information into a pre-trained medical question-answering model to obtain the target answer information. The medical question-answering model is trained based on a medical knowledge graph, which is used to assist the medical question-answering model in determining the target reasoning path corresponding to the medical query information in the medical knowledge graph, so that the medical question-answering model can determine the target answer information corresponding to the medical query information based on the target reasoning path.

[0154] B2. The apparatus as described in B1, wherein the question-answering module is specifically used for: The medical query information is input into a pre-trained medical question-answering model, which then performs the following steps: Based on the medical query information, the corresponding first reasoning path is determined; If the first reasoning path contains information that is not available in the medical question-answering model, a second reasoning path is determined based on the medical knowledge graph and the first reasoning path. Based on the second reasoning path, the target answer information is obtained.

[0155] B3. The apparatus as described in B2, further comprising: The determination module is used to: determine the knowledge boundary information between the medical question-answering model and the medical knowledge graph through a multi-round reflection process; wherein, the knowledge boundary information is used to characterize first information that is included in the medical knowledge graph but not included in the medical question-answering model; The question-and-answer module is also specifically used for: Based on the first information that is included in the medical knowledge graph but not in the medical question-answering model, the number of queries of the first reasoning path in the medical knowledge graph is determined. Based on the number of queries, query the second information required in the first reasoning path in the medical knowledge graph; Based on the first reasoning path, the third information in the medical question-answering model, and the second information, a second reasoning path is determined.

[0156] B4. The apparatus as described in B3, wherein the question-answering module is further specifically used for: In the medical knowledge graph, the currently accessed target corresponding to the input information of the first reasoning path is determined; Starting from the currently accessed target, determine the number of targets to be accessed in the medical knowledge graph corresponding to the currently accessed target; If the number of targets to be accessed is greater than 1, target expectation values ​​are determined for each of the targets to be accessed; wherein the target expectation value is related to the immediate reward value and the estimated future reward value, and the target expectation value is related to the input information of the first inference path; Based on the target expectation value, a target to be accessed is determined from a plurality of targets to be accessed and accessed accordingly. Take the target to be accessed as the current target being accessed, and return to the step of determining the number of targets to be accessed corresponding to the current target being accessed in the medical knowledge graph, starting from the current target being accessed, until the number of targets to be accessed corresponding to the current target being accessed is 0. Based on all the targets visited during the traversal, determine the information required in the first inference path.

[0157] B5. The device as described in B4, wherein the question-answering module is further specifically used to: determine, based on the semantic information of the medical query information, an entity node or relation edge that matches the semantic information from the medical knowledge graph, and use it as the currently accessed target corresponding to the input information of the first reasoning path.

[0158] B6. The apparatus as described in B4, wherein the question-answering module is further specifically used to: determine at least one target to be accessed from among the plurality of targets to be accessed in descending order of the target expectation value.

[0159] B7. The apparatus as described in any one of B1 to B6, the apparatus further comprising a construction module for: Based on pre-constructed candidate question texts, multiple target question texts are constructed using various semantic representations; wherein, the candidate question texts are related to medical knowledge; The multiple target question texts are input into a pre-trained teacher model, which predicts the corresponding answer texts based on the multiple target question texts and outputs the thought process information and answer texts during the prediction process. The target question text, the thought process information during the prediction process, and the answer text are used as a set of candidate question-answer pairs. From the multiple sets of candidate question-answer pairs corresponding to the multiple target question texts, select the target question-answer pairs that meet the preset conditions; Based on the target question-answer pair, the medical knowledge graph is constructed.

[0160] B8. The apparatus as described in B7, wherein the construction module is specifically used for: The candidate question text is input into the teacher model, and the teacher model performs the following steps if it determines that the candidate question text is relevant to a preschool or pediatric medical scenario: Extract multiple knowledge entities from the candidate question text; Based on the aforementioned knowledge entities, multiple target question texts are constructed.

[0161] B9. The apparatus as described in B7, wherein the construction module is further specifically used for: Cluster the semantically similar questions and answers in the multiple target question-answer pairs to obtain clustered questions and clustered answers; The clustered questions and answers are input into a pre-trained extraction model, which then extracts multiple knowledge triples from the clustered questions and answers. Determine the labels corresponding to the multiple knowledge triples respectively; The medical knowledge graph is constructed based on the multiple knowledge triples and their corresponding tags.

[0162] B10. The apparatus as described in any one of B1 to B6, the apparatus further comprising a processing module for: Obtain pre-trained candidate question-answering models; The parameter update formula is determined using the value function estimation method; wherein the parameter update formula is related to the target expected value of the model in multiple inference paths in the medical knowledge graph, and the target expected value is equal to the sum of the immediate reward value and the estimated future reward value; Based on the parameter update formula, the parameters in the candidate question-answering model are updated to obtain the updated candidate question-answering model as the medical question-answering model.

[0163] B11. The apparatus as described in B10, wherein the processing module is further configured to: The expected value of the target is determined based on the sum of the actual scores of all accessed targets in the reasoning path under the candidate access strategy in the medical knowledge graph. or, The expected value of the target is determined based on the actual score of the currently accessed target in the inference path, the future benefit decay factor, and the predicted score of the target to be accessed under the candidate access strategy in the inference path in the medical knowledge graph.

[0164] This application also discloses C1, wherein the device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the medical question-and-answer method as described in any one of A1 to A11.

[0165] This application also discloses D1, a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and which, when executed by a processor, implements the steps of the medical question-and-answer method as described in any one of A1 to A11.

[0166] This application also discloses E1, a computer program product comprising a computer program that, when executed by a processor, implements the steps of the medical question-and-answer method as described in any one of A1 to A11.< / think>

Claims

1. A medical question-and-answer method, characterized in that, The method includes: Obtain medical query information input by the user; The medical query information is input into a pre-trained medical question-answering model, which then performs the following steps: Based on the medical query information, the corresponding first reasoning path is determined; If the first reasoning path contains information that is not available in the medical question-answering model, a second reasoning path is determined based on the medical knowledge graph and the first reasoning path. Based on the second reasoning path, the target answer information is obtained; wherein, the medical question answering model is trained based on a medical knowledge graph, and the medical knowledge graph is used to assist the medical question answering model in determining the target reasoning path corresponding to the medical query information in the medical knowledge graph, so that the medical question answering model can determine the target answer information corresponding to the medical query information based on the target reasoning path.

2. The method as described in claim 1, characterized in that, The method further includes: Through multiple rounds of reflection, the knowledge boundary information between the medical question-answering model and the medical knowledge graph is determined; wherein, the knowledge boundary information is used to characterize the first information that is included in the medical knowledge graph but not included in the medical question-answering model; The step of determining the second inference path based on the medical knowledge graph and the first inference path includes: Based on the first information that is included in the medical knowledge graph but not in the medical question-answering model, the number of queries of the first reasoning path in the medical knowledge graph is determined. Based on the number of queries, query the second information required in the first reasoning path in the medical knowledge graph; Based on the first reasoning path, the third information in the medical question-answering model, and the second information, a second reasoning path is determined.

3. The method as described in claim 2, characterized in that, The step of querying the second information required in the first reasoning path in the medical knowledge graph includes: In the medical knowledge graph, the currently accessed target corresponding to the input information of the first reasoning path is determined; Starting from the currently accessed target, determine the number of targets to be accessed in the medical knowledge graph corresponding to the currently accessed target; If the number of targets to be accessed is greater than 1, target expectation values ​​are determined for each of the targets to be accessed; wherein the target expectation value is related to the immediate reward value and the estimated future reward value, and the target expectation value is related to the input information of the first inference path; Based on the target expectation value, a target to be accessed is determined from a plurality of targets to be accessed and accessed accordingly. Take the target to be accessed as the current target being accessed, and return to the step of determining the number of targets to be accessed corresponding to the current target being accessed in the medical knowledge graph, starting from the current target being accessed, until the number of targets to be accessed corresponding to the current target being accessed is 0. Based on all the targets visited during the traversal, determine the information required in the first inference path.

4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Based on pre-constructed candidate question texts, multiple target question texts are constructed using various semantic representations; wherein, the candidate question texts are related to medical knowledge; The multiple target question texts are input into a pre-trained teacher model, which predicts the corresponding answer texts based on the multiple target question texts and outputs the thought process information and answer texts during the prediction process. The target question text, the thought process information during the prediction process, and the answer text are used as a set of candidate question-answer pairs. From the multiple sets of candidate question-answer pairs corresponding to the multiple target question texts, select the target question-answer pairs that meet the preset conditions; Based on the target question-answer pair, the medical knowledge graph is constructed.

5. The method according to any one of claims 1 to 3, characterized in that, Before inputting the medical query information into the pre-trained medical question-answering model, the method further includes: Obtain pre-trained candidate question-answering models; The parameter update formula is determined using the value function estimation method; wherein the parameter update formula is related to the target expected value of the model in multiple inference paths in the medical knowledge graph, and the target expected value is equal to the sum of the immediate reward value and the estimated future reward value; Based on the parameter update formula, the parameters in the candidate question-answering model are updated to obtain the updated candidate question-answering model as the medical question-answering model.

6. A medical question-and-answer device, characterized in that, The device includes: The acquisition module is used to acquire medical query information input by the user; The question-answering module is used to input the medical query information into a pre-trained medical question-answering model, which then performs the following steps: determining a first inference path based on the medical query information; if the first inference path contains information not available in the medical question-answering model, determining a second inference path based on a medical knowledge graph and the first inference path; and obtaining the target answer information based on the second inference path. The medical question-answering model is trained based on a medical knowledge graph, which assists the model in determining the target inference path corresponding to the medical query information, so that the model can determine the target answer information based on the target inference path.

7. A medical question-and-answer device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the medical question-and-answer method as described in any one of claims 1 to 5.

8. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the medical question-and-answer method as described in any one of claims 1 to 5.

9. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the medical question-and-answer method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

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

    CN119691118A

  • Method for creating and correcting large model fine tuning data set

    CN121168577A