Question and answer pair generation method and device, electronic equipment and storage medium
By performing naming entity recognition and association detection on the drug instructions, an undirected graph is built, and a preset question and answer pair is generated using the preset question and answer pair template, the existing question and answer robots answer non-targeted questions are solved, and the question and answer pair of the drug instructions is realized. Rapidly build and efficiently apply.
Patent Information
- Application Number
- CN202411137641.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-11-22
AI Technical Summary
When answering drug instructions, existing question-and-answer robots answer the answers are not targeted and applicable, and cannot effectively utilize the structured information in the drug instructions.
By performing naming entity recognition and association detection on the drug instructions, undirected graphs are built, node-level is detected, and targeted Q&A pairs are generated using preset Q&A pair templates to improve the construction efficiency and application of Q&A pairs.
It realizes the pre-identification of the content and structure of the drug instructions, quickly builds highly targeted Q&A pairs, and improves the application and efficiency of Q&A robots.
Smart Images

Figure CN119003734A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a question-answer pair generation method, device, electronic device and storage medium. Background Art
[0002] At present, most Q&A robots rely on local knowledge bases to match knowledge content and then answer questions. However, the content of local knowledge bases is mostly a long string of text, and the answers of Q&A robots are not targeted. When Q&A robots are used in drug instructions, they usually reply with a long string of text, which is poor in applicability and targeting and needs to be improved urgently. Summary of the invention
[0003] The present invention provides a question-answer pair generation method, device, electronic device and storage medium, which improve the pertinence and applicability of the target question-answer pair of the target drug instruction manual.
[0004] According to one aspect of the present invention, a method for generating question-answer pairs is provided, the method comprising:
[0005] Obtaining a target drug instruction sheet, and performing named entity recognition on the target drug instruction sheet to obtain at least two target entities contained in the target drug instruction sheet;
[0006] Performing association detection on each of the target entities;
[0007] Generate a target node according to each of the target entities, connect the target nodes corresponding to each of the target entities having an associated relationship, and construct a target undirected graph;
[0008] According to the connection relationship between the target nodes in the target undirected graph, the level of each target node is detected to obtain a first target node, a second target node and a third target node; wherein the first target node is a root node of each target node; the second target node is connected to the first target node; and the third target node is connected to the second target node;
[0009] A preset question-answer pair template is obtained, and a target question-answer pair of the target drug instructions is constructed according to the preset question-answer pair template, and the first target node, the second target node, and the third target node that have a connection relationship.
[0010] According to another aspect of the present invention, a question-answer pair generating device is provided, the device comprising:
[0011] A named entity recognition module, used to obtain a target drug instruction sheet, and perform named entity recognition on the target drug instruction sheet to obtain at least two target entities contained in the target drug instruction sheet;
[0012] An association detection module, used to perform association detection on each of the target entities;
[0013] A content undirected graph construction module, used to generate a target node according to each of the target entities, connect the target nodes corresponding to each of the target entities having an associated relationship, and construct a target undirected graph;
[0014] A target node level detection module is used to detect the level of each target node according to the connection relationship between each target node in the target undirected graph, and obtain a first target node, a second target node and a third target node; wherein the first target node is the root node of each target node; the second target node is connected to the first target node; and the third target node is connected to the second target node;
[0015] A target question-answer pair generation module is used to obtain a preset question-answer pair template, and construct a target question-answer pair of the target drug instructions based on the preset question-answer pair template and the first target node, the second target node and the third target node that have a connection relationship.
[0016] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0017] at least one processor; and
[0018] a memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the question-answer pair generation method described in any embodiment of the present invention.
[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the question-answer pair generation method described in any embodiment of the present invention when executed.
[0021] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the question-answer pair generating method described in any embodiment of the present invention is implemented.
[0022] The technical solution of the embodiment of the present invention obtains the target drug instructions and performs named entity recognition on the target drug instructions to obtain at least two target entities contained in the target drug instructions, performs association detection on each target entity, generates a target node according to each target entity, connects the target nodes corresponding to each target entity with an association relationship, constructs a target undirected graph, detects the level of each target node according to the connection relationship between each target node in the target undirected graph, obtains the first target node, the second target node and the third target node, and realizes pre-identification of the content and structure of the target drug instructions, obtains a preset question-answer pair template, and constructs a target question-answer pair of the target drug instructions according to the preset question-answer pair template and the first target node, the second target node and the third target node with a connection relationship, introduces a preset question-answer pair template, realizes rapid construction of the target question-answer pair of the target drug instructions, generates a target question-answer pair based on the first target node, the second target node and the third target node, and improves the pertinence and applicability of the target question-answer pair of the target drug instructions.
[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 is a flowchart of a method for generating question-answer pairs according to Embodiment 1 of the present invention;
[0026] Figure 2 is a flowchart of a method for generating question-answer pairs according to Embodiment 2 of the present invention.
[0027] Figure 3 is a schematic diagram of the structure of a target undirected graph applicable to Embodiment 2 of the present invention;
[0028] Figure 4 is a schematic diagram of the structure of a question-answer pair generating device provided according to Embodiment 3 of the present invention;
[0029] Figure 5 It is a structural schematic diagram of an electronic device for implementing the question-answer pair generating method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] Embodiment 1
[0033] Figure 1 A flowchart of a question-answer pair generation method provided in Embodiment 1 of the present invention. The embodiment of the present invention can be applied to the case of generating question-answer pairs based on drug instructions. The method can be performed by a question-answer pair generation device, which can be implemented in the form of hardware and / or software. The question-answer pair generation device can be configured in an electronic device that carries the question-answer pair generation function, such as a question-answer robot.
[0034] See also Figure 1 The question-answer pair generation method shown includes:
[0035] S110, obtaining a target drug instruction sheet, and performing named entity recognition on the target drug instruction sheet to obtain at least two target entities contained in the target drug instruction sheet.
[0036] The target drug instructions may be the drug instructions for which the question-answer pair is to be generated. Exemplarily, the content of the target drug instructions may include, but is not limited to, information such as drug name, specifications, ingredients, indications, usage and dosage, contraindications, precautions, adverse reactions, properties, drug interactions, storage and expiration date. Drug instructions play an important guiding role in the use of drugs. Compared with other texts, the content of drug instructions is highly standardized. It can be understood that drug instructions are data with a specific structural form, with a title and a text, and the text also has a strict format. Moreover, with new discoveries and research progress in the clinical application of drugs, drug instructions may be continuously updated and revised.
[0037] The target entity may be the smallest unit of the target drug instructions. Exemplarily, the target entity may include, but is not limited to, the drug name, specification, ingredients, indications, usage and dosage, contraindications, precautions, adverse reactions, properties, drug interactions, storage, and expiration date, as well as the specific contents corresponding to the specifications, ingredients, indications, usage and dosage, contraindications, precautions, adverse reactions, properties, drug interactions, storage, and expiration date. By performing named entity recognition on the target drug instructions and determining the target entity, the semantic understanding of the target drug instructions can be more deeply performed, which helps to more accurately understand the contents of the entire target drug instructions.
[0038] Specifically, the target drug instructions to be processed may be obtained, and a named entity recognition model (NER) may be used to perform named entity recognition on the target drug instructions, and at least two target entities contained in the target drug instructions may be output.
[0039] S120: Perform association detection on each target entity.
[0040] Specifically, natural language processing (NLP) technology, machine learning algorithms, deep learning models and data mining technologies can be used to detect the association relationship of each target entity contained in the target drug instructions to determine whether there is an association relationship between each target entity. Among them, natural language processing technology can perform lexical analysis, syntactic analysis and semantic understanding on the target drug instructions, and detect the association relationship of each target entity contained in the target drug instructions. Machine learning algorithms can include classification algorithms (such as decision trees or random forests, etc.) or regression algorithms, etc. Deep learning models can include convolutional neural networks, recurrent neural networks or attention mechanism models, etc. Data mining technologies can include association rule mining or cluster analysis, etc.
[0041] S130 , generating target nodes according to each target entity, and connecting the target nodes corresponding to each target entity having an association relationship to construct a target undirected graph.
[0042] The target node can be a node in the target undirected graph. There is a one-to-one correspondence between the target node and the target entity. The target undirected graph can be used to characterize the content structure relationship of the target drug instructions. It can be understood that the target entity is the content splitting result of the target drug instructions. The target undirected graph is a structural relationship combing of the content splitting results of the target drug instructions. Due to the high standardization and timeliness of drug instructions, the relationship combing of the content splitting results of drug instructions can facilitate the subsequent update of question and answer pairs. It can be understood that when the target drug instructions are detected to be updated, the target undirected graph corresponding to the target drug instructions can be updated, thereby quickly updating the target question and answer pair.
[0043] Optionally, the content of the target entity may be directly used as the content of the target node; the target entity may be identified, and the identified content of the target entity may be used as the content of the target node.
[0044] Specifically, the target nodes corresponding to the target entities having the association relationship may be connected to construct a target undirected graph.
[0045] S140. According to the connection relationship between each target node in the target undirected graph, the level of each target node is detected to obtain a first target node, a second target node, and a third target node.
[0046] The level of the target node can be used to characterize the degree of refinement of the content of the target entity corresponding to the target node in the target drug instructions. The higher the level of the target node, the broader the content of the target entity corresponding to the target node; the lower the level of the target node, the more refined the content of the target entity corresponding to the target node. The target node may include a first target node, a second target node, and a third target node. Among them, the level of the first target node is higher than the level of the second target node; the level of the second target node is higher than the level of the third target node. Among them, the first target node is the root node of each target node. The second target node is connected to the first target node. The third target node is connected to the second target node. The first target node is the root node of each target node, and it can be understood that the first target node can be used to characterize the target drug instructions. Exemplarily, the first target node can be the name of the drug corresponding to the target drug instructions. The second target node corresponds to the first target node, which can be understood as the second target node can be the content structure identifier corresponding to the target drug instructions, for example, the specification identifier, ingredient identifier, indication identifier, usage and dosage identifier, contraindication identifier, precaution identifier, adverse reaction identifier, property identifier, drug interaction identifier, storage identifier or validity period identifier in the target drug instructions. The third target node is connected to the second target node, which can be understood as the content of the target entity corresponding to the third target node can be the specific content of the target entity corresponding to the second target node.
[0047] In an optional embodiment of the present invention, the first target node is the name of the drug in the target drug instructions; the second target node includes the specification name, ingredient name, indication name, usage and dosage name, contraindication name, precaution name, adverse reaction name, property name, drug interaction name, storage name or expiration date name in the target drug instructions; the third target node includes the specific content of the specification, the specific content of the ingredient, the specific content of the indication, the specific content of usage and dosage, the specific content of the contraindication, the specific content of the precaution, the specific content of the adverse reaction, the specific content of the property, the specific content of the drug interaction, the specific content of the storage or the specific content of the expiration date.
[0048] The drug name can be used to identify the target drug instructions. Exemplarily, the drug name can include the drug's official name, drug common name or drug alias, etc. The specification name can be used to identify the location of the specific content of the drug's specifications. The ingredient name can be used to identify the location of the specific content of the drug's ingredients. The indication name can be used to identify the location of the specific content of the drug's indications. The usage and dosage name can be used to identify the location of the specific content of the drug's usage and dosage. The contraindication name can be used to identify the location of the specific content of the drug's contraindications. The precautions name can be used to identify the location of the specific content of the drug's precautions. The adverse reaction name can be used to identify the location of the specific content of the drug's adverse reactions. The property name can be used to identify the location of the specific content of the drug's properties. The drug interaction name can be used to identify the location of the specific content of the drug's drug interactions. The storage name can be used to identify the location of the specific content of the drug's storage. The expiration date name can be used to identify the location of the specific content of the drug's expiration date.
[0049] The specific content of the specification can be used to characterize the physical form and content of the drug. For example, the specific content of the specification may include dosage specifications, dosage form specifications and packaging specifications. Among them, the dosage specification can be used to characterize the amount of active ingredients in the drug. For example, the amount of active ingredients contained in a tablet, such as "50 mg per tablet"; another example is the concentration and volume of the drug in an injection, such as "10ml: 2g" means that 10 ml of solution contains 2 grams of drug. Dosage form specifications can be used to characterize the physical form of the drug. For example, tablets, capsules, suppositories or aerosols. The same drug may have different dosage form specifications to meet different medication needs and patient groups. The packaging specification refers to the quantity or volume of the drug contained in the packaging of the drug. For example, there are 10 tablets or 20 pills in a box of medicine; another example is that a bottle of medicine has 100 ml.
[0050] The specific content of the ingredients is the chemical substances that make up the drug. The specific content of the ingredients usually includes the main active ingredient, excipient ingredients and additives. Among them, the main active ingredient is the key ingredient that exerts a therapeutic effect. For example, acetylsalicylic acid in aspirin has antipyretic and analgesic effects. Excipient ingredients can help the drug to form, stabilize and facilitate taking. For example, fillers, adhesives, lubricants, preservatives, etc. Common excipients include starch, microcrystalline cellulose or magnesium stearate. Additives may include substances that improve taste, color or smell. Different ingredients determine its efficacy, applicable symptoms, side effects and contraindications.
[0051] The specific content of the indication refers to the disease, symptom or medical condition that the drug is suitable for treating or preventing. For example, the indication of antihypertensive drugs is usually high blood pressure; the indication of antipyretic drugs is fever; the indication of antibiotics may be diseases caused by various bacterial infections. The determination of drug indications is based on rigorous clinical trials and medical research: in clinical trials, researchers will evaluate the efficacy of drugs on specific diseases or symptoms. Only when the drug is proven to be effective and safe to a certain extent can its related indications be approved. The specific content of the indication is usually clear and specific, with specificity and accuracy, and will clearly indicate the specific disease name, symptom type or stage of the disease; vague or inaccurate descriptions can be avoided to ensure that doctors and patients can accurately understand the scope of application of the drug. In short, the specific content of the indication is an important basis for the selection and use of drugs, and is of key significance to ensure the treatment effect and drug safety of patients.
[0052] The specific content of usage and dosage is the key information to guide patients to use the medicine correctly. "Usage" usually includes the route of administration and the time interval between medications. Exemplary, the route of administration may include oral, topical, injection (including intramuscular injection, intravenous injection, etc.) or inhalation, etc. For example, oral medications may be taken several times a day, before, after or during meals; topical medications may be applied to the affected area several times a day, etc. The time interval between medications can clearly specify the time interval between each medication. For example, once every 8 hours or once a day, etc. "Dosage" involves specific dosages, which can be expressed in weight, volume or quantity. For example, a few tablets, a few pills or a few milliliters are taken each time. It can be adjusted according to factors such as the patient's age, weight or severity of the disease. For example, children's dosage is usually less than that of adults, and critically ill patients may need to increase the dosage.
[0053] The specific content of contraindications refers to situations where a certain drug should not be used or needs to be used with special caution under certain circumstances. The specific content of contraindications usually includes absolute contraindications and relative contraindications. Among them, absolute contraindications can mean that certain groups of people absolutely cannot use the drug or it is strictly prohibited to use it under certain disease conditions. For example, patients who are allergic to a certain drug component are strictly prohibited from using drugs containing that component. For another example, patients with severe liver and kidney dysfunction may be prohibited from using certain drugs that are mainly metabolized by the liver or kidneys. Relative contraindications can mean that it is necessary to use it with caution under certain conditions and decide whether to use the drug after weighing the pros and cons. For example, there may be risks when pregnant or breastfeeding women use certain drugs, but if the disease seriously threatens health, the doctor may weigh whether to use the drug based on the specific situation. When other drugs are used at the same time, there may be interactions and become contraindications. For example, some drugs may cause low blood pressure when used in combination with specific antihypertensive drugs. Contraindications are crucial to ensure the safety of medication and avoid adverse consequences.
[0054] The specific content of precautions is various information that needs special attention when using the drug. The specific content of precautions includes but is not limited to dietary restrictions, special populations, drug interactions, adverse reaction monitoring, storage conditions, medication compliance, or the impact of driving and operating machines. Among them, dietary restrictions may require certain drugs to avoid eating specific foods during medication, such as avoiding drinking when taking certain antibiotics. Special populations can be the elderly, children, and those with liver and kidney dysfunction, who may need to adjust the dose or strengthen monitoring when using the drug. Drug interactions can be used to indicate the possible effects of using the drug with other drugs at the same time, such as the combination of certain antihypertensive drugs and hypoglycemic drugs may affect blood sugar levels. Adverse reaction monitoring can be used to inform patients of common adverse reactions that may occur and what symptoms require timely medical treatment. Storage conditions can be used to explain how drugs should be stored correctly, such as avoiding light or refrigeration. Medication compliance can be used to emphasize the importance of taking drugs on time according to the prescribed usage and dosage. The impact of driving and operating machines can be used to characterize that certain drugs may cause drowsiness, dizziness, etc., affecting the ability to drive and operate precision instruments. For example, the precautions for a drug for insomnia may include avoiding driving and operating dangerous machinery during medication, not using it at the same time as other central nervous system depressants, or starting the drug with a small dose for the elderly. The specific content of the drug precautions provides patients with more comprehensive and detailed medication guidance, which helps to improve the safety and effectiveness of medication.
[0055] Adverse reactions specifically refer to harmful reactions that are unrelated to the purpose of medication and occur when qualified drugs are used in normal dosage and usage. Adverse drug reactions can manifest in a variety of ways, including but not limited to common physical symptoms, more serious symptoms, or long-term potential effects. Among them, common physical symptoms may include headache, dizziness, nausea, vomiting, diarrhea, rash, itching, or fever. More serious symptoms may involve damage to organ function, such as abnormal liver function, kidney damage, or cardiac toxicity. Allergic reactions, in severe cases, may lead to anaphylactic shock. Long-term potential effects may include that certain drugs may cause chronic diseases or increase the risk of certain diseases after long-term use.
[0056] The specific content of properties refers to the physical characteristics and appearance of the drug. The specific content of properties may include appearance, smell, texture or solubility characteristics. Among them, appearance may include the color or properties of the drug. For example, the color may include white, yellow or brown. For example, the shape of the tablet may include round or oval, and the capsule may be an oblong cylinder. The smell can be used to characterize a special smell, such as aromatic, pungent or odorless. Texture, such as whether the tablet is hard or soft, and whether the suppository is soft or hard. Solubility characteristics can be used to describe the dissolution of the drug in different solvents (such as water or ethanol). For patients, understanding the specific content of the properties of the drug helps to correctly identify and use the drug. For example, the properties of a certain antipyretic may be a white round tablet with no smell; a certain cough syrup may be a brown liquid with a slight sweet and medicinal taste.
[0057] The specific content of drug interaction refers to the mutual influence between drugs when two or more drugs are used simultaneously or successively. This interaction may occur in the process of drug absorption, distribution, metabolism and excretion, thereby changing the efficacy of the drug or increasing the risk of adverse reactions. The specific content of drug interaction mainly includes pharmacodynamic interaction and pharmacokinetic interaction. Among them, pharmacodynamic interaction can include synergistic effect or antagonistic effect. Among them, synergistic effect can be the enhancement of drug efficacy when two drugs are used in combination. For example, the combined use of certain antibiotics can enhance the bactericidal effect. Antagonistic effect can be the weakening of drug efficacy when drugs are used in combination. For example, one drug promotes nerve excitation, while another drug inhibits nerve excitation. Pharmacokinetic interaction can include affecting absorption, affecting distribution, affecting metabolism or affecting excretion. Among them, affecting absorption can be that one drug may change the pH value or peristalsis of the gastrointestinal tract, thereby affecting the absorption of another drug. For example, antacids may reduce the absorption of certain antibiotics. Influencing distribution can be that some drugs may compete with plasma proteins for binding, resulting in an increase in free drug concentration, thereby enhancing drug efficacy or increasing toxicity. The effect on metabolism may be that one drug may induce or inhibit the activity of liver enzymes, thereby affecting the metabolism of another drug. For example, rifampicin can induce liver enzymes, accelerate the metabolism of certain drugs, and reduce their efficacy. The effect on excretion may be that one drug may change the secretion or reabsorption of renal tubules, affecting the excretion of another drug.
[0058] The specific content of storage refers to the conditions and methods for preserving and storing drugs. The specific content requirements of storage usually include temperature, humidity, light protection, airtightness and sealing, and special environments. Among them, the temperature can include room temperature (generally 10-30°C), refrigeration (2-8°C) or freezing (below 0°C). For example, insulin usually needs to be refrigerated, while some live bacterial preparations may need to be frozen. In terms of humidity, some drugs have strict requirements on environmental humidity and may need to be stored in a dry place to prevent moisture and deterioration. In terms of light protection, some drugs need to avoid direct sunlight or strong light, and may require storage in light-shielded containers or dark places. For example, sodium nitroprusside solution needs to be stored in the dark. Airtightness means sealing the container to prevent dust and foreign matter from entering. Sealing means sealing the container to prevent weathering, moisture absorption, volatilization or foreign matter from entering. Special environments may be that some drugs need to be stored in a specific gas environment, such as a nitrogen environment. Correct drug storage is essential to ensure the quality, stability and efficacy of drugs. For example, if vitamin C tablets are exposed to high temperature, high humidity and strong light for a long time, they are prone to oxidation and deterioration, affecting the efficacy. If the medicine is not stored properly, it may become ineffective, deteriorate, or even produce harmful substances, which may cause harm to the human body after use.
[0059] The specific content of the validity period refers to the period during which the drug can maintain qualified quality under the prescribed storage conditions. During the validity period, the composition, efficacy and safety of the drug can be guaranteed. The expression of the validity period of the drug usually includes directly indicating the validity period, indicating the expiration date, or indicating the production batch number and the validity period. Among them, directly indicating the validity period, such as "valid until August 2025", means that the drug can be used until August 31, 2025. Indicating the expiration date, such as "expiration date February 2026", means that the drug cannot be used after January 31, 2026. Indicating the production batch number and the validity period can be determined by calculating the production date corresponding to the production batch number, and then combining the validity period to determine the specific period of use. It should be noted that the efficacy and safety of the drug can only be ensured if it is used within the validity period. If the drug exceeds the validity period, the efficacy may be reduced, the ingredients may deteriorate, and harmful substances may be produced. After use, it may not only fail to treat the disease, but also cause damage to the body. For example, an antibiotic can effectively kill bacteria within its validity period, but after the expiration date, it may not achieve the expected bactericidal effect, and may even cause adverse reactions such as allergies. Therefore, when using medicines, you must pay attention to the expiration date of the medicine and avoid using expired medicines.
[0060] This solution takes into account the typical format of drug instructions, and further improves the efficiency of constructing question-answer pairs based on drug instructions by concretizing the first target node as the drug name in the target drug instructions, the second target node as the specification name, ingredient name, indication name, usage and dosage name, contraindication name, precaution name, adverse reaction name, property name, drug interaction name, storage name or expiration date name in the target drug instructions, and concretizing the third target node as the specific content of the specification, the specific content of the ingredient, the specific content of the indication, the specific content of usage and dosage, the specific content of the contraindication, the specific content of precaution, the specific content of the adverse reaction, the specific content of the property, the specific content of the drug interaction, the specific content of the storage or the specific content of the expiration date.
[0061] Specifically, the connection relationship between each target node in the target undirected graph can be detected, and the root node of each target node can be determined as the first target node. Each target node connected to the first target node can be determined as the second target node. Each target node connected to the second target node can be determined as the third target node.
[0062] S150. Obtain a preset question-answer pair template, and construct a target question-answer pair of a target drug instruction sheet according to the preset question-answer pair template, and a first target node, a second target node, and a third target node having a connection relationship.
[0063] The preset question-answer pair template can be used to generate a target question-answer pair. The preset question-answer pair template has a specific question-answer format. The preset question-answer pair template may include a preset question template and a corresponding preset answer template. The target question-answer pair can be used to ask and answer questions for the target drug instructions. Among them, the questioner corresponding to the target question-answer pair is the drug instructions query party; the answerer corresponding to the target question-answer pair is a question-answer robot, a question-answer client or a question-answer server, etc.
[0064] Specifically, a preset question-and-answer template set by a technician based on experience may be obtained. A target question may be generated based on a first target node and a second target node having a connection relationship according to the preset question template. A target answer may be generated based on a third target node having a connection relationship with the second target node according to a preset answer template. The target question and the target answer are combined to obtain a target question-and-answer pair of a target drug instruction sheet.
[0065] In an optional embodiment of the present invention, a target question and answer pair of a target drug instruction sheet is constructed according to a preset question and answer pair template, and a first target node, a second target node, and a third target node having a connection relationship, including: determining a first position of the first target node in a target question, a second position of the second target node in the target question, and a third position of the third target node in a target answer according to the preset question and answer pair template; filling the target entity corresponding to the first target node in the first position, and filling the target entity corresponding to the second target node having a connection relationship with the first target node in the second position, to generate a target question; filling the target entity corresponding to the third target node having a connection relationship with the second target node in the third position, to generate a target answer to the target question; generating a target question and answer pair of the target drug instruction sheet according to the target question and the target answer.
[0066] The target question-answer pair may include a target question and a target answer. Based on the target drug instructions, at least one pair of target question-answer pairs may be generated. The first position may be the position of the first target node in the target question. The second position may be the position of the second target node in the target question. The third position may be the position of the third target node in the target answer. It can be understood that the content of the target entity corresponding to the third target node may be located based on the first target node and the second target node. Thus, it is possible to quickly answer specific questions involved in the target drug instructions.
[0067] Specifically, the first position of the first target node in the target question, the second position of the second target node in the target question, and the third position of the third target node in the target answer can be determined according to the preset question-answer pair template. The target entity corresponding to the first target node can be filled in the first position, and the target entity corresponding to the second target node having a connection relationship with the first target node can be filled in the second position to generate the target question, and the target entity corresponding to the third target node having a connection relationship with the second target node can be filled in the third position to generate the target answer to the target question. The target question and the target answer can be combined to generate a target question-answer pair of the target drug instructions.
[0068] This solution introduces the first position, the second position and the third position, and can quickly construct a target question and answer pair of a target drug instruction manual based on the first target node, the second target node and the third target node, thereby improving the construction efficiency of the target question and answer pair.
[0069] The technical solution of the embodiment of the present invention obtains the target drug instructions and performs named entity recognition on the target drug instructions to obtain at least two target entities contained in the target drug instructions, performs association detection on each target entity, generates a target node according to each target entity, connects the target nodes corresponding to each target entity with an association relationship, constructs a target undirected graph, detects the level of each target node according to the connection relationship between each target node in the target undirected graph, obtains the first target node, the second target node, and the third target node, thereby realizing pre-identification of the content and structure of the target drug instructions, obtains a preset question-answer pair template, and constructs a target question-answer pair of the target drug instructions according to the preset question-answer pair template and the first target node, the second target node, and the third target node with a connection relationship, introduces a preset question-answer pair template, and realizes rapid construction of the target question-answer pair of the target drug instructions; generates a target question-answer pair based on the first target node, the second target node, and the third target node, thereby improving the pertinence and applicability of the target question-answer pair of the target drug instructions.
[0070] Embodiment 2
[0071] Figure 2 A flowchart of a method for generating question and answer pairs provided in the second embodiment of the present invention. Based on the above embodiments, the embodiment of the present invention further adds "obtaining the question to be queried filled in by the drug instructions query party according to the preset question and answer pair template; according to the question to be queried, searching for the target question and target answer that match the question to be queried in the alternative questions of each pre-stored alternative question and answer pair, and feeding back the target answer to the drug instructions query party", which improves the pertinence and efficiency of drug instructions information query. It should be noted that for the parts not described in detail in the embodiments of the present invention, please refer to the description of other embodiments.
[0072] See also Figure 2 The question-answer pair generation method shown includes:
[0073] S210: Obtain a target drug instruction sheet, and perform named entity recognition on the target drug instruction sheet to obtain at least two target entities contained in the target drug instruction sheet.
[0074] S220: Perform association detection on each target entity.
[0075] S230 , generating target nodes according to each target entity, connecting the target nodes corresponding to each target entity having an association relationship, and constructing a target undirected graph.
[0076] S240. According to the connection relationship between each target node in the target undirected graph, the level of each target node is detected to obtain a first target node, a second target node, and a third target node; wherein the first target node is the root node of each target node; the second target node is connected to the first target node; and the third target node is connected to the second target node.
[0077] S250. Obtain a preset question-answer pair template, and construct a target question-answer pair of a target drug instruction sheet according to the preset question-answer pair template, and a first target node, a second target node, and a third target node having a connection relationship.
[0078] S260, obtaining the questions to be queried filled in by the party inquiring about the drug instructions according to the preset question and answer template.
[0079] The drug instructions querying party may be a party that queries the drug instructions. The question to be queried may be used to query the target drug instructions. The question to be queried may be sent by the drug instructions querying party. The format of the question to be queried may be the format of a preset question template in a preset question-answer pair template.
[0080] Specifically, the drug instructions query party can fill in the questions to be queried according to the preset question template in the preset question-answer pair template and send it to the device. The device can obtain the questions to be queried filled in by the drug instructions query party according to the preset question-answer pair template.
[0081] In an optional embodiment of the present invention, after obtaining the question to be queried filled in by the drug instructions inquirer according to a preset question-answer template, it also includes: according to the two second target nodes corresponding to the question to be queried, obtaining a first target node that has a connection relationship with both second target nodes; when it is detected that the second target node does not have a corresponding third target node, replacing the second target node corresponding to the question to be queried with the first target node, and updating the question to be queried.
[0082] The query question corresponds to two second target nodes. It can be understood that when the drug instructions query party inputs the query question, it may not be the correct name of the drug instructions, but the alias of the drug instructions or the common name of the drug instructions. At this time, there will be two second target nodes corresponding to the query question. When generating the target question-answer pair for the target drug instructions, the drug alias (or drug common name) corresponding to the target drug instructions can be used as the second target node in the target undirected graph. Therefore, when the drug instructions query party inputs the query question containing two second target nodes, that is, when the drug instructions query party inputs the drug alias (or drug common name) to query the target drug instructions, the drug alias (or drug common name) can be first converted into the correct name of the drug, and then the query question using the correct name of the drug can be updated. The first target node that has a connection relationship with both second target nodes can be understood as the first target node being the correct name of the drug in the target drug instructions; one of the second target nodes includes the drug alias in the target drug instructions. The second target node does not have a corresponding third target node, which can be understood as the second target node corresponding to the drug alias (or drug common name). Replacing the second target node corresponding to the query question with the first target node can be understood as converting the drug alias (or drug common name) into the drug's proper name.
[0083] Specifically, after obtaining the query question filled in by the drug instruction manual query party according to the preset question-answer pair template, the first target node having a connection relationship with both second target nodes can be obtained according to the two second target nodes corresponding to the query question, that is, the first target node corresponding to the drug's correct name. When it is detected that the second target node does not have a corresponding third target node, that is, the second target node corresponding to the drug's alias is determined, the second target node corresponding to the query question can be replaced with the first target node, and the query question can be updated.
[0084] This solution obtains the question to be queried filled in by the drug instructions query party according to a preset question-answer template, and then obtains the first target node that has a connection relationship with the two second target nodes corresponding to the question to be queried. When it is detected that the second target node does not have a corresponding third target node, the second target node corresponding to the question to be queried is replaced by the first target node, and the question to be queried is updated. When the question to be queried input by the drug instructions query party contains a drug alias, the update of the question to be queried is achieved, which can improve the accuracy of querying drug instructions based on the question to be queried.
[0085] S270. According to the question to be queried, the target question and target answer matching the question to be queried are searched in the candidate questions of each pre-stored candidate question-answer pair, and the target answer is fed back to the drug instructions querying party.
[0086] The alternative question-answer pair may be a pre-generated question-answer pair. The alternative question-answer pair may be pre-stored in a database. After the target question-answer pair of the target drug instructions is generated, it may be stored in the database. Optionally, the target question-answer pair may be vectorized and then stored in the database. The alternative question may be a question in the alternative question-answer pair. The alternative answer may be an answer in the alternative question-answer pair. The target question may be a question that matches the question to be queried. The target answer may be an answer corresponding to the target question.
[0087] Specifically, similarity matching can be performed between the question to be queried and the alternative questions of the pre-stored alternative question-answer pairs, and the alternative question with the highest similarity to the question to be queried can be queried to obtain the target question and target answer that match the question to be queried, and the target answer can be fed back to the party inquiring about the drug instructions.
[0088] The technical solution of the embodiment of the present invention obtains the question to be queried filled in by the drug instructions inquirer according to a preset question-answer pair template, and searches for a target question and a target answer that match the question to be queried among the alternative questions of each pre-stored alternative question-answer pair according to the question to be queried, and feeds back the target answer to the drug instructions inquirer, thereby enabling the drug instructions inquirer to query the specific content of the target drug instructions, thereby improving the pertinence and efficiency of drug instructions information query.
[0089] For example, Figure 3 It is a structural diagram of the target undirected graph. For drug instructions, it usually contains information such as drug name, specifications, ingredients, indications, usage and dosage, contraindications, precautions, adverse reactions, properties, drug interactions, storage and expiration date. First, for the content of drug instructions, argument recognition and event division can be performed. Among them, the argument refers to the smallest unit in the instructions, that is, the target entity, such as drug name, oseltamivir, specifications, 1 box, ingredients, indications, influenza A, usage and dosage, contraindications, precautions, adverse reactions, properties, drug interactions, storage and expiration date. The event is the content composed of matching arguments, that is, the association relationship between target entities. For example, the argument is "usage and dosage" and the argument "external use, 2 times a day"; the constituent event is "usage and dosage: external use, 2 times a day". The NER named entity recognition model can be used to extract the entities of the drug instructions. An undirected graph can be used to represent event division. It can be understood that the arguments of the same event are related. Each argument is regarded as a node. If they belong to an event, they are connected by lines. The identification information of each target entity can be used to determine the name of the target node. Figure 3As shown, a single argument can be the identification information of the target entity. For example, AV. In the same drug instruction, the drug name can be used as the first target node, for example, the D node. The names of specifications and ingredients can be used as the second target node, for example, the AC node and the EL node. The specific answer information content can be used as the third target node, for example, the MV node. In the process of constructing a question-answer pair, the "second target node" of the "first target node" can be used as a preset question template; the "third target node" can be used as a preset answer template. For example, the target question is "What are the indications for oseltamivir phosphate?" The target answer is "Influenza A and B in adults and children over 1 year old". The drug question-answering robot can match the similarity of the question to be queried by the query party of the drug instruction and the various alternative questions in its own knowledge base, and then select the answer to answer. This scheme takes into account that the drug instruction is basically data with a specific structure, with a title and a body. By converting long text content into question-answer pairs, an accurate and efficient local knowledge base can be quickly constructed, and the question-answering dataset in it can realize the rapid answer of the drug question-answering robot.
[0090] Embodiment 3
[0091] Figure 4 A schematic diagram of the structure of a question-answer pair generation device provided in Embodiment 3 of the present invention. The embodiment of the present invention can be applied to the case of generating question-answer pairs based on drug instructions, the device can execute the question-answer pair generation method, the device can be implemented in the form of hardware and / or software, and the device can be configured in an electronic device that carries the question-answer pair generation function, such as a question-answering robot.
[0092] See also Figure 4The question-answer pair generating device shown includes: a named entity recognition module 410, an association relationship detection module 420, a content undirected graph construction module 430, a target node level detection module 440 and a target question-answer pair generating module 450. Among them, the named entity recognition module 410 is used to obtain the target drug instructions and perform named entity recognition on the target drug instructions to obtain at least two target entities contained in the target drug instructions; the association detection module 420 is used to perform association detection on each target entity; the content undirected graph construction module 430 is used to generate a target node according to each target entity, connect the target nodes corresponding to each target entity with an association relationship, and construct a target undirected graph; the target node level detection module 440 is used to detect the level of each target node according to the connection relationship between each target node in the target undirected graph to obtain a first target node, a second target node and a third target node; wherein the first target node is the root node of each target node; the second target node is connected to the first target node; the third target node is connected to the second target node; the target question and answer pair generation module 450 is used to obtain a preset question and answer pair template, and construct a target question and answer pair of the target drug instructions according to the preset question and answer pair template, and the first target node, the second target node and the third target node with a connection relationship.
[0093] The technical solution of the embodiment of the present invention obtains the target drug instructions and performs named entity recognition on the target drug instructions to obtain at least two target entities contained in the target drug instructions, performs association detection on each target entity, generates a target node according to each target entity, connects the target nodes corresponding to each target entity with an association relationship, constructs a target undirected graph, detects the level of each target node according to the connection relationship between each target node in the target undirected graph, obtains the first target node, the second target node, and the third target node, thereby realizing pre-identification of the content and structure of the target drug instructions, obtains a preset question-answer pair template, and constructs a target question-answer pair of the target drug instructions according to the preset question-answer pair template and the first target node, the second target node, and the third target node with a connection relationship, introduces a preset question-answer pair template, and realizes rapid construction of the target question-answer pair of the target drug instructions; generates a target question-answer pair based on the first target node, the second target node, and the third target node, thereby improving the pertinence and applicability of the target question-answer pair of the target drug instructions.
[0094] In an optional embodiment of the present invention, the device also includes: a module for obtaining a question to be queried, which is used to obtain the question to be queried filled in by the drug instructions querying party according to a preset question and answer pair template after constructing the target question and answer pair of the target drug instructions; a module for querying alternative questions that match the question to be queried based on the question to be queried; and a target answer feedback module, which is used to determine the alternative answers corresponding to the alternative questions as the target answers and feedback them to the drug instructions querying party.
[0095] In an optional embodiment of the present invention, the first target node is the correct name of the drug in the target drug instructions; the second target node includes the alias of the drug in the target drug instructions; the question to be queried corresponds to two second target nodes; accordingly, the device also includes: a first target node determination module, which is used to obtain the question to be queried filled in by the drug instructions query party according to a preset question and answer template, and then, according to the two second target nodes corresponding to the question to be queried, obtain the first target node that has a connection relationship with both second target nodes; a question to be queried update module, which is used to replace the second target node corresponding to the question to be queried with the first target node when it is detected that the second target node does not have a corresponding third target node, and update the question to be queried.
[0096] In an optional embodiment of the present invention, the target question and answer pair generation module 450 includes: a first position determination unit, which is used to determine the first position of the first target node in the target question, the second position of the second target node in the target question, and the third position of the third target node in the target answer according to a preset question and answer pair template; a target question generation unit, which is used to fill the target entity corresponding to the first target node in the first position, and the target entity corresponding to the second target node having a connection relationship with the first target node in the second position, to generate the target question; a target answer generation unit, which is used to fill the target entity corresponding to the third target node having a connection relationship with the second target node in the third position, to generate the target answer to the target question; a target question and answer pair generation unit, which is used to generate a target question and answer pair of a target drug instruction sheet according to the target question and the target answer.
[0097] In an optional embodiment of the present invention, the first target node is the name of the drug in the target drug instructions; the second target node includes the specification name, ingredient name, indication name, usage and dosage name, contraindication name, precaution name, adverse reaction name, property name, drug interaction name, storage name or expiration date name in the target drug instructions; the third target node includes the specific content of the specification, the specific content of the ingredient, the specific content of the indication, the specific content of usage and dosage, the specific content of the contraindication, the specific content of the precaution, the specific content of the adverse reaction, the specific content of the property, the specific content of the drug interaction, the specific content of the storage or the specific content of the expiration date.
[0098] The question-answer pair generation device provided in the embodiment of the present invention can execute the question-answer pair generation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0099] In the technical solution of the embodiment of the present invention, the acquisition, storage and application of the target drug instructions, the preset question-and-answer template and the questions to be queried filled in by the drug instructions inquiring party according to the preset question-and-answer template all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0100] Embodiment 4
[0101] Figure 5 A schematic diagram of the structure of an electronic device 500 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0102] like Figure 5 As shown, the electronic device 500 includes at least one processor 501, and a memory connected to the at least one processor 501 in communication, such as a read-only memory (ROM) 502, a random access memory (RAM) 503, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 501 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 502 or the computer program loaded from the storage unit 508 to the random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The processor 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0103] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0104] Processor 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of processor 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. Processor 501 performs the various methods and processes described above, such as a question-answer pair generation method.
[0105] In some embodiments, the question-answer pair generation method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the processor 501, one or more steps of the question-answer pair generation method described above may be performed. Alternatively, in other embodiments, the processor 501 may be configured to perform the question-answer pair generation method in any other appropriate manner (e.g., by means of firmware).
[0106] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0107] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0108] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0109] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0110] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0111] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS (Virtual Private Server) services.
[0112] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0113] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for generating question-answer pairs, characterized in that: The method comprises: Obtaining a target drug instruction sheet, and performing named entity recognition on the target drug instruction sheet to obtain at least two target entities contained in the target drug instruction sheet; Performing association detection on each of the target entities; Generate a target node according to each of the target entities, connect the target nodes corresponding to each of the target entities having an associated relationship, and construct a target undirected graph; According to the connection relationship between the target nodes in the target undirected graph, the level of each target node is detected to obtain a first target node, a second target node and a third target node; wherein the first target node is a root node of each target node; the second target node is connected to the first target node; and the third target node is connected to the second target node; A preset question-answer pair template is obtained, and a target question-answer pair of the target drug instructions is constructed according to the preset question-answer pair template, and the first target node, the second target node, and the third target node that have a connection relationship.
2. The method according to claim 1, characterized in that After constructing the target question-answer pair of the target drug instructions, the method further includes: Obtain the questions to be queried filled in by the drug instructions querying party according to the preset question and answer template; According to the question to be queried, a target question and a target answer matching the question to be queried are searched among the candidate questions of each pre-stored candidate question-answer pair, and the target answer is fed back to the drug instructions querying party.
3. The method according to claim 2, characterized in that The first target node is the drug name in the target drug instructions; the second target node includes the drug alias in the target drug instructions; the query question corresponds to two second target nodes; Accordingly, after the party obtaining the drug instructions inquiring fills in the query questions according to the preset question-answer pair template, it also includes: According to the two second target nodes corresponding to the query question, acquiring the first target node having a connection relationship with both the two second target nodes; When it is detected that the second target node does not have the corresponding third target node, the second target node corresponding to the question to be queried is replaced with the first target node, and the question to be queried is updated.
4. The method according to claim 1, characterized in that: The step of constructing the target question-answer pair of the target drug instruction sheet according to the preset question-answer pair template and the first target node, the second target node and the third target node having a connection relationship comprises: According to a preset question-answer pair template, determining a first position of the first target node in a target question, a second position of the second target node in the target question, and a third position of the third target node in a target answer; Fill the first position with the target entity corresponding to the first target node, and fill the second position with the target entity corresponding to the second target node that has a connection relationship with the first target node, to generate the target question; Filling the target entity corresponding to the third target node having a connection relationship with the second target node in the third position to generate a target answer to the target question; A target question-answer pair of the target drug instructions is generated according to the target question and the target answer.
5. The method according to claim 1, characterized in that The first target node is the drug name in the target drug instructions; the second target node includes the specification name, ingredient name, indication name, usage and dosage name, contraindication name, precaution name, adverse reaction name, property name, drug interaction name, storage name or expiration date name in the target drug instructions; the third target node includes the specific content of the specification, the specific content of the ingredient, the specific content of the indication, the specific content of usage and dosage, the specific content of the contraindication, the specific content of the precaution, the specific content of the adverse reaction, the specific content of the property, the specific content of the drug interaction, the specific content of the storage or the specific content of the expiration date.
6. A question-answer pair generating device, characterized in that: The device comprises: A named entity recognition module, used to obtain a target drug instruction sheet, and perform named entity recognition on the target drug instruction sheet to obtain at least two target entities contained in the target drug instruction sheet; An association detection module, used to perform association detection on each of the target entities; A content undirected graph construction module, used to generate a target node according to each of the target entities, connect the target nodes corresponding to each of the target entities having an associated relationship, and construct a target undirected graph; A target node level detection module is used to detect the level of each target node according to the connection relationship between each target node in the target undirected graph, and obtain a first target node, a second target node and a third target node; wherein the first target node is the root node of each target node; the second target node is connected to the first target node; and the third target node is connected to the second target node; A target question-answer pair generation module is used to obtain a preset question-answer pair template, and construct a target question-answer pair of the target drug instructions based on the preset question-answer pair template and the first target node, the second target node and the third target node that have a connection relationship.
7. The device according to claim 6, characterized in that The device also includes: A module for obtaining questions to be queried, used for obtaining questions to be queried filled in by the drug instructions querying party according to the preset question-answer pair template after constructing the target question-answer pair of the target drug instructions; An alternative question query module, used to query the alternative questions matching the question to be queried according to the question to be queried; The target answer feedback module is used to determine the alternative answers corresponding to the alternative questions as the target answers and feed back the target answers to the drug instructions query party.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the question-answer pair generating method according to any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the question-answer pair generation method according to any one of claims 1 to 5 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the question-answer pair generating method according to any one of claims 1 to 5.
