Answer generation method and device for medical question-answering system
By standardizing user questions and matching them with the rule base, combined with large model processing, the problem of uncontrollable answers and hallucinations in medical Q&A scenarios is solved, and the accuracy and controllability of answers are improved.
Patent Information
- Application Number
- CN202410502404.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-25
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-04-25
AI Technical Summary
In medical question and answer scenarios, large language models may cause uncontrollable answers and hallucinations due to their huge corpus and generation capabilities, making it difficult to provide accurate answers in highly professional fields.
By standardizing user questions, standardized statements are generated and matched with the preset standardized rule base. Large models are used to process standardized statements and matched rules to generate answers, and combined with user intent recognition to generate targeted medical answers.
It improves the accuracy of medical answers, reduces the occurrence of hallucinations, and ensures controllability of answers in the professional field.
Smart Images

Figure CN118070909B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of computer technology, and more particularly, to a method and device for generating answers to a medical question-and-answer system. Background Art
[0002] Large Language Model (LLM), also known as large-scale language model, or large model, usually has a large number of parameters, such as billions. Large language model is a natural language processing model based on deep learning, which can learn the grammar and semantics of natural language, so as to generate human-readable text. Due to its huge corpus, large language model can be used as a pre-trained model for various language processing scenarios, such as question-answering scenarios, push scenarios, generation scenarios, etc. These scenarios involve various application fields, such as question-answering scenarios can be medical fields, academic fields, etc. In the medical question-answering scenario, corpus can be generated based on existing multi-round dialogue corpus or by simulating the question-answering between doctors and patients in the form of intelligent agents, and then fine-tune the large model to use the task of medical question-answering suggestions. However, due to the large corpus and generation ability of the large model, for application fields with high medical professionalism, the problem of uncontrollable answers and hallucinations may occur during use. Therefore, how to improve the accuracy of large models in highly professional fields is a problem worth studying. Summary of the invention
[0003] One or more embodiments of this specification describe a method and device for generating answers to a medical question-and-answer system, to solve one or more problems mentioned in the background art.
[0004] According to a first aspect, a method for generating an answer for a medical question-and-answer system is provided, comprising: performing standardization processing on a current user question description information to generate a first standardized statement; matching the first standardized statement with a standardized rule preset in a rule library to obtain at least one candidate rule, wherein the standardized rule comprises a medical causal logic and a rule type determined based on a classification logic for classifying causal relationships in the causal logic; processing the first standardized statement and the at least one candidate rule based on a large model to generate a medical answer for the current user question, wherein the process of generating the medical answer by the large model also includes identifying the user intent based on the current user question description information, wherein the user intent corresponds to the rule type, and is used to generate a medical answer in a targeted manner.
[0005] In one embodiment, the first standardized sentence is a sentence described by a first predetermined format, and the first predetermined format includes a plurality of predetermined items.
[0006] In one embodiment, matching the first standardized statement with the standardized rules preset in the rule base to obtain at least one candidate rule includes: detecting the text similarities corresponding to the first standardized statement and each standardized rule in the rule base; selecting several standardized rules whose text similarities are ranked from large to small, or several standardized rules whose text similarities are greater than a predetermined similarity threshold, as the at least one candidate rule.
[0007] In one embodiment, the normalization rule is described by a second predetermined format in the form of a conditional expression.
[0008] In one embodiment, the standardized rules in the rule base are extracted in the following manner: taking reference corpus information, reasoning logic information for extracting standardized rules based on the reference corpus information, and standardized rules based on the reference corpus information as samples, calling the language big model to process the current corpus information, and obtaining the reasoning logic information and standardized rules for the current corpus information.
[0009] In one embodiment, the processing of the first standardized statement and at least one candidate rule based on the big model to generate a medical answer for the current user question includes: multiple calls to the big model to process the first standardized statement and at least one candidate rule to obtain corresponding multiple candidate answers; and determining the candidate answer with the largest number of occurrences from the multiple candidate answers as the medical answer.
[0010] In one embodiment, the input method of the current user question is at least one of voice, image, text, and table.
[0011] According to a second aspect, there is provided an answer generating device for a medical question-answering system, comprising:
[0012] A conversion unit, configured to perform standardization processing on the current user question description information, thereby generating a first standardized sentence;
[0013] A matching unit is configured to match the first standardized statement with a preset standardized rule in a rule library to obtain at least one candidate rule, wherein the standardized rule includes a medical causal logic and a rule type determined based on a classification logic for classifying the causal relationship in the causal logic; a generating unit is configured to generate a medical answer for the current user question by processing the first standardized statement and the at least one candidate rule based on a large model, wherein the process of generating a medical answer by the large model also includes identifying user intent based on the current user question description information, and the user intent corresponds to the rule type, so as to generate a medical answer in a targeted manner.
[0014] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed in a computer, the computer is caused to execute the method of the first aspect.
[0015] According to a fourth aspect, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method of the first aspect is implemented.
[0016] Through the device and method provided in the embodiments of this specification, a rule base of standardized rules is constructed in advance. For user questions, the user question description information can be converted into standardized sentences through standardized processing, and the converted standardized sentences are matched with the standardized rules in the rule base, so as to use the rule base to recall information about user questions. Then, the standardized sentences and the matched standardized rules are processed by the large model to generate corresponding medical answers for the user questions. Among them, the current user question description information and rule type are also used to identify user intent in the process of generating medical answers, so as to generate answers in a targeted manner according to the user intent identification results. In this way, hallucinations can be removed and the accuracy of the generated medical answers can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0018] Figure 1 A schematic diagram of a specific implementation architecture under the technical concept of this specification;
[0019] Figure 2 A schematic diagram of the answer generation process of the medical question-answering system according to an embodiment of this specification is shown;
[0020] Figure 3 A schematic diagram of the operation block for extracting standardized rules using a large model for building a rule base is shown;
[0021] Figure 4 A schematic diagram of a fine-tuning architecture for fine-tuning a large language model for rule extraction is shown;
[0022] Figure 5 A structural block diagram of an answer generating device of a medical question-and-answer system according to an embodiment of the present specification is shown. DETAILED DESCRIPTION
[0023] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0024] Figure 1 A schematic diagram of a specific implementation architecture of this specification is shown. Figure 1 As shown, in the implementation architecture provided in this specification, a user terminal and a server are included. The user terminal can be a smart phone, a laptop, a tablet computer, a smart watch, and other terminal devices that can interact with the user. The user terminal can install and run various terminal applications. For example, information push applications, news applications, shopping applications, food delivery platform applications, question-and-answer platform applications, etc. The server can provide business support for terminal applications, such as providing business support for question-and-answer platform applications. The server can be locally set up with a computing platform, or connected to a computing platform on other devices. Other devices can be implemented by computers, servers, etc. with certain computing capabilities.
[0025] Taking question-answering applications as an example, the user terminal can obtain the question description information input by the user through human-computer interaction, and upload the user description information to the server. The computing platform of the server obtains the user's question description information and converts it into a standardized sentence. On the other hand, the computing platform can be pre-connected with a rule base, which contains rules described by standardized sentences. Here, a standardized sentence refers to a sentence that describes relevant information in a predetermined format. The standardized rule can include reasoning causal relationships, and the cause in the causal relationship can be a condition (such as corresponding to the information described by the user's question), and the effect can be the result obtained by conditional reasoning (such as corresponding to the answer). The computing platform can match the standardized sentence corresponding to the user's question description information with the standardized sentence in the rule base, and obtain several matched standardized sentences of the rule base. The standardized sentence corresponding to the user's question description information and the matched standardized sentences of the rule base can be input together into a language model that has been fine-tuned by samples in the relevant business field in advance, and the answer corresponding to the user's question is determined by the output of the language model, and fed back to the user terminal via the server.
[0026] It is worth mentioning that Figure 1 The implementation architecture shown is only an example. In practice, the computing platform may also be provided in the user terminal, or part of it may be provided in the user terminal and the other part may be provided in the server, which is not limited here. Figure 1 The number of user terminals in can be any possible number, such as 100,000.
[0027] pass Figure 1It can be seen from the implementation architecture shown that under the technical concept of this specification, it is necessary to pre-build a rule base described by standardized rules. On the other hand, the user's questions are described by standardized statements and matched in the rule base. The matched standardized rules are merged (such as splicing) with the standardized statements of the user's questions, and processed by the large model to obtain the corresponding answers. In this way, more abundant information can be used, and standardized statements can be used to remove noise through clear rules to improve the accuracy of answer prediction. This specification describes the medical problem scenario as an example, but does not exclude the possibility of its use in other scenarios.
[0028] This manual uses the medical question-and-answer scenario as an example, but does not rule out the possibility of applying the relevant solutions to other question-and-answer scenarios.
[0029] Combine the following Figure 2 The embodiments are shown and the technical concept of the present specification is described in detail.
[0030] Figure 2 The figure shows a schematic diagram of the answer generation process of the medical question-answering system according to an embodiment. The execution subject of the process can be a computer, device, or server with certain computing capabilities. More specifically, for example, Figure 1 The computing platform shown. Figure 2 As shown, the answer generation process of the medical question-and-answer system provided in the embodiment of the present specification may include: step 201, standardizing the current user question description information to generate a first standardized statement; step 202, matching the first standardized statement with the standardized rules preset in the rule library to obtain at least one candidate rule, the standardized rule including medical causal logic and a rule type determined based on a classification logic for classifying the causal relationship in the causal logic; step 203, processing the first standardized statement and at least one candidate rule based on the big model to generate a medical answer for the current user question, wherein the big model also performs user intent recognition based on the current user question description information during the process of generating the medical answer, and the user intent corresponds to the rule type, which is used to generate a medical answer in a targeted manner.
[0031] First, in step 201, standardization processing is performed on the current user problem description information to generate a first standardized sentence.
[0032] The current user question may be a question that is currently being asked to answer the medical question-answering system based on user input. In the medical question scenario, the user question description information may include symptoms, examination results, inquiry objectives (such as what to do, what examinations to do, what disease it is, etc.), and so on.
[0033] The input method of the current user problem description information can be voice, image, text, table and other methods, and the input content in the corresponding method is the description information of the current user problem. In the voice and text input methods, the current user problem can be described based on natural language. In the table input method, it can be described through the field values in the list. The image here can be a description information image, or various optical films, inspection result images, etc., which are not limited here.
[0034] In an embodiment of the present specification, in order to more accurately obtain the information contained in the user question, a standardized statement can be generated through standardized processing according to the user question description information. For example, a first standardized statement can be generated according to the current user question description information. A standardized statement is a statement that describes an event in a first predetermined format. The first predetermined format here may include predetermined items, such as "symptoms", "test indicators", and other predetermined items. Under a single predetermined item, more specific sub-items may also be included. For example, under the "test indicators" item, sub-items such as "blood routine test", "urinalysis", "electrocardiogram", "B-ultrasound" may be included. For the medical field, the predetermined items may be pre-set, for example, various possible medical examination items may be enumerated.
[0035] It is understandable that the current user question may describe multiple pieces of information, and each information item can be converted into a corresponding standardized sentence. At this time, the first standardized sentence can include each sentence corresponding to the multiple information items.
[0036] As a specific example, assume that the current user problem description information described in natural language is as follows: "Hello, doctor. I had pain in my left testicle yesterday. I went to the hospital for a B-ultrasound: the left testicle was full in shape, the echo was unevenly reduced, and the left epididymis had abnormal echo. The blood procalcitonin was 13.69, C-reactive protein was 86.9, white blood cells were 29.55, neutrophil percentage was 96.5%, blood creatinine: 99, urine routine white blood cells: 3.3 / HP, red blood cells: 21.1 / HP, what is going on with my situation? Do I need to deal with it?". It can be seen that it includes the user's own description of the symptoms, the results of the medical examination, and the inquiry target "What's going on? Do I need to deal with it?". In this step 201, it can be converted into a first standardized sentence.
[0037] The first standardized sentence converted may be, for example:
[0038] Symptoms: Pain in left testicle
[0039] Duration: 1 day
[0040] Back pain:
[0041] Negative symptoms: None
[0042] fever:
[0043] Negative symptoms: None";
[0044] Inspection indicators:
[0045] Lifting pain:
[0046] Description of examination and test: Positive
[0047] Is it abnormal: Yes
[0048] Ultrasound:
[0049] Description of examination and testing: The left testicle is full in shape, with unevenly reduced echo (inflammatory changes?), and the left epididymis has abnormal echo (inflammatory changes)
[0050] Is it abnormal: Yes
[0051] Procalcitonin:
[0052] Inspection and testing description: 13.69
[0053] Is it abnormal: Unable to judge
[0054] C-Reactive Protein:
[0055] Inspection and testing description: 86.9
[0056] Is it abnormal: Unable to judge
[0057] leukocyte:
[0058] Inspection and testing description: 29.55
[0059] Is it abnormal: Unable to judge
[0060] Neutrophil percentage:
[0061] Inspection and testing description: 96.5%
[0062] Is it abnormal: Legal judgment
[0063] Serum creatinine:
[0064] Inspection and testing description: 99
[0065] Is it abnormal: Unable to judge
[0066] Urinalysis:
[0067] Description of examination and test: White blood cell: 3.3 / HP; Red blood cell: 21.1 / HP
[0068] Is it abnormal: cannot be determined".
[0069] The standardized sentences obtained through the standardization process are described by multi-level information items. There can be multiple information items at a single level. For example, the first-level information items include "symptoms", "test and examination items", etc. The second-level information items under "test and examination items" include "pain caused by lifting", "B-ultrasound", "procalcitonin", etc.
[0070] Next, through step 202, the first standardized statement is matched with the standardized rules preset in the rule base to obtain at least one candidate rule.
[0071] Here, the rule base can be a pre-set database containing a variety of standardized rules. Standardized rules can be rules that describe medical reasoning logic in a second predetermined format. Among them, medical reasoning logic rules can be divided into multiple rule types, such as from symptoms to hospital departments, from symptoms to suspected diseases, from symptoms to examination plans, from examination results to suspected diseases, from diseases to drug / surgical treatment plans, from examination results to staging or severity, from examination results to further examination plans, and so on. It is easy to understand that these types of medical reasoning logic rules can be considered to contain multiple levels of hierarchical progression, such as from symptoms to examination plans, from examination results to suspected diseases, from diseases to drug / surgical treatment plans, and so on.
[0072] It can be seen that the medical reasoning logic rules usually contain causal relationships, and the second predetermined format can be a format that describes such causal relationships. For example, the second predetermined format is a conditional expression format, such as "if...then..." (hereinafter may also be described as "IF...THEN..."), and the standardized statement combined with the medical reasoning logic rule is "IF (A and Band C), THEN (D and E)", which can be referred to as a standardized rule in this specification. Among them, the number of semantic units (such as A, B, C, D, E, etc.) connected by the and statement in the brackets after IF and THEN (it can also be an or statement indicating selection) can be any number. In an optional embodiment, there is only one semantic unit in the brackets after IF and THEN, and the and connection statement is not required. As an example, a standardized rule is, for example, "IF (disease IN upper urinary tract stones) AND (complication IN acute pyelonephritis) THEN (treatment IN ureteral stent placement)". In practice, there are many possibilities for standardized rules, which may be ever-changing, so all possible situations are used as standardized rules. For example, another standardized rule is "IF (Aand M), THEN (D and E)".
[0073] Medical reasoning logic rules can be extracted from various medical books, authoritative medical websites, medical academic papers, etc. The extraction process can be done manually or using a machine learning model. Taking a machine learning model as an example, a large language model can be used to extract by analogy.
[0074] According to one embodiment, when extracting medical reasoning logic rules by analogy using a large language model, a small amount of reasoning logic in the reasoning reason library of the extracted rules can be used as a few shots. The reasoning logic in the reasoning reason library of the extracted rules can be pre-tested by expert experience. The reasoning logic may include causal logic and classification logic. Causal logic may be the logic of obtaining relevant medical conclusions from information directly determined from the patient himself in medical common sense, such as the logic of obtaining results such as diseases and treatment plans from information such as symptoms and test results, while classification logic may be the inductive logic of the category to which the causal relationship belongs. Based on the classification logic, the corresponding rule type may be determined, such as using the classification logic as the corresponding rule type.
[0075] The following is an example of a specific reasoning logic in the extraction rule reasoning library:
[0076] First, the input text is "Upper urinary tract stone obstruction with infection and even obstructive anuria is one of the common emergencies in urology. Severe infection may even lead to sepsis and septicemia, which is life-threatening. Severe obstructive anuria may also lead to renal failure and electrolyte imbalance. The obstruction should be relieved immediately and the infection should be controlled to avoid further damage to renal function to the greatest extent. The most commonly used methods to relieve obstruction are ureteral stent placement and percutaneous nephrostomy. At the same time, blood and urine bacterial culture and drug sensitivity tests should be performed, and anti-infection treatment should be performed immediately. The changes in urine volume and electrolytes after the obstruction is relieved should be closely observed. Sensitive antibiotics should be re-selected according to the drug sensitivity results in the later stage, and the stones should be treated at an appropriate time after the sepsis is controlled";
[0077] Chapter information: ["Guidelines for the diagnosis and treatment of urological and men's diseases in China 2022 edition_3", "Section 3 Treatment of urinary tract stones", "I. Treatment of upper urinary tract stones", "(II) Treatment of stone-associated infection and obstructive anuria"];
[0078] Secondly, the reasoning process is as follows:
[0079] "According to the text, in the case of upper urinary tract stone obstruction accompanied by infection and leading to obstructive anuria, the treatment measures include relieving the obstruction, controlling the infection, and preventing further damage to renal function. These treatment measures are to deal with diseases and symptoms, so they are classified as from disease, symptoms to treatment;
[0080] The text mentions that sepsis may occur when the infection is severe, which is a potential disease process and is therefore classified as ranging from disease, symptom to disease;
[0081] The text mentions that obstructive anuria, if severe, can lead to renal failure and electrolyte imbalance, which are other diseases that may be caused by diseases and symptoms, so they are classified from diseases, symptoms to suspected diseases;
[0082] The treatments for upper urinary tract stone obstruction are described, including intraureteral stenting and percutaneous nephrostomy, which are surgical treatments and therefore classified as disease to treatment (surgery);
[0083] The text states that after the above surgical treatment, bacterial culture, drug sensitivity test and anti-infection treatment should be performed. This is a treatment step after surgical treatment to prevent further infection, which belongs to the process from disease, treatment to further treatment;
[0084] After the obstruction is relieved, it is necessary to closely observe the changes in urine volume and electrolytes. This is a post-treatment monitoring process, so it is classified as from symptoms to examinations;
[0085] The text content recommends reselecting appropriate antibiotics based on susceptibility results, which is the process of applying test results to drug treatment selection and is therefore categorized as from symptoms to tests to drug treatment;
[0086] Finally, it is mentioned that after sepsis is controlled, stones will be treated electively. This is a strategy for further surgical treatment after the disease is controlled, which belongs to the process from disease and symptoms to surgical treatment.
[0087] Then, the inference logic output can be:
[0088] 1. IF (upper urinary tract stone obstruction) AND (accompanied by infection) AND (obstructive anuria occurs) THEN (immediately relieve the obstruction) AND (control the infection) AND (avoid further damage to renal function) [disease, symptoms → treatment];
[0089] 2. IF (upper urinary tract stone obstruction) AND (severe infection) THEN (sepsis may occur) [disease, symptoms → disease];
[0090] 3. IF (upper urinary tract stone obstructive anuria) AND (severe symptoms) THEN (may lead to renal failure) AND (may lead to electrolyte imbalance) [disease, symptoms → suspected disease];
[0091] 4. IF (upper urinary tract stone obstruction) THEN (ureteral stent placement) AND (percutaneous nephrostomy) [disease → treatment (surgery)];
[0092] 5. IF (upper urinary tract obstruction by stones) AND (ureteral stent placement) AND (percutaneous nephrostomy) THEN (blood and urine bacterial culture and drug sensitivity test) AND (immediate anti-infection treatment) [disease, treatment → further treatment];
[0093] 6. IF (upper urinary tract stone obstruction is relieved) THEN (closely observe changes in urine volume and electrolytes) [symptoms → examination];
[0094] 7. IF (upper urinary tract stone obstruction is relieved) AND (drug sensitivity results are obtained) THEN (sensitive antibiotics are reselected) [symptoms, examination → treatment (drugs)];
[0095] 8. IF (upper urinary tract stone obstruction) AND (after sepsis is controlled) THEN (elective treatment of stones) [disease, symptoms → treatment (surgery)].
[0096] As in the edge transformation rules 1 to 8 above, the “IF…THEN…” statement describes the conclusion that can be drawn based on the provided information through causal logic, and the brackets [] describe the category to which the causal logic belongs, that is, the rule type derived from the classification logic.
[0097] In the extraction rule reasoning library, multiple such reasoning logic examples can be included. These reasoning logic examples are used as samples of the language model. By calling the language model, corresponding medical reasoning logic rules can be extracted from more medical corpora as standardized rules in the rule library. An example of calling the language model is as follows: Figure 3 shown. Figure 3 is a screenshot, the characters in which are only used as examples and do not constitute a substantial limitation on the technical concept of this specification. Figure 3 As shown, in the annotation box 301, the instruction description issued to the language big model is shown, which describes in detail what kind of content the language big model needs to generate what kind of rules; the annotation box 302 is an example in the previous extraction rule reasoning library, as an example of the language big model, describing the given content (Input), reasoning process (Reasoning) and expected output (Output); the annotation box 303 is the given text content (Input) that the big model currently needs to reason. In this way, the big model can reason (Reasoning) according to the text content in the annotation box 303 and output standardized rules (Output, such as "IF...THEN..." statements and the type of rules they belong to, etc.). In this way, standardized rules can be mined from various medical corpora.
[0098] According to another embodiment, considering the huge scale of medical corpus and the parameter scale of the language model, in order to improve the updating efficiency of the standardized rule model, the output of the language model can be reviewed by experts and used as training samples after passing the review to train a relatively lightweight rule extraction model (such as a student model obtained by using the large model as a teacher model), or to extract standardized rules after adding auxiliary modules to the language model to fine-tune parameters. A single training sample can correspond to a section of corpus as sample input data, and the reasoning process and corresponding standardized rules as sample labels.
[0099] In this way, the training of the rule extraction model can be carried out using methods such as LoRA and teacher-student model. Taking the LoRA method as an example, the core idea of this method is to simulate the change of parameters through low-rank decomposition, so as to achieve indirect fine-tuning training of large models with extremely small parameters. Figure 4 As shown in the figure, the parameters of the large language model are frozen, and matrices A and B are selected to replace them. When fine-tuning the standardized rule extraction task, the input x is processed by the large language model to obtain the representation h1, and the representation h2 is obtained by processing matrices A and B. Then, the output h is determined by the fusion (such as addition) of h1 and h2, and the model loss is determined based on the comparison between the output h and the label, and the matrices A and B are updated for the purpose of reducing the model loss. Thus, the parameters of matrices A and B are used instead of fine-tuning the parameters of the large language model to obtain the standardized rule extraction model.
[0100] It can be understood that the model loss of the standardized rule extraction model can include two parts, one is the reasoning loss such as Lr, and the other is the rule output loss such as Ls. For a batch of N training samples, the two losses are, for example: , , where CE represents the classification error rate (Classification Error), f represents the standardized rule extraction model, Represents the corresponding input data, Represents the sample label.
[0101] In this way, the standardized rule extraction model obtained through training can extract corresponding standardized rules from various medical corpora and add them to the rule base.
[0102] The standardized rules in the rule base and the first standardized statement use a standardized description method with a similar structure. Therefore, for the first standardized statement, the corresponding standardized rules in the rule base can be matched as candidate rules to supplement and recall the user's question description information (also known as prompting).
[0103] Among them, the matching of the first standardized statement with the standardized rules in the rule base can be based on text matching or vector matching. Among them, the text-based matching can be determined by comparing the words in the text, such as measuring the text similarity with indicators such as the Jaccard coefficient. In the case of matching based on vectors, the first standardized statement and the standardized rules in the rule base can be converted into text representation vectors by text vectorization methods such as one-hot representation and bag-of-words model BOW, and the text similarity is measured by the vector similarity of the text representation vector. Regardless of the text similarity measurement method adopted, several standardized rules with the highest text similarity to the first standardized statement can be selected from the standardized rules in the rule base as candidate rules. Among them, the several standardized rules with the highest text similarity to the first standardized statement can be a predetermined number of standardized rules with the highest text similarity, or can be standardized rules whose corresponding text similarity is greater than a predetermined similarity threshold, which is not limited here.
[0104] Further, in step 203, a medical answer is generated for the current user question based on the processing of the first standardized statement and at least one candidate rule by the large model.
[0105] It can be understood that the big model here is a big model for the task of generating medical answers from standardized sentences of user questions. In other words, based on the pre-trained language big model, the big model is fine-tuned through standardized sentences of medical user questions and samples consisting of corresponding medical answers. In the process of generating answers by the big model, through the reasoning logic reasoning described in the previous article, combined with candidate rules, and with the help of the symbolic reasoning ability of the big model, the medical answer corresponding to the current user question is automatically generated. The big model can process the first standardized sentence together with at least one candidate rule to generate a medical answer for the current user question. The medical answer here can, for example, be the result in the standardized rule in the previous article, such as the information described by the THEN statement.
[0106] Here, the medical answer may be various types of answers related to the medical questions raised by the user, such as triage departments, treatment suggestions, disease speculation, examination suggestions, and the like.
[0107] In some embodiments, the process of generating medical answers by the large model may also include intent recognition. The intent here may correspond to the rule type of the standardized rule, such as "symptoms → disease", etc. For example, for the specific example given in step 201, the user's question includes the inquiry target "What is going on with my situation? Do I need to deal with it?" Therefore, its intent may include "symptoms → disease", "symptoms → medical treatment plan", etc. Based on the identified intent, a more targeted medical answer can be generated.
[0108] In a possible design, considering the randomness of the data generated by the big model, for the current user question, the first standardized statement and at least one candidate rule can be processed by the big model multiple times in step 203 to obtain multiple candidate answers, and the candidate answer with the most occurrences is determined from the multiple candidate answers as the final medical answer. In this way, the stability of the medical answer given by the big model can be improved.
[0109] The answer generation method of the medical question-answering system provided under the technical concept of this specification, on the one hand, converts user questions into standardized sentences, and on the other hand, builds a rule base of standardized rules in advance, so that the rule base can be used to recall information for the current user question. In this way, applying the information in the rule base to the medical question-answering system can remove illusions and improve the accuracy of the generated answers.
[0110] According to another embodiment, a device for generating answers to a medical question-and-answer system is also provided. The device can be provided on a computer, terminal, or server with a certain computing capability. More specifically, Figure 1 The computing platform shown. Figure 5 FIG. 5 shows an answer generation device 500 of a medical question-answering system according to an embodiment. Figure 5 As shown, the apparatus 500 may include:
[0111] The conversion unit 501 is configured to perform standardization processing on the current user question description information, thereby generating a first standardized sentence;
[0112] A matching unit 502 is configured to match the first standardized statement with a standardized rule preset in a rule base to obtain at least one candidate rule, wherein the standardized rule includes a medical causal logic and a rule type determined based on a classification logic for classifying a causal relationship in the causal logic;
[0113] The generation unit 503 is configured to generate a medical answer for the current user question based on the processing of the first standardized statement and at least one candidate rule by the big model, wherein the big model also performs user intent recognition based on the current user question description information during the process of generating the medical answer, and the user intent corresponds to the rule type, which is used to generate a medical answer in a targeted manner.
[0114] In one embodiment, the first standardized sentence is a sentence described by a first predetermined format, and the first predetermined format includes a plurality of predetermined items.
[0115] According to an optional implementation, the matching unit 502 is further configured as follows:
[0116] Detecting the similarity between the first standardized sentence and each text corresponding to each standardized rule in the rule base;
[0117] A plurality of standardized rules whose text similarity is ranked top in descending order, or a plurality of standardized rules whose text similarity is greater than a predetermined similarity threshold, are selected as at least one candidate rule.
[0118] In one embodiment, the normalization rule is described by a second predetermined format in the form of a conditional expression.
[0119] In some possible implementations, the generation unit 503 is further configured to: call the large model multiple times to process the first standardized statement and at least one candidate rule to obtain multiple corresponding candidate answers; and determine the candidate answer with the largest number of occurrences from the multiple candidate answers as the medical answer.
[0120] In one embodiment, the input method of the current user question is at least one of voice, image, text, and table.
[0121] It is worth mentioning that Figure 5 The device 500 shown is Figure 2 The method described corresponds to Figure 2 The corresponding description in the illustrated method embodiment is also applicable to the device 500 and will not be repeated here.
[0122] According to another embodiment, there is also provided a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 2 The method described by et al.
[0123] According to another embodiment of the present invention, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the Figure 2 The method described in the above examples should be appreciated by those skilled in the art that the functions described in the embodiments of this specification can be implemented by hardware, software, firmware, or any combination thereof in one or more of the above examples. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0124] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the technical concept of this specification. It should be understood that the above description is only the specific implementation method of the technical concept of this specification, and is not used to limit the protection scope of the technical concept of this specification. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the embodiments of this specification should be included in the protection scope of the technical concept of this specification.
Claims
1. A method for generating answers for a medical question-answering system. include: Performing standardization processing on the current user problem description information, thereby generating a first standardized sentence described by a plurality of predetermined items in a first predetermined format; Matching the first standardized statement with a preset standardized rule in a rule base to obtain at least one candidate rule, wherein the standardized rule includes medical causal logic and a rule type determined based on a classification logic for classifying causal relationships in the causal logic; Based on the big model's processing of the first standardized statement and the at least one candidate rule, a medical answer is generated for the current user question, wherein the big model also performs user intent identification based on the current user question description information during the process of generating the medical answer, and the user intent corresponds to the rule type, so as to generate a targeted medical answer.
2. The method according to claim 1, in, The first standardized statement is matched with the standardized rule preset in the rule base to obtain at least one candidate rule including: Detecting the similarity between the first standardized sentence and each text corresponding to each standardized rule in the rule base; A plurality of standardized rules whose text similarity is ranked top in descending order, or a plurality of standardized rules whose text similarity is greater than a predetermined similarity threshold, are selected as the at least one candidate rule.
3. The method according to claim 1, in, The normalization rule is described by a second predetermined format in the form of a conditional expression.
4. The method according to claim 1, in, Standardized rules in the rule base are extracted in the following ways: Taking reference corpus information, reasoning logic information based on the reference corpus information to extract standardized rules, and standardized rules based on the reference corpus information as samples, the language big model is called to process the current corpus information to obtain reasoning logic information and standardized rules for the current corpus information.
5. The method according to claim 1, in, The processing of the first standardized statement and at least one candidate rule based on the big model to generate a medical answer for the current user question includes: Calling the large model multiple times to process the first standardized statement and at least one candidate rule to obtain corresponding multiple candidate answers; The candidate answer with the largest number of occurrences is determined from among the plurality of candidate answers as the medical answer.
6. The method according to claim 1, in, The input method of the current user question is at least one of voice, image, text, and table.
7. An answer generation device for a medical question-answering system, include: A conversion unit, configured to perform standardization processing on the current user problem description information, thereby generating a first standardized sentence described by a plurality of predetermined items in a first predetermined format; a matching unit configured to match the first standardized statement with a standardized rule preset in a rule base to obtain at least one candidate rule, wherein the standardized rule includes a medical causal logic and a rule type determined based on a classification logic for classifying a causal relationship in the causal logic; A generation unit is configured to generate a medical answer for the current user question based on the processing of the first standardized statement and the at least one candidate rule by the big model, wherein the process of generating the medical answer by the big model also includes identifying the user intent based on the current user question description information, and the user intent corresponds to the rule type, so as to generate a medical answer in a targeted manner.
8. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 6.
9. A computing device comprising a memory and a processor, It is characterized in that The memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 6 is implemented.
