Method and device for generating medical rule base

By fine-tuning the basic large model of the intelligent dialogue system and generating a medical rule library, the problem of insufficient accuracy and adaptability of the intelligent dialogue system in medical consultation is solved, and higher response accuracy and adaptability are achieved.

CN118132735BActive Publication Date: 2024-09-24ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410558079.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-07
Publication Date
2024-09-24
Estimated Expiration
2044-05-07

AI Technical Summary

Technical Problem

In the field of medical consultation, intelligent dialogue systems rely on static corpus, resulting in low accuracy and insufficient adaptability when answering complex or specific medical questions.

Method used

By obtaining the annotated medical rules, the basic large model is fine-tuned to generate a large medical rule reasoning model, and the model is used to generate medical inquiry results and build a medical rule library to assist the reasoning of the large medical service model of the intelligent dialogue system.

Benefits of technology

It improves the response accuracy and adaptability of the intelligent dialogue system in medical inquiry scenarios, expands the data scale of medical rules and inquiry results, and enhances the applicable scope of the rule base.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118132735B
    Figure CN118132735B
Patent Text Reader

Abstract

One or more embodiments of the present application provide a method and device for generating a medical rule library, the method comprising: obtaining a first type of medical rules that are labeled with corresponding medical inquiry results, and having a basic big model perform inference based on the first type of medical rules to generate medical inquiry results corresponding to the first type of medical rules; determining the loss based on the generated medical inquiry results and the labeled medical inquiry results, and adjusting the model parameters of the basic big model based on the loss to complete fine-tuning training for the basic big model; obtaining unlabeled second type of medical rules, and having the fine-tuned medical rule inference big model perform inference based on the second type of medical rules to generate medical inquiry results corresponding to the second type of medical rules; based on the first type of medical rules, the second type of medical rules, and the corresponding medical inquiry results, generating a medical rule library for assisting the medical service big model in the intelligent dialogue system to perform inference related to medical inquiry scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present application relate to the field of artificial intelligence technology, and in particular, to a method and device for generating a medical rule base. Background Art

[0002] Nowadays, intelligent dialogue systems are widely used in many fields such as customer service, legal aid, online education, medical consultation, etc. Taking the rapidly developing field of medical consultation as an example, intelligent dialogue systems have become a key tool for improving the quality and efficiency of medical services. Intelligent dialogue systems provide consulting services to patients by simulating human communication methods, including disease diagnosis, treatment recommendations, and drug instructions.

[0003] An intelligent dialogue system is an interactive system developed using artificial intelligence technology. It is designed to understand and answer questions raised by users in natural language and generate concise and clear answers. Intelligent dialogue systems are usually based on large language models (LLMs), which understand and answer questions raised by users and generate corresponding answers. Intelligent dialogue systems in the field of medical consultation mainly rely on the knowledge acquired by the large language model during the training process by learning static medical-related corpora. Due to the limitations of this knowledge, the system may appear to be inaccurate and unreliable when answering complex or specific medical questions. In other words, this reliance on static corpora limits the adaptability and response accuracy of intelligent dialogue systems. Summary of the invention

[0004] One or more embodiments of the present application provide the following technical solutions:

[0005] The present application provides a method for generating a medical rule base, the method comprising:

[0006] Acquire a first type of medical rule annotated with a corresponding medical inquiry result, and input the first type of medical rule into a basic large model, so that the basic large model performs reasoning based on the first type of medical rule to generate a medical inquiry result corresponding to the first type of medical rule;

[0007] Determine the loss based on the generated medical inquiry results and the annotated medical inquiry results, and adjust the model parameters of the first basic large model based on the loss to complete the fine-tuning training for the basic large model to obtain the medical rule reasoning large model;

[0008] Acquire unlabeled second-category medical rules, and input the second-category medical rules into the medical rule reasoning big model, so that the medical rule reasoning big model performs reasoning based on the second-category medical rules to generate a medical inquiry result corresponding to the second-category medical rules;

[0009] Based on the first category of medical rules and their corresponding medical inquiry results, as well as the second category of medical rules and their corresponding medical inquiry results, a medical rule library is generated; wherein the medical rule library is used to assist the medical service big model in the intelligent dialogue system to perform reasoning related to the medical inquiry scenario.

[0010] The present application also provides a device for generating a medical rule library, the device comprising:

[0011] a first acquisition module, which acquires a first type of medical rule annotated with a corresponding medical inquiry result, and inputs the first type of medical rule into a basic large model, and the basic large model performs reasoning based on the first type of medical rule to generate a medical inquiry result corresponding to the first type of medical rule;

[0012] A fine-tuning module, which determines a loss based on the generated medical inquiry results and the annotated medical inquiry results, and adjusts the model parameters of the basic large model based on the loss to complete fine-tuning training for the basic large model to obtain a medical rule reasoning large model;

[0013] A second acquisition module acquires unlabeled second-category medical rules, and inputs the second-category medical rules into the medical rule reasoning model, so that the medical rule reasoning model performs reasoning based on the second-category medical rules to generate a medical inquiry result corresponding to the second-category medical rules;

[0014] A generation module generates a medical rule library based on the first category of medical rules and their corresponding medical inquiry results, as well as the second category of medical rules and their corresponding medical inquiry results; wherein the medical rule library is used to assist the large language model in the intelligent dialogue system to perform reasoning related to the medical inquiry scenario.

[0015] The present application also provides an electronic device, comprising:

[0016] processor;

[0017] a memory for storing processor-executable instructions;

[0018] The processor implements the steps of any of the above methods by running the executable instructions.

[0019] The present application also provides a computer-readable storage medium having computer instructions stored thereon, which implement the steps of any of the above methods when executed by a processor.

[0020] In the above technical scheme, firstly, the first type of medical rules marked with corresponding medical inquiry results can be obtained, and the pre-trained basic big model can be fine-tuned based on the first type of medical rules marked with corresponding medical inquiry results to obtain the medical rule reasoning big model, and then the unlabeled second type of medical rules can be obtained, and the second type of medical rules can be input into the medical rule reasoning big model, and the medical rule reasoning big model can perform reasoning based on the second type of medical rules to generate medical inquiry results corresponding to the second type of medical rules. Finally, based on the first type of medical rules and their corresponding medical inquiry results, as well as the second type of medical rules and their corresponding medical inquiry results, a medical rule library can be generated that can be used to assist the medical service big model in the intelligent dialogue system to perform reasoning related to medical inquiry scenarios.

[0021] By adopting the above method, a medical rule library can be constructed to assist the medical service big model in the intelligent dialogue system to perform reasoning related to the medical inquiry scenario, so that when the intelligent dialogue system is running, it can no longer rely solely on the knowledge obtained by the medical service big model in the training process by learning static corpus, but can also be combined with the knowledge retrieved in the constructed medical rule library, thereby improving the adaptability and response accuracy of the intelligent dialogue system. In addition, in the process of constructing the medical rule library, the pre-trained basic big model can be fine-tuned using the medical rules that are annotated with the corresponding medical inquiry results to obtain a fine-tuned medical rule reasoning big model, and then the medical rule reasoning big model is used to generate corresponding medical inquiry results for the unannotated medical rules. In this way, the data scale of the medical rules used to construct the medical rule library and their corresponding medical inquiry results can be expanded to ensure the scope of application of the constructed medical rules. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The following is a description of the accompanying drawings required for describing the exemplary embodiments, wherein:

[0023] Figure 1 It is a schematic diagram of an intelligent dialogue system shown in an exemplary embodiment of the present application.

[0024] Figure 2 It is a schematic diagram of a generation process of a medical rule library shown in an exemplary embodiment of the present application.

[0025] Figure 3 It is a flowchart of a method for generating a medical rule base shown in an exemplary embodiment of the present application.

[0026] Figure 4 It is a schematic diagram of a question-answering process based on a large language model shown in an exemplary embodiment of the present application.

[0027] Figure 5 It is a flowchart of a question-answering method based on a large language model shown as an exemplary embodiment of the present application.

[0028] Figure 6 It is a structural schematic diagram of a device shown in an exemplary embodiment of the present application.

[0029] Figure 7 It is a block diagram of a device for generating a medical rule library shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0030] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description relates to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of the present application. On the contrary, they are only examples consistent with some aspects of one or more embodiments of the present application.

[0031] It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this application. In some other embodiments, the steps included in the method may be more or less than those described in this application. In addition, a single step described in this application may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this application may also be combined into a single step for description in other embodiments.

[0032] In the field of medical consultation, intelligent dialogue systems have become a key tool for improving the quality and efficiency of medical services. Intelligent dialogue systems provide consulting services to patients by simulating human communication methods, including disease diagnosis, treatment recommendations, and drug instructions.

[0033] An intelligent dialogue system is an interactive system developed using artificial intelligence technology. It is designed to understand and answer questions raised by users in natural language and generate concise and clear answers. Intelligent dialogue systems are usually based on large language models (LLMs), which understand and answer questions raised by users and generate corresponding answers.

[0034] A large language model is a deep learning model trained with a large amount of text data, which can be used to generate natural language text or understand the meaning of natural language text. A large language model can handle a variety of natural language tasks, such as text classification, named entity recognition, question answering, dialogue, etc., and is an important path to artificial intelligence.

[0035] In the field of natural language processing, large-scale text data sets are usually referred to as corpuses. Corpuses can contain various types of text data, such as literary works, academic papers, legal documents, news reports, daily conversations, emails, online forum posts, etc. By learning the text data in the corpus, large language models can obtain and understand the laws and patterns of natural language, thereby achieving effective processing and generation of human language.

[0036] Large language models usually use the Transformer architecture, that is, large language models are usually deep learning models based on the Transformer architecture. Deep learning models based on the Transformer architecture are a type of neural network model that uses the Transformer architecture. This model performs well in fields such as natural language processing.

[0037] Transformer is a neural network model used for sequence-to-sequence modeling. Transformer does not need to rely on recursive structures, can parallelize training and reasoning, and speed up model processing. In deep learning models based on the Transformer architecture, a multi-layer Transformer encoder is usually used to extract features from the input sequence, and a Transformer decoder is used to convert the extracted features into an output sequence. At the same time, such models usually also use a self-attention mechanism to capture long-distance dependencies in the input sequence, and use residual connections and regularization methods to accelerate training and improve model performance.

[0038] A pre-trained model is a large language model that is pre-trained on large-scale unlabeled text data. A pre-trained model is a general model that is not designed and optimized for a specific task. In order to adapt the pre-trained model to specific application scenarios and task requirements, fine-tuning is required to improve the performance of the model on specific tasks. The large language model that is finally put into use is usually a model that is further fine-tuned on the basis of the pre-trained model and is a supervised learning model based on labeled text data. Pre-training and fine-tuning are complementary processes. Pre-training enables the model to have a wide range of language understanding capabilities, while fine-tuning makes the model more professional and accurate in specific tasks.

[0039] That is, the training process of a large language model can be divided into two stages: pre-training and fine-tuning. In the pre-training stage, unsupervised learning (e.g., self-supervised learning) can be used to perform pre-training on large-scale, unlabeled text data sets (e.g., online encyclopedias, online articles, books, etc.). Specifically, the missing part or the next word can be predicted based on the context, and statistical laws and language structures such as semantics and syntax can be learned. The prediction loss can be minimized through back-propagation and optimization algorithms (e.g., gradient descent), and model parameters can be iteratively updated to gradually improve the model's ability to understand language. In the fine-tuning stage, you can select corresponding supervised learning tasks (for example, text classification, named entity recognition, question-answering system, etc.) according to the specific application scenarios and task requirements, and prepare task-specific text datasets, so that you can use the pre-trained model as the starting point for fine-tuning, and use supervised learning to perform fine-tuning training on the task-specific text dataset. Specifically, you can perform the task based on the text dataset, and minimize the loss used to measure the performance of the model in processing specific tasks through back propagation and optimization algorithms (for example, gradient descent method), iteratively update the model parameters, and gradually improve the performance of the model on specific tasks.

[0040] It should be noted that the pre-trained large language model is usually called the base model of the large language model, and the fine-tuned large language model is called the service model of the large language. The language understanding ability learned by the large language model in the pre-training and fine-tuning stages enables the large language model to understand, analyze and integrate text information, perform logical inference, knowledge reasoning or problem solving when faced with complex problems or tasks. This ability is usually called the reasoning ability of the large language model.

[0041] Large language models usually perform specific tasks under the guidance of prompt text (which can be called prompt). Prompt text is an initial text or text fragment provided to the large language model, which is intended to stimulate the model to produce corresponding output. Through the prompt text, you can clearly tell the large language model what task you expect it to perform, such as: answering a question, simulating a conversation, writing an article, translating text, etc. At the same time, the prompt text can provide the large language model with the necessary background information and context, so that the large language model can understand the logic, style, theme or position that should be followed when generating content. In addition, the prompt text can also stimulate the large language model to show its inherent knowledge reserves or specific language capabilities, such as: explaining complex concepts, citing regulations, imitating the writing style of a specific writer, etc.

[0042] Intelligent dialogue systems in the field of medical consultation mainly rely on the knowledge acquired by the large language model during the training process by learning static medical-related corpus. Due to the limitations of this knowledge, the system may appear to be inaccurate and unreliable when answering complex or specific medical questions, that is, hallucination problems may occur. The hallucination problem refers to the fact that the content generated by the large language model looks very reasonable and coherent, and sometimes even imitates human emotions and thinking patterns, creating an illusion of "understanding" the input content, but in fact, this content is inaccurate or misleading. In other words, this reliance on static corpus limits the adaptability and response accuracy of the intelligent dialogue system.

[0043] In order to reduce the hallucinations of the large language model in the intelligent dialogue system and improve the adaptability and response accuracy of the intelligent dialogue system, large-scale external text data can be combined with the large language model. During the prediction or generation process of the large language model, relevant information can be retrieved from these external resources in real time to assist the model in making more accurate and comprehensive answers or decisions.

[0044] The present application provides a technical solution for realizing the generation of a medical rule library. In the technical solution, first, a first type of medical rules with corresponding medical inquiry results marked can be obtained, and the pre-trained basic large model can be fine-tuned based on the first type of medical rules with corresponding medical inquiry results marked to obtain a medical rule reasoning large model. Then, an unlabeled second type of medical rules can be obtained, and the second type of medical rules can be input into the medical rule reasoning large model. The medical rule reasoning large model performs reasoning based on the second type of medical rules to generate medical inquiry results corresponding to the second type of medical rules. Finally, based on the first type of medical rules and their corresponding medical inquiry results, as well as the second type of medical rules and their corresponding medical inquiry results, a medical rule library can be generated that can be used to assist the medical service large model in the intelligent dialogue system to perform reasoning related to medical inquiry scenarios.

[0045] By adopting the above method, a medical rule library can be constructed to assist the medical service big model in the intelligent dialogue system to perform reasoning related to the medical inquiry scenario, so that when the intelligent dialogue system is running, it can no longer rely solely on the knowledge obtained by the medical service big model in the training process by learning static corpus, but can also be combined with the knowledge retrieved in the constructed medical rule library, thereby improving the adaptability and response accuracy of the intelligent dialogue system. In addition, in the process of constructing the medical rule library, the pre-trained basic big model can be fine-tuned using the medical rules that are annotated with the corresponding medical inquiry results to obtain a fine-tuned medical rule reasoning big model, and then the medical rule reasoning big model is used to generate corresponding medical inquiry results for the unannotated medical rules. In this way, the data scale of the medical rules used to construct the medical rule library and their corresponding medical inquiry results can be expanded to ensure the scope of application of the constructed medical rules.

[0046] Please refer to Figure 1 , Figure 1 It is a schematic diagram of an intelligent dialogue system shown in an exemplary embodiment of the present application.

[0047] like Figure 1 As shown, the above intelligent dialogue system may include a server and at least one client accessing the server through any type of wired or wireless network.

[0048] Among them, the above-mentioned server can correspond to a server including an independent physical host, or it can be a server cluster composed of multiple independent physical hosts; or it can correspond to a virtual server, cloud server, etc. carried by a host cluster.

[0049] The above-mentioned client may correspond to terminal devices such as smart phones, tablet computers, laptops, desktop computers, PCs (Personal Computers), PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.), smart car devices or game consoles.

[0050] The user can use the intelligent question-and-answer service provided by the intelligent dialogue system through the client; the client and the server can implement the user-oriented intelligent question-and-answer service through data interaction between each other.

[0051] For example, the client can output a corresponding user interface to the user, so that the user can ask questions to the intelligent dialogue system by performing operations such as inputting query text and uploading documents or pictures for auxiliary query in the user interface, and use the intelligent question and answer service provided by the intelligent dialogue system. The client can send the query text input by the user to the server, and the server generates a corresponding answer text (which can be called Answer) for the query text and outputs the answer text to the user, that is, returns the answer text to the client, and the client displays the answer text to the user through the user interface, so that the user can view the corresponding answer generated by the intelligent dialogue system, thereby realizing a user-oriented intelligent question and answer service.

[0052] Specifically, the server may be equipped with a service model of a large language model, and the intelligent dialogue system may be based on the service model of the large language model, wherein the service model of the large language model understands and answers the query text input by the user and generates an answer text corresponding to the query text.

[0053] In addition, the above-mentioned server can also be equipped with other functional components or functional subsystems, such as: feature extraction component, knowledge base retrieval component, prompt text (which can be called prompt) generation component, etc. These components or subsystems can work together with the service model of the large language model installed on the server to jointly generate the answer text corresponding to the query text input by the user.

[0054] Please combine Figure 1 ,refer to Figure 2 , Figure 2 It is a schematic diagram of a generation process of a medical rule library shown in an exemplary embodiment of the present application.

[0055] In this embodiment, for the intelligent dialogue system in the field of medical consultation, the query text input by the user can be a medical inquiry text related to the medical inquiry scenario, and the answer text corresponding to the query text can be the medical inquiry result. Among them, the medical inquiry scenario can include a variety of medical-related inquiry scenarios such as disease diagnosis, treatment recommendations, and drug instructions; the query text can be a text written by the user to describe the medical problem that needs to be answered (for example: "Is a high high-density lipoprotein cholesterol index abnormal?", "What does a high platelet index mean?", etc.), or it can be a text contained in a medical report uploaded by the user that needs to be interpreted (for example: physical examination report, blood test report, urine test report, radiology examination report, etc.), etc.

[0056] In order to reduce the hallucinations of the large language model in the intelligent dialogue system and improve the adaptability and response accuracy of the intelligent dialogue system in the field of medical consultation, a medical rule library can be constructed to assist the medical service large model in the intelligent dialogue system in performing reasoning related to medical inquiry scenarios.

[0057] Specifically, first, medical rules marked with corresponding medical inquiry results can be obtained, and the medical rules can be input into the basic model of the pre-trained large language model (which can be called the basic large model). The basic large model performs inference based on the medical rules to generate medical inquiry results corresponding to the medical rules.

[0058] Then, the loss can be determined based on the medical query results generated by the above-mentioned basic big model for the above-mentioned medical rules, and the medical query results annotated with the medical rules, and the model parameters of the basic big model can be adjusted based on the loss to complete the fine-tuning training for the basic big model and obtain the service model of the above-mentioned large language model (which can be called the medical rule reasoning big model).

[0059] Then, the unlabeled medical rules can be obtained and input into the fine-tuned medical rule reasoning model, which then generates a medical query result corresponding to the medical rule by reasoning based on the medical rule. In this way, the data scale of the medical rules and their corresponding medical query results is expanded.

[0060] Finally, a medical rule base can be generated based on all the above medical rules and their corresponding medical inquiry results. At this time, the generated medical rule base can be used as an external text data set corresponding to the large language model to assist the large language model in reasoning related to the medical inquiry scenario.

[0061] The following Figure 2 The generation process of the medical rule base shown is described in detail.

[0062] Please refer to Figure 3 , Figure 3 It is a flowchart of a method for generating a medical rule base shown in an exemplary embodiment of the present application.

[0063] like Figure 3 As shown, the method for generating the medical rule base may include the following steps:

[0064] Step 302: Obtain a first type of medical rule that is labeled with a corresponding medical inquiry result, and input the first type of medical rule into a pre-trained basic large model, and the basic large model performs reasoning based on the first type of medical rule to generate a medical inquiry result corresponding to the first type of medical rule.

[0065] Step 304: Determine the loss based on the generated medical inquiry results and the annotated medical inquiry results, and adjust the model parameters of the basic big model based on the loss to complete the fine-tuning training for the basic big model and obtain the medical rule reasoning big model.

[0066] In this embodiment, medical rules (which may be referred to as first-category medical rules) that are marked with corresponding medical inquiry results may be first obtained, and the first-category medical rules may be input into the basic model of the pre-trained large language model (which may be referred to as the basic large model). The basic large model may perform inference based on the first-category medical rules to generate medical inquiry results corresponding to the first-category medical rules.

[0067] Then, the loss can be determined based on the medical query results generated by the above-mentioned basic big model for the above-mentioned medical rules, and the medical query results annotated with the medical rules. For example, the loss is determined according to the similarity between the generated medical query results and the annotated medical query results, and the model parameters of the basic big model are adjusted based on the loss to complete the fine-tuning training for the basic big model and obtain the service model of the above-mentioned big language model (which can be called the medical rule reasoning big model).

[0068] In some embodiments, the medical rules may include non-logical rules related to the medical inquiry scenario and logical rules related to the medical inquiry scenario.

[0069] The non-logical rules related to the medical inquiry scenario may include the medical definition of a disease and / or the clinical symptoms of a disease, etc. These non-logical rules may be extracted from common knowledge such as a medical knowledge base, medical textbooks, and medical papers.

[0070] The above logic rules related to the medical inquiry scenario may include the disease diagnosis and treatment logic extracted from medical clinical information. Among them, medical clinical information may include clinical case information, doctor's clinical experience (for example: the conversation between the doctor and the patient during the ward round), etc. This information implies the following disease diagnosis and treatment logic: there is a certain symptom or a certain test result → may have a certain disease → need to do some further examination to confirm.

[0071] In actual applications, the above medical inquiry results may include the diagnosed condition, recommended treatment, instructions for the medications to be used, etc.

[0072] It should be noted that large language models involve two logical reasoning methods, namely deductive reasoning and inductive reasoning. Large language models usually use these two reasoning methods at the same time. Deductive reasoning relies on the logical structure and known rules within the model, while inductive reasoning relies on patterns and laws learned from large amounts of data. The combination of the two enables large language models to understand and generate natural language text more accurately.

[0073] Deductive reasoning is a process of reasoning from general to specific. It is based on a set of known premises or rules and draws specific conclusions through logical deduction. In large language models, deductive reasoning can be reflected in the model analyzing and interpreting the input text according to the rules and patterns learned from its training data to generate logical output. For example, if the model knows the universal fact that "all cats can meow" and is given the information that "Xiao Ming's pet is a cat", then through deductive reasoning, the model can come to the conclusion that "Xiao Ming's pet can meow".

[0074] Inductive reasoning is a process of reasoning from the specific to the general. It summarizes general rules or conclusions by observing specific instances or cases. During the training process, large language models analyze a large amount of text data to summarize the universal characteristics and patterns of language. This process of learning from data and forming general knowledge is the embodiment of inductive reasoning. For example, the model may never explicitly learn the rule that "apples and bananas are both fruits", but by observing that many texts classify apples and bananas as fruits, it can summarize this general rule.

[0075] For the above non-logical rules related to medical inquiry scenarios, these medical rules are general medical rules, so the large language model can perform deductive reasoning based on these medical rules. For the above logical rules related to medical inquiry scenarios, these medical rules are special medical rules, so the large language model can perform inductive reasoning based on these medical rules.

[0076] Step 306: Obtain unlabeled second-category medical rules, and input the second-category medical rules into the medical rule reasoning model, and the medical rule reasoning model performs reasoning based on the second-category medical rules to generate medical inquiry results corresponding to the second-category medical rules.

[0077] In this embodiment, since the labeling usually needs to be done manually, the scale of the labeling data is small. In this case, in order to obtain a larger medical rule library, the unlabeled medical rules (which can be called the second-class medical rules) can be obtained, and the second-class medical rules can be input into the fine-tuned medical rule reasoning model, and the medical rule reasoning model can be used to perform reasoning based on the second-class medical rules to generate medical query results corresponding to the second-class medical rules. In this way, the data scale of the medical rules and their corresponding medical query results is expanded.

[0078] Step 308: Generate a medical rule library based on the first category of medical rules and their corresponding medical inquiry results, as well as the second category of medical rules and their corresponding medical inquiry results; wherein the medical rule library is used to assist the medical service big model in the intelligent dialogue system to perform reasoning related to the medical inquiry scenario.

[0079] In this embodiment, a medical rule library can be further generated based on the above-mentioned first-category medical rules and their corresponding medical inquiry results (the medical inquiry results can be the medical inquiry results marked by the first-category medical rules), and the above-mentioned second-category medical rules and their corresponding medical inquiry results. At this time, the generated medical rule library can be used as an external text data set corresponding to the large language model in the intelligent dialogue system to assist the medical service large model in the intelligent dialogue system (specifically, it can be a service model of the large language model used to generate medical inquiry results corresponding to the medical inquiry text) to perform reasoning related to the medical inquiry scenario.

[0080] In some embodiments, the above-mentioned medical service big model performs reasoning related to the medical inquiry scenario with the assistance of the above-mentioned medical rule library. It can be considered that when the medical service big model generates the corresponding medical inquiry result based on the medical inquiry text input by the user, it can also retrieve the corresponding medical rules in the medical rule library according to the medical inquiry text (for example: assuming that the medical inquiry text is "What does a high platelet index mean", then the medical rules containing the symptom or examination result of a high platelet index can be retrieved in the medical rule library), and the retrieved medical rules and their corresponding medical inquiry results are considered to generate a medical inquiry result corresponding to the medical inquiry text.

[0081] In the above technical scheme, firstly, the first type of medical rules marked with corresponding medical inquiry results can be obtained, and the pre-trained basic big model can be fine-tuned based on the first type of medical rules marked with corresponding medical inquiry results to obtain the medical rule reasoning big model, and then the unlabeled second type of medical rules can be obtained, and the second type of medical rules can be input into the medical rule reasoning big model, and the medical rule reasoning big model can perform reasoning based on the second type of medical rules to generate medical inquiry results corresponding to the second type of medical rules. Finally, based on the first type of medical rules and their corresponding medical inquiry results, as well as the second type of medical rules and their corresponding medical inquiry results, a medical rule library can be generated that can be used to assist the medical service big model in the intelligent dialogue system to perform reasoning related to medical inquiry scenarios.

[0082] By adopting the above method, a medical rule library can be constructed to assist the medical service big model in the intelligent dialogue system to perform reasoning related to the medical inquiry scenario, so that when the intelligent dialogue system is running, it can no longer rely solely on the knowledge obtained by the medical service big model in the training process by learning static corpus, but can also be combined with the knowledge retrieved in the constructed medical rule library, thereby improving the adaptability and response accuracy of the intelligent dialogue system. In addition, in the process of constructing the medical rule library, the pre-trained basic big model can be fine-tuned using the medical rules that are annotated with the corresponding medical inquiry results to obtain a fine-tuned medical rule reasoning big model, and then the medical rule reasoning big model is used to generate corresponding medical inquiry results for the unannotated medical rules. In this way, the data scale of the medical rules used to construct the medical rule library and their corresponding medical inquiry results can be expanded to ensure the scope of application of the constructed medical rules.

[0083] Please combine Figure 1 ,refer to Figure 4 , Figure 4 It is a schematic diagram of a question-answering process based on a large language model shown in an exemplary embodiment of the present application.

[0084] In this embodiment, for the intelligent dialogue system in the field of medical consultation, when obtaining the medical inquiry text input by the user, on the one hand, feature extraction can be performed on the medical inquiry text to obtain a feature vector corresponding to the medical inquiry text.

[0085] On the other hand, feature extraction can be performed on each medical rule in the medical rule library used to assist the service model (which can be called the medical service large model) for reasoning of the large language model, and the feature vectors corresponding to each medical rule can be obtained. It should be noted that an offline calculation method can be used to perform feature extraction on each medical rule in the above-mentioned medical rule library in advance to obtain feature vectors corresponding to each medical rule, and the obtained feature vectors can be stored in correspondence with each medical rule, and the stored feature vectors corresponding to each medical rule can be directly obtained later. Alternatively, an online calculation method can be used to perform feature extraction on each medical rule in the above-mentioned medical rule library in real time after obtaining the medical inquiry text input by the user, and obtain feature vectors corresponding to each medical rule.

[0086] Then, the vector similarity between the feature vectors corresponding to the above-mentioned medical rules and the feature vector corresponding to the above-mentioned medical inquiry text can be calculated, and based on these vector similarities, the medical rules related to the medical inquiry text and the corresponding medical inquiry results can be extracted from the medical rules contained in the above-mentioned medical rule library. It should be noted that the medical rules related to the medical inquiry text can be medical rules with a high vector similarity between the corresponding feature vector and the feature vector corresponding to the medical inquiry text.

[0087] Finally, the above-mentioned medical inquiry text and the medical rules related to the medical inquiry text and the corresponding medical inquiry results extracted from the above-mentioned medical rule library can be input into the above-mentioned medical service big model, and the medical service big model responds to the input and outputs the response content, that is, reasoning is performed based on the medical inquiry text and the medical rules related to the medical inquiry text and the corresponding medical inquiry results to generate a medical inquiry result corresponding to the medical inquiry text, and the medical inquiry result is output to the user.

[0088] In practical applications, after extracting the medical rules and the corresponding medical inquiry results related to the medical inquiry text from the medical rule library, the medical rules and the corresponding medical inquiry results that can be used to generate the medical inquiry results corresponding to the medical inquiry text can be further extracted from the preliminarily extracted medical rules and the corresponding medical inquiry results. It should be noted that the medical rules and the corresponding medical inquiry results that can be used to generate the medical inquiry results corresponding to the medical inquiry text can be medical rules and the corresponding medical inquiry results that are useful for answering the questions described by the medical inquiry text. In this case, the medical inquiry text and the further extracted medical rules and the corresponding medical inquiry results can be input into the medical service big model, and the medical service big model can perform reasoning based on the medical inquiry text and the further extracted medical rules and the corresponding medical inquiry results to generate the medical inquiry results corresponding to the medical inquiry text, and output the medical inquiry results to the user.

[0089] The following Figure 4 The generation process of the medical rule base shown is described in detail.

[0090] Please refer to Figure 5 , Figure 5 It is a flowchart of a question-answering method based on a large language model shown as an exemplary embodiment of the present application.

[0091] like Figure 5 As shown, the question answering method of the large language model may include the following steps:

[0092] Step 502: Obtain the medical inquiry text related to the medical inquiry scenario input by the user.

[0093] In this embodiment, firstly, a medical inquiry text related to the medical inquiry scenario input by the user may be obtained.

[0094] In some embodiments, when a medical inquiry text input by a user is obtained, feature extraction may be performed on the medical inquiry text to obtain a feature vector corresponding to the medical inquiry text.

[0095] Feature extraction refers to extracting the most representative and distinctive information from the original data and converting it into a form that can be understood and processed by the machine learning algorithm, that is, a feature vector. When performing feature extraction on the above-mentioned query text, the Word2Vec algorithm can be used to generate a word embedding corresponding to the query text as a feature vector corresponding to the query text; or, the query text can be input into a machine learning model that can be used for text feature extraction, and the machine learning model performs feature extraction on the query text to obtain a feature vector corresponding to the query text. Among them, the machine learning model that can be used for text feature extraction can be a convolutional neural network (CNN), or it can be a basic model or service model of a large language model, and this application does not impose any special restrictions on this.

[0096] That is, in some embodiments, the medical inquiry text can be input into a large language model, and the large language model can perform feature extraction on the medical inquiry text to obtain a feature vector corresponding to the medical inquiry text. It should be noted that the large language model at this time can refer to the basic model of the large language model, or can refer to the service model of the large language model.

[0097] Step 504: extracting medical rules related to the medical inquiry text and their corresponding medical inquiry results from the medical rules contained in the medical rule library.

[0098] In this embodiment, when a medical inquiry text related to a medical inquiry scenario input by a user is obtained, medical rules related to the medical inquiry text and their corresponding medical inquiry results can be extracted from the medical rules contained in the medical rule library.

[0099] In some embodiments, when the medical inquiry text input by the user is obtained, feature extraction can also be performed on each medical rule in the medical rule library used to assist the service model (which may be called the medical service big model) for reasoning of the big language model to obtain feature vectors corresponding to each medical rule.

[0100] It should be noted that, an offline calculation method can be used to extract features from each medical rule in the medical rule library in advance to obtain feature vectors corresponding to each medical rule, and the obtained feature vectors are stored in correspondence with each medical rule, and the stored feature vectors corresponding to each medical rule can be directly obtained later. Alternatively, an online calculation method can be used to extract features from each medical rule in the medical rule library in real time after obtaining the medical inquiry text input by the user to obtain feature vectors corresponding to each medical rule.

[0101] Subsequently, the vector similarities between the feature vectors corresponding to the above-mentioned medical rules and the feature vectors corresponding to the above-mentioned medical inquiry text can be calculated, and based on these vector similarities, the medical rules related to the medical inquiry text and the corresponding medical inquiry results can be extracted from the medical rules contained in the above-mentioned medical rule library. It should be noted that the medical rules related to the medical inquiry text can be medical rules with a high vector similarity between the corresponding feature vector and the feature vector corresponding to the medical inquiry text.

[0102] The process of extracting the medical rules related to the medical inquiry text and the corresponding medical inquiry results from the medical rules contained in the medical rule library is essentially the process of searching the medical rules related to the medical inquiry text and the corresponding medical inquiry results in the medical rule library.

[0103] In some embodiments, when the large language model performs feature extraction on the medical inquiry text to obtain a feature vector corresponding to the medical inquiry text, in order to ensure the uniformity of the obtained feature vector and improve the accuracy of the vector similarity calculation, each medical rule in the medical rule library can be input into the large language model, and the large language model performs feature extraction on each medical rule to obtain a feature vector corresponding to each medical rule.

[0104] In some embodiments, when extracting medical rules related to the medical inquiry text and their corresponding medical inquiry results from the medical rules contained in the medical rule library based on the vector similarity between the feature vectors corresponding to the above-mentioned medical rules and the feature vector corresponding to the above-mentioned medical inquiry text, specifically, medical rules whose vector similarity between the corresponding feature vector and the feature vector corresponding to the query text is greater than a preset threshold (which may be referred to as the first threshold) can be extracted from the medical rules contained in the medical rule library as the medical rules related to the medical inquiry text, and the medical inquiry results corresponding to the extracted medical rules are obtained, thereby obtaining the medical rules related to the medical inquiry text and their corresponding medical inquiry results.

[0105] In some embodiments, when extracting medical rules related to the query text and their corresponding medical inquiry results from the medical rules contained in the medical rule library based on the vector similarity between the feature vectors corresponding to the above-mentioned medical rules and the feature vectors corresponding to the above-mentioned query text, specifically, a preset number (i.e., Top N, N is the preset number) of medical rules with the largest vector similarity between the corresponding feature vectors and the feature vectors corresponding to the query text can be extracted from the medical rules contained in the medical rule library as the medical rules related to the medical inquiry text, and the medical inquiry results corresponding to the extracted medical rules are obtained, thereby obtaining the medical rules related to the medical inquiry text and their corresponding medical inquiry results.

[0106] In some embodiments, a service model of a large language model that can provide a knowledge base retrieval function can also be used. The service model of the large language model calculates the vector similarities between the feature vectors corresponding to the above-mentioned medical rules and the feature vectors corresponding to the above-mentioned medical inquiry texts, and based on these vector similarities, extracts medical rules related to the medical inquiry text and their corresponding medical inquiry results from the medical rules contained in the above-mentioned medical rule base.

[0107] Step 506: The medical inquiry text and the extracted medical rules and their corresponding medical inquiry results are input into the medical service big model, and the medical service big model performs reasoning based on the medical inquiry text and the extracted medical rules and their corresponding medical inquiry results to generate a medical inquiry result corresponding to the medical inquiry text, and outputs the medical inquiry result to the user.

[0108] In this embodiment, when the medical rules related to the medical inquiry text and the corresponding medical inquiry results are extracted from the medical rule library, the medical inquiry text and the extracted medical rules and the corresponding medical inquiry results can be input into the medical service big model, and the medical service big model responds to the input and outputs the response content, that is, based on the medical inquiry text and the extracted medical rules and the corresponding medical inquiry results, reasoning is performed to generate the medical inquiry results corresponding to the medical inquiry text, and the medical inquiry results are output to the user who inputs the inquiry text. It should be noted that the medical service big model at this time can refer to the service model of the medical service big model.

[0109] That is, the medical rules related to the above-mentioned medical inquiry text and their corresponding medical inquiry results extracted from the above-mentioned medical rule library can be integrated into the input of the above-mentioned medical service big model, so that the medical service big model can consider its inherent generalized knowledge and the specific knowledge obtained from the medical rule library when generating the medical inquiry results corresponding to the input medical inquiry text.

[0110] In some embodiments, when the medical rules and the corresponding medical inquiry results related to the medical inquiry text are extracted from the medical rule library, the medical rules and the corresponding medical inquiry results that can be used to generate the medical inquiry results corresponding to the medical inquiry text can be further extracted from the preliminarily extracted medical rules and the corresponding medical inquiry results. It should be noted that the medical rules and the corresponding medical inquiry results that can be used to generate the medical inquiry results corresponding to the medical inquiry text can be medical rules and the corresponding medical inquiry results that are useful for answering the questions described by the medical inquiry text. In this case, the medical inquiry text and the further extracted medical rules and the corresponding medical inquiry results can be input into the medical service big model, and the medical service big model can perform reasoning based on the medical inquiry text and the further extracted medical rules and the corresponding medical inquiry results to generate the medical inquiry results corresponding to the medical inquiry text, and output the medical inquiry results to the user.

[0111] In some embodiments, when performing the above-mentioned further extraction step, specifically for each target medical rule in the initially extracted medical rules and their corresponding medical inquiry results (i.e., taking these medical rules one by one as target medical rules), the target medical rules and the medical inquiry text can be input into the large language model, and the large language model can perform reasoning based on the medical inquiry text and the target medical rules to determine whether the target medical rules and their corresponding medical inquiry results can be used to generate the medical inquiry results corresponding to the medical inquiry text, so that according to the judgment result output by the large language model, the medical rules and their corresponding medical inquiry results that can be used to generate the medical inquiry results corresponding to the medical inquiry text can be further extracted from the initially extracted medical rules and their corresponding medical inquiry results. It should be noted that the large language model at this time can refer to the service model of the large language model.

[0112] In practical applications, the above-mentioned large language model constructed can be pre-trained on a large-scale, unlabeled text dataset using an unsupervised learning method to obtain a basic model of the large language model; further, judging whether the medical rules and their corresponding medical inquiry results can be used to generate medical inquiry results corresponding to the medical inquiry text can be used as a supervised learning task during fine-tuning training, and a text dataset specific to the judgment task can be prepared, so that the basic model of the large language model can be used as the starting point for fine-tuning, and a supervised learning method can be used to perform fine-tuning training on a dataset specific to the judgment task to obtain a service model of the large language model.

[0113] In some embodiments, since too long an input text will affect the performance of the large language model, in order to ensure the judgment accuracy of the above-mentioned large language model, when the above-mentioned target medical rule and the above-mentioned medical inquiry text are input into the large language model, and the large language model determines whether the target medical rule and its corresponding medical inquiry result can be used to generate a medical inquiry result corresponding to the medical inquiry text, it can be specifically determined whether the text length of the target medical rule exceeds a preset threshold (which can be called a second threshold).

[0114] If the text length of the target medical rule does not exceed the second threshold, the target medical rule and the medical inquiry text can be directly input into the large language model, which determines whether the target medical rule and its corresponding medical inquiry result can be used to generate a medical inquiry result corresponding to the medical inquiry text.

[0115] If the text length of the target medical rule exceeds the second threshold, the target medical rule may be first divided into multiple text segments, and then at least one text segment related to the medical inquiry text may be determined from the multiple text segments, and finally the at least one text segment and the medical inquiry text may be input into the large language model, and the large language model may determine whether the at least one text segment may be used to generate a medical inquiry result corresponding to the medical inquiry text. At this time, if it is determined that the at least one text segment may be used to generate a medical inquiry result corresponding to the medical inquiry text, it may be considered that the target medical rule and the corresponding medical inquiry result may be used to generate a medical inquiry result corresponding to the medical inquiry text.

[0116] In some embodiments, text segmentation may be performed on the target medical rule to segment the target medical rule into multiple text segments, wherein text segmentation refers to dividing the text into smaller units such as sentences, words, phrases or symbols according to certain rules or standards.

[0117] In some embodiments, when determining at least one text segment related to the query text from the above-mentioned multiple text segments, feature extraction can be performed on each of the multiple text segments to obtain a feature vector corresponding to each of the text segments, so that the vector similarity between the feature vector corresponding to each of the text segments and the feature vector corresponding to the medical inquiry text can be calculated, and based on these vector similarities, at least one text segment related to the medical inquiry text can be determined from the multiple text segments. Specifically, a text segment whose vector similarity between the corresponding feature vector and the feature vector corresponding to the medical inquiry text is greater than a preset threshold (which can be called a fourth threshold) can be determined from the multiple text segments as at least one text segment related to the medical inquiry text; or a preset number of text segments whose vector similarity between the corresponding feature vector and the feature vector corresponding to the medical inquiry text is the largest can be determined from the multiple text segments as at least one text segment related to the medical inquiry text.

[0118] In some embodiments, in order to further reduce the amount of data input into the large language model, thereby alleviating the computational pressure of the large language model and improving the computational efficiency of the large language model, before the above-mentioned medical inquiry text and the further extracted medical rules and their corresponding medical inquiry results are input into the above-mentioned medical service large model, it can be determined whether the text length of each medical rule and its corresponding medical inquiry result in the further extracted medical rules and their corresponding medical inquiry results exceeds a preset threshold (which can be called a third threshold), so as to perform text shortening processing on the medical rules and their corresponding medical inquiry results whose text length exceeds the third threshold, and then input the medical inquiry text and the shortened medical rules and their corresponding medical inquiry results into the medical service large model, and the medical service large model performs inference based on the medical inquiry text and the shortened medical rules and their corresponding medical inquiry results to generate a medical inquiry result corresponding to the medical inquiry text, and outputs the medical inquiry result to the user. Among them, text shortening processing can specifically refer to generating corresponding text summaries, for example: generating a short general summary, usually retaining the main points or key information of the original text without including all the details; or generating a more detailed summary, containing more original content but still shorter than the original text.

[0119] In the above technical solution, for the intelligent dialogue system, when obtaining the medical inquiry text input by the user, the medical rules related to the medical inquiry text and the corresponding medical inquiry results can be extracted from the medical rules contained in the constructed medical rule library, so that the medical inquiry text and the extracted medical rules related to the medical inquiry text and the corresponding medical inquiry results can be input into the large language model, and the large language model performs reasoning based on the medical inquiry text and the extracted medical rules related to the medical inquiry text and the corresponding medical inquiry results to generate a medical inquiry result, and outputs the generated medical inquiry result to the user.

[0120] By adopting the above approach, when answering medical questions raised by users or interpreting medical reports uploaded by users, the intelligent dialogue system no longer needs to rely solely on the knowledge acquired by the large language model through learning static corpus during the training process, but can also combine the knowledge retrieved from the constructed medical rule library, thereby improving the adaptability and response accuracy of the intelligent dialogue system.

[0121] It should be noted that the above-mentioned medical rule reasoning big model, the above-mentioned medical service big model, the big language model in the above-mentioned steps 502 and 504, the big language model in the above-mentioned step 506 and other large language models can be the same large language model or different large language models.

[0122] Corresponding to the aforementioned method embodiments, the present application also provides device embodiments.

[0123] Please refer to Figure 6 , Figure 6 It is a structural diagram of a device shown in an exemplary embodiment of the present application. At the hardware level, the device includes a processor 602, an internal bus 604, a network interface 606, a memory 608 and a non-volatile memory 610, and of course may also include other required hardware. One or more embodiments of the present application can be implemented based on software, such as the processor 602 reading the corresponding computer program from the non-volatile memory 610 into the memory 608 and then running it. Of course, in addition to the software implementation, one or more embodiments of the present application do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic module, but can also be hardware or logic devices.

[0124] Please refer to Figure 7 , Figure 7 It is a block diagram of a device for generating a medical rule library shown in an exemplary embodiment of the present application.

[0125] The above-mentioned medical rule base generation device can be applied to Figure 6The device shown is used to implement the technical solution of the present application. The device includes:

[0126] A first acquisition module 702 acquires a first type of medical rule annotated with a corresponding medical inquiry result, and inputs the first type of medical rule into a pre-trained basic large model, so that the basic large model performs reasoning based on the first type of medical rule to generate a medical inquiry result corresponding to the first type of medical rule;

[0127] A fine-tuning module 704 determines a loss based on the generated medical inquiry results and the annotated medical inquiry results, and adjusts the model parameters of the basic large model based on the loss to complete fine-tuning training for the basic large model to obtain the medical rule reasoning large model;

[0128] A second acquisition module 706 acquires unlabeled second-category medical rules, and inputs the second-category medical rules into the medical rule reasoning model, so that the medical rule reasoning model performs reasoning based on the second-category medical rules to generate a medical inquiry result corresponding to the second-category medical rules;

[0129] Generation module 708 generates a medical rule library based on the first category of medical rules and their corresponding medical inquiry results, as well as the second category of medical rules and their corresponding medical inquiry results; wherein the medical rule library is used to assist the medical service big model in the intelligent dialogue system to perform reasoning related to the medical inquiry scenario.

[0130] In some embodiments, the medical rules include non-logical rules related to medical inquiry scenarios for deductive reasoning, and logical rules related to medical inquiry scenarios for inductive reasoning.

[0131] In some embodiments, the non-logical rules include a medical definition of a disease and / or clinical symptoms of a disease.

[0132] In some embodiments, the logic rules include disease diagnosis and treatment logic extracted from medical clinical information.

[0133] In some embodiments, the apparatus further comprises:

[0134] A third acquisition module acquires a medical inquiry text related to the medical inquiry scenario input by the user;

[0135] An extraction module extracts the medical rules related to the medical inquiry text and the corresponding medical inquiry results from the medical rules contained in the medical rule library;

[0136] A generation module inputs the medical inquiry text and the extracted medical rules and their corresponding medical inquiry results into a medical service big model, and the medical service big model performs reasoning based on the medical inquiry text and the extracted medical rules and their corresponding medical inquiry results to generate a medical inquiry result corresponding to the medical inquiry text, and outputs the medical inquiry result to the user.

[0137] In some embodiments, extracting the medical rules related to the medical inquiry text and the corresponding medical inquiry results from the medical rules contained in the medical rule library includes:

[0138] Performing feature extraction on the medical inquiry text to obtain a feature vector corresponding to the medical inquiry text;

[0139] Acquire feature vectors corresponding to each medical rule obtained by performing feature extraction on each medical rule in the medical rule library;

[0140] The vector similarity between the feature vectors corresponding to the medical rules and the feature vector corresponding to the medical inquiry text is calculated, and based on the vector similarity, the medical rules related to the medical inquiry text and the corresponding medical inquiry results are extracted from the medical rules contained in the medical rule library.

[0141] In some embodiments, the step of extracting features from the medical inquiry text to obtain a feature vector corresponding to the medical inquiry text includes:

[0142] Inputting the medical inquiry text into a large language model, and having the large language model perform feature extraction on the medical inquiry text to obtain a feature vector corresponding to the medical inquiry text;

[0143] The device also includes:

[0144] The feature extraction module inputs each medical rule in the medical rule library into the large language model, and the large language model performs feature extraction on each medical rule to obtain a feature vector corresponding to each medical rule.

[0145] In some embodiments, extracting the medical rules related to the medical inquiry text and the corresponding medical inquiry results from the medical rules included in the medical rule library based on the vector similarity includes:

[0146] The medical rules whose vector similarity is greater than a preset threshold are extracted from the medical rules included in the medical rule library as medical rules related to the medical inquiry text, and a medical inquiry result corresponding to the extracted medical rule is obtained.

[0147] In some embodiments, extracting the medical rules related to the medical inquiry text and the corresponding medical inquiry results from the medical rules included in the medical rule library based on the vector similarity includes:

[0148] A preset number of medical rules with the largest vector similarity and their corresponding medical inquiry results are extracted from the medical rules contained in the medical rule library as medical rules related to the medical inquiry text, and the medical inquiry results corresponding to the extracted medical rules are obtained.

[0149] For the device embodiment, it basically corresponds to the method embodiment, so the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the technical solution of the present application.

[0150] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.

[0151] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0152] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0153] Computer readable media include permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0154] It should be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0155] The above specific embodiments of the present application are described. Other embodiments are within the scope of the present application. In some cases, the actions or steps recorded in the present application can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the process depicted in the accompanying drawings does not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0156] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" are also intended to include plural forms, unless the context clearly indicates other meanings. The term "and / or" refers to and includes any or all possible combinations of one or more associated listed items.

[0157] The description of the terms "one embodiment", "some embodiments", "example", "specific example" or "an implementation method" etc. used in one or more embodiments of the present application means that the specific features or characteristics described in conjunction with the embodiment are included in at least one embodiment of the present application. The schematic description of these terms is not necessarily for the same embodiment. Moreover, the specific features or characteristics described can be combined in a suitable manner in one or more embodiments of the present application. In addition, different embodiments and specific features or characteristics in different embodiments can be combined without contradicting each other.

[0158] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determination".

[0159] The above description is merely a preferred embodiment of one or more embodiments of the present application and is not intended to limit one or more embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present application shall be included in the scope of protection of one or more embodiments of the present application.

[0160] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

Claims

1. A method for generating a medical rule base, the method comprising: Acquire a first type of medical rule annotated with a corresponding medical inquiry result, and input the first type of medical rule into a basic large model, so that the basic large model performs reasoning based on the first type of medical rule to generate a medical inquiry result corresponding to the first type of medical rule; Determine the loss based on the generated medical inquiry results and the annotated medical inquiry results, and adjust the model parameters of the basic big model based on the loss to complete the fine-tuning training for the basic big model to obtain the medical rule reasoning big model; Acquire unlabeled second-category medical rules, and input the second-category medical rules into the medical rule reasoning big model, so that the medical rule reasoning big model performs reasoning based on the second-category medical rules to generate a medical inquiry result corresponding to the second-category medical rules; Based on the first category of medical rules and their corresponding medical inquiry results, as well as the second category of medical rules and their corresponding medical inquiry results, a medical rule library is generated; wherein the medical rule library is used to assist the medical service big model in the intelligent dialogue system to perform reasoning related to the medical inquiry scenario. 2 . The method according to claim 1 , wherein the medical rules include non-logical rules related to medical inquiry scenarios for deductive reasoning, and logical rules related to medical inquiry scenarios for inductive reasoning.

3. The method according to claim 2, wherein the non-logical rules include a medical definition of a disease and / or clinical symptoms of a disease.

4. According to the method of claim 2, the logical rules include disease diagnosis and treatment logic extracted from medical clinical information.

5. The method according to claim 1, further comprising: Obtaining medical inquiry text related to the medical inquiry scenario input by the user; Extracting medical rules related to the medical inquiry text and corresponding medical inquiry results from the medical rules contained in the medical rule library; The medical inquiry text and the extracted medical rules and their corresponding medical inquiry results are input into the medical service big model, and the medical service big model performs inference based on the medical inquiry text and the extracted medical rules and their corresponding medical inquiry results to generate a medical inquiry result corresponding to the medical inquiry text, and outputs the medical inquiry result to the user.

6. The method according to claim 5, wherein extracting the medical rules related to the medical inquiry text and the corresponding medical inquiry results from the medical rules contained in the medical rule library comprises: Performing feature extraction on the medical inquiry text to obtain a feature vector corresponding to the medical inquiry text; Acquire feature vectors corresponding to each medical rule obtained by performing feature extraction on each medical rule in the medical rule library; The vector similarity between the feature vectors corresponding to the medical rules and the feature vector corresponding to the medical inquiry text is calculated, and based on the vector similarity, the medical rules related to the medical inquiry text and the corresponding medical inquiry results are extracted from the medical rules contained in the medical rule library.

7. The method according to claim 6, wherein the step of extracting features from the medical inquiry text to obtain a feature vector corresponding to the medical inquiry text comprises: Inputting the medical inquiry text into a large language model, and having the large language model perform feature extraction on the medical inquiry text to obtain a feature vector corresponding to the medical inquiry text; The method further comprises: Each medical rule in the medical rule library is input into the large language model, and the large language model performs feature extraction on each medical rule to obtain a feature vector corresponding to each medical rule.

8. The method according to claim 6, wherein extracting the medical rules related to the medical inquiry text and the corresponding medical inquiry results from the medical rules contained in the medical rule library based on the vector similarity comprises: Extracting the medical rules whose vector similarity is greater than a preset threshold from the medical rules contained in the medical rule library as the medical rules related to the medical inquiry text, and obtaining the medical inquiry results corresponding to the extracted medical rules; or, A preset number of medical rules with the largest vector similarity and their corresponding medical inquiry results are extracted from the medical rules contained in the medical rule library as medical rules related to the medical inquiry text, and the medical inquiry results corresponding to the extracted medical rules are obtained.

9. The method according to claim 6, wherein the medical inquiry text and the extracted medical rules and their corresponding medical inquiry results are input into the medical service big model, the medical service big model performs reasoning based on the medical inquiry text and the extracted medical rules and their corresponding medical inquiry results to generate a medical inquiry result corresponding to the medical inquiry text, and outputs the medical inquiry result to the user, comprising: From the extracted medical rules related to the medical inquiry text and the corresponding medical inquiry results, further extracting the medical rules used to generate the medical inquiry results corresponding to the medical inquiry text and the corresponding medical inquiry results; The medical inquiry text and the further extracted medical rules and their corresponding medical inquiry results are input into the medical service big model, and the medical service big model performs inference based on the medical inquiry text and the further extracted medical rules and their corresponding medical inquiry results to generate a medical inquiry result corresponding to the medical inquiry text, and outputs the medical inquiry result to the user.

10. A device for generating a medical rule library, the device comprising: a first acquisition module, which acquires a first type of medical rule annotated with a corresponding medical inquiry result, and inputs the first type of medical rule into a basic large model, and the basic large model performs reasoning based on the first type of medical rule to generate a medical inquiry result corresponding to the first type of medical rule; A fine-tuning module, which determines a loss based on the generated medical inquiry results and the annotated medical inquiry results, and adjusts the model parameters of the basic large model based on the loss to complete fine-tuning training for the basic large model to obtain a medical rule reasoning large model; A second acquisition module acquires unlabeled second-category medical rules, and inputs the second-category medical rules into the medical rule reasoning model, so that the medical rule reasoning model performs reasoning based on the second-category medical rules to generate a medical inquiry result corresponding to the second-category medical rules; A generation module generates a medical rule library based on the first category of medical rules and their corresponding medical inquiry results, as well as the second category of medical rules and their corresponding medical inquiry results; wherein the medical rule library is used to assist the large language model in the intelligent dialogue system to perform reasoning related to the medical inquiry scenario.

11. An electronic device, comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 9 by running the executable instructions.

12. A computer-readable storage medium having computer instructions stored thereon, wherein the instructions are executed by a processor to implement the method according to any one of claims 1 to 9.