Precise query method and device for medication information, electronic equipment and storage medium

By using a large model for intent recognition and generic drug name extraction, combined with interactive selection and information filtering, the problems of inaccurate retrieval and incomplete information in the RAG solution were solved, thereby improving the accuracy of drug information query and the user experience.

CN121658504APending Publication Date: 2026-03-13WEDOC CLOUD (HANGZHOU) HLDG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511820433.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-04
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

The existing RAG solution suffers from problems such as insufficient retrieval accuracy, incomplete information coverage, poor user experience, and reliance on static data in medication information retrieval, which affect the accuracy and practicality of medication retrieval.

Method used

By using a large model for intent recognition and generic drug name extraction, an interactive drug selection control is provided, and drug instruction information is filtered to generate accurate answers.

Benefits of technology

It improves the accuracy, comprehensiveness, and user experience of drug information retrieval, ensuring that the search results match actual needs and are suitable for clinical decision support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121658504A_ABST
    Figure CN121658504A_ABST
Patent Text Reader

Abstract

The invention provides a medicine use information accurate query method and device, electronic equipment and a storage medium, and relates to the technical field of natural language process.The method comprises the steps that a natural language problem in a medicine use information query request is obtained; performing intention recognition, medicine general name extraction and required field extraction on the natural language question through the first large model to obtain a target intention, a target medicine general name and a target field; pushing a target control which corresponds to the target intention and is filled with all related drugs under the target drug general name to the user, so that the user can select the drugs; according to the target field, filtering the complete medicine specification information corresponding to the medicine identifier selected by the user to obtain target medicine specification information; and calling a second large model to generate a target answer according to the target drug specification information and the natural language question. According to the invention, the accuracy and comprehensiveness of medicine information query and the user experience are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, and in particular to a method, apparatus, electronic device, and storage medium for accurate drug information retrieval. Background Technology

[0002] With the deepening application of artificial intelligence technology in the medical field, Retrieval-Augmented Generation (RAG) has become a mainstream technical solution for building medication information query systems. The basic process of RAG is as follows: First, a large amount of drug instruction information (such as drug instructions, guidelines for medication use in special populations, drug interaction data, etc.) is preprocessed and stored in a vector database. When a user inputs a query (e.g., "interaction between cephalosporins and warfarin"), the system retrieves document fragments related to the query from the vector database through semantic similarity calculation. Then, these retrieved fragments are used as contextual information and input into a Large Language Model (LLM), which generates and outputs the answer. This approach relies on the accuracy of vector retrieval and aims to improve the quality of the Large Language Model's answer by enhancing the context.

[0003] Although the RAG scheme is widely used in information retrieval, it has several shortcomings in the current context: Insufficient search precision: Due to issues such as synonyms and confusion between generic and brand names in drug names, vector retrieval based on semantic similarity may not accurately match the specific drug the user intends to buy, resulting in irrelevant search results or omission of key information. For example, when a user searches for "cephalosporin," the search may not cover all cephalosporin drugs or may return irrelevant drugs.

[0004] Incomplete information coverage: Vector retrieval typically returns a limited number of document fragments, which may not provide complete information about drug instructions. Especially in scenarios involving multiple drug interactions, it is easy to overlook some important details, affecting the assessment of medication safety.

[0005] Poor user experience: The RAG solution lacks a user interaction mechanism, preventing users from confirming or selecting specific drugs during the search process, leading to search results that do not match actual needs. For example, when a user enters a vague drug name, the system directly returns the answer, which may cause misunderstandings or require multiple searches, reducing efficiency and user experience.

[0006] Reliance on static data: RAG solutions are usually based on pre-stored vector libraries, which makes it difficult to update drug information in real time. This may result in the inability to reflect the latest drug data and affect the timeliness of queries.

[0007] These shortcomings limit the accuracy and usability of medication information systems, especially in clinical decision-making, and may lead to medication errors or incomplete information. Summary of the Invention

[0008] The purpose of this invention is to provide a method, device, electronic device, and storage medium for accurate drug information query, so as to improve the accuracy, comprehensiveness, and user experience of drug information query.

[0009] In a first aspect, the present invention provides a method for accurately querying medication information, comprising: Natural language issues in obtaining medication information query requests; The first major model is used to perform intent recognition, drug generic name extraction, and required field extraction for natural language problems, resulting in the target intent, target drug generic name, and target fields; among which, the required fields refer to the key fields that need to be extracted from the drug instructions. Push a target control to the user that corresponds to the target intent and is populated with all related drugs under the target drug's generic name, so that the user can select a drug; Based on the target field, filter the complete drug instruction information corresponding to the drug identifier selected by the user to obtain the target drug instruction information; Based on the information in the target drug's instruction manual and the natural language question, the second major model is invoked to generate the target answer.

[0010] In an optional implementation, the first major model is used to perform intent recognition, drug generic name extraction, and required field extraction for the natural language problem, including: The first major model is used to perform entity recognition on natural language problems to obtain candidate drug names and their dosage forms. The candidate drug names and their dosage forms are then standardized to obtain the generic name of the target drug. The semantics of the natural language problem are determined by the first major model, and the target field is selected from the predefined fields.

[0011] In an optional implementation, the candidate drug names and their dosage form information are standardized to obtain the generic name of the target drug, including: When a candidate drug name is suspected of being fictitious, contains serious spelling errors, or is only similar in pronunciation to a standard drug name, it is prohibited to forcibly map it to a standard drug with a similar pronunciation. When a candidate drug name is obviously fictitious, has no corresponding standard drug, or its effectiveness cannot be confirmed, the standardization process for the candidate drug name is terminated.

[0012] In optional implementations, predefined fields include: action category, ingredients, properties, indications, dosage and administration, adverse reactions, contraindications, precautions, warnings, use in pregnant and lactating women, use in children, use in the elderly, drug interactions, drug overdose, clinical trials, drug toxicology, pharmacokinetics, storage, packaging, implementation standards, and expiration date.

[0013] In an optional implementation, a target control corresponding to the target intent and populated with all relevant drugs under the target drug's generic name is pushed to the user, including: The drug database is called to query all related drugs under the generic name of the target drug, and a list of the target drugs is obtained. Based on the pre-defined correspondence between intent and control type, determine the target control corresponding to the target intent; After populating the target drug list in the target control, push it to the user interface.

[0014] In an optional implementation, the complete drug instruction manual information corresponding to the drug identifier selected by the user is filtered according to the target field to obtain the target drug instruction manual information, including: Obtain complete drug instruction leaflet information based on the drug identifier selected by the user; By parsing text and matching fields, the content of the target fields is filtered out from the complete drug instruction manual information to obtain the target drug instruction manual information.

[0015] In an optional implementation, based on the target drug's package insert information and the natural language question, a second major model is invoked to generate the target answer, including: Using the target drug's instruction manual information as context, and combining it with natural language questions, prompt words are constructed; Input the prompt words into the second largest model to obtain the target answer generated by the second largest model.

[0016] Secondly, the present invention provides a device for accurately querying medication information, comprising: The acquisition module is used to retrieve natural language questions from medication information query requests; The extraction module is used to perform intent recognition, drug generic name extraction, and required field extraction for natural language questions through the first major model, to obtain the target intent, target drug generic name, and target fields; among which, the required fields refer to the key fields that need to be extracted from the drug instructions. The push module is used to push target controls to users that correspond to their target intent and are filled with all related drugs under the target drug's generic name, so that users can select drugs. The filtering module is used to filter the complete drug instruction information corresponding to the drug identifier selected by the user based on the target field, so as to obtain the target drug instruction information; The generation module is used to generate the target answer by calling the second major model based on the information in the target drug's instruction manual and the natural language question.

[0017] Thirdly, the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the method for accurately querying medication information in any of the foregoing embodiments.

[0018] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, performs the drug information accurate query method of any of the foregoing embodiments.

[0019] The present invention provides a method, apparatus, electronic device, and storage medium for accurate drug information query. The method includes: acquiring a natural language question from a drug information query request; performing intent recognition, generic drug name extraction, and required field extraction on the natural language question using a first large model to obtain the target intent, target generic drug name, and target fields; wherein, the required fields refer to key fields that need to be extracted from the drug's instruction manual; pushing a target control to the user that corresponds to the target intent and is filled with all related drugs under the target generic drug name, for the user to select a drug; filtering the complete drug instruction manual information corresponding to the drug identifier selected by the user based on the target fields to obtain the target drug instruction manual information; and calling a second large model to generate the target answer based on the target drug instruction manual information and the natural language question. This method, by using a large model to achieve intent recognition, generic drug name extraction, and required field extraction, combined with an interactive selection mechanism and information filtering, improves the accuracy, comprehensiveness, and user experience of drug information queries. Attached Figure Description

[0020] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0021] Figure 1 A flowchart illustrating a method for accurately querying medication information provided in an embodiment of the present invention; Figure 2 A schematic diagram of a first user interface provided for an embodiment of the present invention; Figure 3 A schematic diagram of a second user interface provided in an embodiment of the present invention; Figure 4 A schematic diagram of a third user interface provided in an embodiment of the present invention; Figure 5 A schematic diagram of the fourth user interface provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a precise medication information query device provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0022] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0023] The embodiments of the present invention aim to overcome the shortcomings of existing RAG schemes, and the objectives include: Improve query accuracy: Extract user intent and generic drug names through a large model to ensure clear search targets and avoid the ambiguity problem of vector search; Ensuring comprehensive information: Through field extraction and interactive drug selection, all key information needed for multiple drug interactions is covered, reducing omissions; Optimize the user experience: Provide visual controls for users to select specific medications, making the search process more relevant to actual medical scenarios; Improve processing efficiency: By filtering irrelevant fields in drug instructions, the amount of input data for large models is reduced, token overruns are prevented, and response speed and quality are improved.

[0024] To facilitate understanding of this embodiment, a detailed description of a method for accurately querying medication information disclosed in this embodiment of the invention will be provided first.

[0025] This invention provides a method for accurate medication information retrieval. This method can be executed by an electronic device with data processing capabilities and can be applied to a medication information retrieval system. See also... Figure 1 The diagram shows a method for accurately querying medication information, which mainly includes the following steps S110 to S150: Step S110: Obtain the natural language questions in the medication information query request.

[0026] Users can enter their desired query in natural language on the user interface of the medication information query system to trigger a medication information query request. For example... Figure 2As shown, the medication information query system is a doctor's AI assistant. Users can input "interactions between cephalosporins and warfarin." By parsing the medication information query request, the natural language question carried in the request can be obtained.

[0027] Step S120: The first major model is used to perform intent recognition, drug generic name extraction, and required field extraction on the natural language problem to obtain the target intent, target drug generic name, and target fields; among which, the required fields refer to the key fields that need to be extracted from the drug instructions.

[0028] To achieve accurate queries, this embodiment utilizes a large language model to parse the user's natural language questions and determine the user's intent. This intent is used to determine the type of subsequent output controls (such as interaction query controls or special population controls). Standardized generic drug names are extracted from the natural language questions, and key fields that need to be extracted from the drug instructions (such as contraindications, precautions, and drug interactions) are identified to facilitate accurate retrieval of relevant information from the drug database. It should be noted that there is no specific order of execution among intent identification, generic drug name extraction, and required field extraction. Only drugs directly mentioned in the user's latest question can be extracted, ignoring drugs mentioned in previous conversations but not currently discussed (unless explicitly referenced or continued in the current question).

[0029] The first major model mentioned above is a pre-trained model. The first major model used for intent recognition, drug generic name extraction, and required fields can be the same or different; this embodiment does not impose any restrictions on this. The target drug generic name can be one or more.

[0030] In some possible embodiments, step S120 above may include: performing entity recognition on the natural language problem using a first large model to obtain candidate drug names and their dosage form information, and standardizing the candidate drug names and their dosage form information to obtain the target drug generic name; determining the semantics of the natural language problem using the first large model, and selecting the target field from predefined fields. For example, Figure 2 The generic names of the two drugs are shown: warfarin sodium tablets and cefuroxime sodium for injection.

[0031] The standardization process described above involves matching candidate drug names against a pre-defined drug database. To ensure the accuracy of the final output, if a candidate drug name is suspected of being fictitious, contains serious spelling errors, or is only similar in pronunciation to a certain standard drug name, it should not be forcibly mapped to a standard drug with a similar pronunciation. If a candidate drug name is clearly fictitious, has no corresponding standard drug, or its validity cannot be confirmed, the standardization process for the candidate drug name should be terminated. In both cases, a message indicating that no relevant drug is available, such as "Drug database being improved," can be returned to the user.

[0032] In one possible implementation, the aforementioned suspected or obvious fictitiousness can be determined by, but is not limited to, the following methods: matching the candidate drug name with multiple pre-defined authoritative databases; if no record is found in at least one authoritative database, it is determined to be suspected fictitious; if no record is found in any of the authoritative databases, it is determined to be obvious fictitious. Alternatively, it can be determined whether the candidate drug name is suspected or obvious fictitious by judging whether its lexical structure conforms to the typical characteristics of an International Nonproprietary Name (INN); optionally, if either the prefix or suffix of the candidate drug name is abnormal, it can be determined to be suspected fictitious; if both the prefix and suffix of the candidate drug name are abnormal, or if the candidate drug name is forcibly concatenated from multiple completely unrelated words or syllables that do not belong to the drug naming system, it can be determined to be obvious fictitious. Furthermore, the matching results between the candidate drug name and authoritative databases, as well as any abnormalities in the lexical structure of the candidate drug name, can be combined to determine whether the candidate drug name is suspected or obvious fictitious.

[0033] In one possible implementation, the aforementioned serious spelling errors can be determined by, but not limited to, the following method: calculating the string edit distance between the candidate drug name and each standard drug name in the standard drug name set; if the minimum edit distance is greater than a preset threshold (e.g., 2), it is determined to be a serious spelling error.

[0034] Optionally, the above predefined fields may include the class of action, ingredients, properties, indications, dosage and administration, adverse reactions, contraindications, precautions, warnings, use in pregnant and lactating women, use in children, use in the elderly, drug interactions, drug overdose, clinical trials, drug toxicology, pharmacokinetics, storage, packaging, implementation standards, and expiration date.

[0035] Step S130: Push a target control to the user that corresponds to the target intent and is filled with all related drugs under the target drug's generic name, so that the user can select a drug.

[0036] Based on the user's interaction requirements (target intent), an actionable list (target control) containing all related drugs under the target drug's generic name is generated, with each option for the target drug's generic name pre-populated with the corresponding drug name. Users can directly select the specific drug they want to query from this actionable list. When the target drug's generic name includes at least two drug generic names, an actionable list is set for each drug generic name.

[0037] In some possible embodiments, step S130 may include: querying a drug database to find all related drugs under the generic name of the target drug, obtaining a list of target drugs; determining the target control corresponding to the target intent based on a preset correspondence between intent and control type; populating the target drug list into the target control and then pushing it to the user interface. The correspondence between intent and control type may include, for example, a drug interaction intent corresponding to a drug interaction control, or a special population intent (such as the question "Can pregnant women use ibuprofen?") corresponding to a special population control.

[0038] like Figure 3 As shown, after displaying two drugs (Drug 1 and Drug 2) on the user interface, users can expand the drug list for each drug by clicking. For example, the drug list for Drug 2 includes: Cefuroxime Sodium for Injection, Cefadroxil Dispersible Tablets, Cefalexin Sustained-Release Capsules, and Cefprozil Tablets. After selecting the specific drug name for each drug, users can click the analysis results control. Figure 4 As shown, the end user selected warfarin sodium tablets as drug 1 and cefprozil tablets as drug 2. An interaction analysis will then be performed on warfarin sodium tablets and cefprozil tablets.

[0039] Step S140: Based on the target field, filter the complete drug instruction information corresponding to the drug identifier selected by the user to obtain the target drug instruction information.

[0040] In this embodiment, information filtering can remove irrelevant fields from the drug instructions, reducing information interference and decreasing the amount of input data for large models, thereby improving response speed and quality.

[0041] In some possible embodiments, step S140 above may include: obtaining complete drug instruction manual information based on the drug identifier selected by the user; and filtering out the content of the target field from the complete drug instruction manual information through text parsing and field matching to obtain the target drug instruction manual information.

[0042] Step S150: Based on the information in the target drug's instruction manual and the natural language question, call the second major model to generate the target answer.

[0043] In this embodiment, the second major model can be the same as or different from the first major model.

[0044] In some possible embodiments, step S150 above may include: using the target drug instruction manual information as context and combining it with a natural language question to construct a prompt word; inputting the prompt word into a second large model to obtain the target answer generated by the second large model.

[0045] The target answer will be displayed on the user interface for the user to view, such as Figure 5 As shown.

[0046] The method for accurate drug information query provided in this invention can obtain the natural language question in the drug information query request; through a first large model, the natural language question is subjected to intent recognition, drug generic name extraction, and required field extraction to obtain the target intent, target drug generic name, and target fields; wherein, the required fields refer to the key fields that need to be extracted from the drug instructions; a target control corresponding to the target intent and filled with all related drugs under the target drug generic name is pushed to the user for the user to select a drug; based on the target fields, the complete drug instructions information corresponding to the drug identifier selected by the user is filtered to obtain the target drug instructions information; based on the target drug instructions information and the natural language question, a second large model is invoked to generate the target answer. In this way, intent recognition, drug generic name extraction, and required field extraction are achieved through a large model, combined with an interactive selection mechanism and information filtering, which improves the accuracy, comprehensiveness, and user experience of drug information query.

[0047] To facilitate understanding, the technical principles and implementation process of the above-mentioned method for accurately querying medication information will be explained in detail below.

[0048] Regarding the technical principles, the core of this invention lies in using a large model to realize user intent parsing and structured extraction of drug information, combined with an interactive selection mechanism and information filtering, to achieve accurate and efficient drug information retrieval. Compared with the traditional RAG scheme, this invention upgrades the retrieval process from "question-based fuzzy retrieval" to "intent- and field-based targeted retrieval," and ensures the accuracy of the query through human-computer interaction.

[0049] The implementation process of the above-mentioned method for accurately querying medication information can be as follows: 1. User intent extraction: Large language models (such as GPT series models) are used to parse user natural language questions (e.g., "interaction between cephalosporins and warfarin") to extract user query intent (e.g., "drug interactions"). This intent is used to determine the type of subsequent output control (e.g., interaction query control).

[0050] 2. Extraction of generic drug name and related fields: Similarly, a large language model is used to extract the generic name of the drug from the user's natural language question (e.g., output: {"drugs":["cephalosporin", "warfarin"]}) and the list of fields to be extracted from the drug's package insert (e.g., output: {"fields": ["contraindications", "precautions", "drug interactions"]}). This step uses a pre-trained model to achieve entity recognition and field mapping, ensuring the accuracy of the retrieval target.

[0051] It can identify and standardize the generic name portion of a drug; retain dosage form information mentioned in the original natural language question (such as "capsule", "tablet", "injection" etc.); the standardized drug name format should be: standardized generic name + dosage form (such as "ibuprofen capsule"); if the dosage form is not specified in the original question, only the standardized generic name can be output.

[0052] Based on the semantics of the user's natural language question (e.g., for the question "Can cephalosporins and ibuprofen be used together?", the semantics could be "Get the generic names of cephalosporins and ibuprofen"), the system can select the information fields to be queried from predefined fields; adhering to the principle of medical rigor, it ensures the completeness of safety-related fields; the field scope is strictly limited to: action category, ingredients, properties, indications, dosage and administration, adverse reactions, contraindications, precautions, warnings, use in pregnant and lactating women, use in children, use in the elderly, drug interactions, drug overdose, clinical trials, drug toxicology, pharmacokinetics, storage, packaging, implementation standards, and expiration date.

[0053] For example, the prompt word for drug extraction could be: # Roles and Abilities You are a professional drug information extraction and standardization assistant, possessing expertise in the pharmaceutical field. You can accurately identify drugs mentioned in doctor conversations and standardize them into their chemical names (i.e., the generic names published in the Chinese Pharmacopoeia or by the National Medical Products Administration), while retaining the drug's dosage form information. You can also extract the required drug instruction manual content from predefined information fields based on the user's intent. You must be able to verify the authenticity of drug names, refusing to map fictitious, incorrect, or unverifiable names to real drugs, and prohibiting forced matching of similar-sounding names with fictitious drug mappings.

[0054] # Task Based on the context of multi-turn dialogues between the doctor and the AI ​​assistant, the system accurately identifies the medications directly mentioned in the doctor's latest questions and converts **only verifiable and existing drug names** into standard chemical names (generic names), while retaining the dosage form information mentioned in the original question. Analyzing the user's intent and based on rigorous and comprehensive medical principles, the system infers which specific information fields need to be extracted from the drug's instruction manual. The final output is in structured JSON format.

[0055] # Processing Rules 1. **Focus on the current issues:** Only extract the medications that the doctor directly mentioned in the latest round of questions, ignoring medications that have been mentioned in previous conversations but are not currently being discussed (unless the current question explicitly cites or continues the discussion).

[0056] 2. **Standardization of Drug Names and Retention of Dosage Forms**: - Identify and standardize the generic name portion of the drug (e.g., "ibuprofen" → "ibuprofen"). - **Retain the dosage form information mentioned in the original question** (such as "capsules", "tablets", "injection", etc.) - The standardized drug name format should be: Standardized generic name + Dosage form (e.g., "ibuprofen capsules") - If the dosage form is not specified in the original question, only the standardized generic name will be output. 3. **Information Field Extraction (Medical Rigor Principle)**: - Select the information fields to be queried from predefined fields based on the semantics of the user's question. - Adhere to medical rigor principles to ensure the completeness of safety-related fields. - The scope of fields is strictly limited to: therapeutic category, ingredients, properties, indications, dosage and administration, adverse reactions, contraindications, precautions, warnings, use in pregnant and lactating women, use in children, use in the elderly, drug interactions, drug overdose, clinical trials, drug toxicology, pharmacokinetics, storage, packaging, implementation standards, and expiration date. 4. **Prohibit forced matching of similar-sounding words and mapping of fictitious drugs:** If a drug name is suspected of being fictitious, has serious spelling errors, or is only similar in sound, it should not be forcibly matched with a real drug that has a similar pronunciation.

[0057] 5. **Principles for handling unknown or invalid names:** If the name is obviously fictitious, has no corresponding standard drug, or cannot be confirmed, it will not be added to the output list.

[0058] # Output Format Strictly adhere to the following JSON format for output, and do not include any other content: { "drugs": ["drug name 1", "drug name 2"], / / List of standardized drug names (including dosage forms), may be an empty array "fields": ["field1", "field2"] / / List of fields to query, selected from predefined fields } # Example - User question: "Dosage and administration of Ibuprofen capsules" Output: {"drugs": ["ibuprofen capsules"], "fields": ["dosage and administration"]} User question: "What are the side effects of enteric-coated aspirin tablets?" Output: {"drugs": ["Aspirin Enteric-coated Tablets"], "fields": ["Adverse Reactions"]} User question: "Can people with renal insufficiency use ibuprofen?" Output: {"drugs": ["ibuprofen"], "fields": ["contraindications", "precautions", "dosage and administration", "use in the elderly", "drug interactions"]} User question: "How do I use penicillin injection?" Output: {"drugs": ["Penicillin Injection"], "fields": ["Dosage and Administration", "Precautions"]} User question: "Please provide an introduction to cefixime tablets." Output: {"drugs": ["cefixime tablets"], "fields": ["indications", "dosage and administration", "adverse reactions", "contraindications", "precautions"]} 3. Related drug search: Based on the extracted generic drug name, a drug database (such as a local or cloud database) is accessed to retrieve a list of all related drugs under that generic name (e.g., "cephalosporin" corresponds to cefadroxil dispersible tablets, cefalexin sustained-release capsules, etc.). This is achieved through database indexing and matching algorithms to ensure comprehensive coverage.

[0059] 4. Pushing interactive controls: The system pushes a query-specific control (such as a drug interaction control) into the user interface (such as a dialog box) and pre-populates a list of retrieved drugs for the user to choose from. The user can select a specific drug using the control (such as selecting "Cefprozil Tablets" from the "Cephalexin" list), and the system obtains the final drug identifier after submission.

[0060] 5. Obtaining and filtering drug instruction leaflets: Based on the drug identifier selected by the user, the system retrieves complete drug instruction manual information via an API (Application Programming Interface). Subsequently, based on the field list extracted in step 2, the system filters out the required fields from the complete instruction manual (e.g., retaining only the "Contraindications," "Precautions," and "Drug Interactions" sections). This is achieved through text parsing and field matching algorithms, significantly reducing the amount of input data.

[0061] 6. Answer generation: The system uses filtered drug instruction leaflet information as context, combined with the user's original question, to construct a large-scale input model for prompts. This model then generates the final answer. The system employs prompt engineering to ensure that the answer is based on authoritative information and avoids redundancy.

[0062] In summary, the technical improvements of this invention include: Technical improvement point 1: Intent-driven precise retrieval.

[0063] By extracting intent and fields from a large model, traditional vector retrieval is replaced, fundamentally solving the problems of inaccurate and fragmented retrieval.

[0064] Technical Improvement Point 2: Interactive Drug Selection.

[0065] The introduction of a control mechanism allows users to select from specific drugs under the generic name, improving the flexibility and usability of the search.

[0066] Technical improvement point 3: Information filtering optimization.

[0067] By filtering fields, the number of input tokens for large models is reduced to prevent exceeding the limit, while improving the quality of answers. Compared with the RAG scheme, this invention only inputs relevant fields to avoid noise interference.

[0068] Technical improvement point 4: End-to-end efficiency improvement.

[0069] The entire process achieves efficient pipeline processing and reduces computing resource consumption through modular design (intent extraction, drug query, interactive controls, information filtering).

[0070] The embodiments of the present invention, through the above-described scheme, achieve a significant improvement in the accuracy, comprehensiveness, and user experience of drug information retrieval, and are particularly suitable for clinical drug use decision support.

[0071] Corresponding to the above-described method for accurately querying medication information, this embodiment of the invention also provides a device for accurately querying medication information. See also... Figure 6 The diagram shown illustrates the structure of a precise medication information query device, which includes: Module 601 is used to obtain natural language questions in medication information query requests; The extraction module 602 is used to perform intent recognition, drug generic name extraction, and required field extraction on the natural language problem through the first major model, so as to obtain the target intent, the target drug generic name, and the target fields; among which, the required fields refer to the key fields that need to be extracted from the drug instructions. The push module 603 is used to push a target control to the user that corresponds to the target intent and is filled with all related drugs under the target drug's generic name, so that the user can select a drug; The filtering module 604 is used to filter the complete drug instruction information corresponding to the drug identifier selected by the user based on the target field, so as to obtain the target drug instruction information; The generation module 605 is used to generate the target answer by calling the second major model based on the target drug instruction information and the natural language question.

[0072] The accurate medication information query device provided in this invention can acquire the natural language question in a medication information query request; through a first large model, it performs intent recognition, drug generic name extraction, and required field extraction on the natural language question to obtain the target intent, target drug generic name, and target fields; wherein, the required fields refer to the key fields that need to be extracted from the drug instructions; it pushes a target control corresponding to the target intent and filled with all related drugs under the target drug generic name to the user for the user to select a drug; based on the target fields, it filters the complete drug instructions information corresponding to the drug identifier selected by the user to obtain the target drug instructions information; based on the target drug instructions information and the natural language question, it calls a second large model to generate the target answer. In this way, by realizing intent recognition, drug generic name extraction, and required field extraction through a large model, combined with an interactive selection mechanism and information filtering, the accuracy, comprehensiveness, and user experience of medication information query are improved.

[0073] Furthermore, the extraction module 602 is specifically used to: perform entity recognition on the natural language problem through the first major model to obtain candidate drug names and their dosage form information, and standardize the candidate drug names and their dosage form information to obtain the target drug generic name; determine the semantics of the natural language problem through the first major model, and select the target field from the predefined fields.

[0074] Furthermore, the extraction module 602 is also used to: prohibit the forced mapping of a candidate drug name to a standard drug with a similar pronunciation when the candidate drug name is suspected to be fictitious, has serious spelling errors, or is only similar in pronunciation to a certain standard drug name; and terminate the standardization process for the candidate drug name when the candidate drug name is obviously fictitious, has no corresponding standard drug, or its validity cannot be confirmed.

[0075] Furthermore, the aforementioned predefined fields include: action category, ingredients, properties, indications, dosage and administration, adverse reactions, contraindications, precautions, warnings, use in pregnant and lactating women, use in children, use in the elderly, drug interactions, drug overdose, clinical trials, drug toxicology, pharmacokinetics, storage, packaging, implementation standards, and expiration date.

[0076] Furthermore, the aforementioned push module 603 is specifically used to: call the drug database to query all related drugs under the generic name of the target drug to obtain a list of target drugs; determine the target control corresponding to the target intent according to the preset correspondence between intent and control type; populate the target drug list in the target control and then push it to the user interface.

[0077] Furthermore, the aforementioned filtering module 604 is specifically used to: obtain complete drug instruction manual information based on the drug identifier selected by the user; and filter out the content of the target field from the complete drug instruction manual information through text parsing and field matching to obtain the target drug instruction manual information.

[0078] Furthermore, the aforementioned generation module 605 is specifically used to: use the target drug instruction manual information as context, combine it with natural language questions, and construct prompt words; input the prompt words into the second large model to obtain the target answer generated by the second large model.

[0079] The device provided in this embodiment has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0080] like Figure 7 As shown, an electronic device 700 provided in this embodiment of the invention includes: a processor 701, a memory 702 and a bus. The memory 702 stores a computer program that can run on the processor 701. When the electronic device 700 is running, the processor 701 and the memory 702 communicate through the bus, and the processor 701 executes the computer program to realize the above-mentioned method for accurately querying medication information.

[0081] Specifically, the memory 702 and processor 701 mentioned above can be general-purpose memory and processor, without any specific limitations here.

[0082] This invention also provides a computer-readable storage medium storing a computer program. When a processor runs this computer program, it executes the precise medication information query method described in the preceding method embodiments. The computer-readable storage medium includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), RAM, magnetic disk, or optical disk.

[0083] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0084] In all examples shown and described herein, any specific values ​​should be interpreted as merely exemplary and not as limitations; therefore, other examples of exemplary embodiments may have different values.

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

[0086] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0087] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0088] In addition, the functional modules in the various embodiments of the present invention can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0089] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for accurately querying medication information, characterized in that, include: Natural language issues in obtaining medication information query requests; The first major model is used to perform intent recognition, drug generic name extraction, and required field extraction on the natural language problem, resulting in the target intent, target drug generic name, and target fields; wherein, the required fields refer to the key fields that need to be extracted from the drug instructions. Push a target control to the user that corresponds to the target intent and is filled with all related drugs under the target drug's generic name, so that the user can select a drug; Based on the target field, the complete drug instruction manual information corresponding to the drug identifier selected by the user is filtered to obtain the target drug instruction manual information; Based on the target drug's instruction manual information and the natural language question, the second major model is invoked to generate the target answer.

2. The method for accurately querying medication information according to claim 1, characterized in that, The process of performing intent recognition, generic drug name extraction, and required field extraction on the natural language problem using the first major model includes: The first large model is used to perform entity recognition on the natural language problem to obtain candidate drug names and their dosage forms. The candidate drug names and their dosage forms are then standardized to obtain the generic name of the target drug. The semantics of the natural language problem are determined using the first large model, and the target field is selected from the predefined fields.

3. The method for accurately querying medication information according to claim 2, characterized in that, The standardization of the candidate drug names and their dosage form information to obtain the generic name of the target drug includes: When the candidate drug name is suspected to be fictitious, contains serious spelling errors, or is only similar in pronunciation to a standard drug name, it is prohibited to forcibly map it to a standard drug with a similar pronunciation; When the candidate drug name is obviously fictitious, has no corresponding standard drug, or its validity cannot be confirmed, the standardization process for the candidate drug name shall be terminated.

4. The method for accurately querying medication information according to claim 2, characterized in that, The predefined fields include: action category, ingredients, properties, indications, dosage and administration, adverse reactions, contraindications, precautions, warnings, use in pregnant and lactating women, use in children, use in the elderly, drug interactions, drug overdose, clinical trials, drug toxicology, pharmacokinetics, storage, packaging, implementation standards, and expiration date.

5. The method for accurately querying medication information according to claim 1, characterized in that, The method of pushing a target control to the user that corresponds to the target intent and is filled with all related drugs under the target drug's generic name includes: The drug database is invoked to query all related drugs under the generic name of the target drug, and a list of the target drugs is obtained. Based on the preset correspondence between intent and control type, determine the target control corresponding to the target intent; After the target drug list is populated in the target control, it is pushed to the user interface.

6. The method for accurately querying medication information according to claim 1, characterized in that, The step of filtering the complete drug instruction information corresponding to the drug identifier selected by the user based on the target field to obtain the target drug instruction information includes: Obtain complete drug instruction leaflet information based on the drug identifier selected by the user; By parsing text and matching fields, the content of the target field is filtered out from the complete drug instruction manual information to obtain the target drug instruction manual information.

7. The method for accurately querying medication information according to claim 1, characterized in that, The step of generating the target answer by calling the second major model based on the target drug's instruction leaflet information and the natural language question includes: Using the target drug's instruction manual information as context, and combining it with the natural language question, prompt words are constructed; Input the prompt words into the second large model to obtain the target answer generated by the second large model.

8. A device for accurately querying medication information, characterized in that, include: The acquisition module is used to retrieve natural language questions from medication information query requests; The extraction module is used to perform intent recognition, drug generic name extraction, and required field extraction on the natural language question through the first major model to obtain the target intent, target drug generic name, and target fields; wherein, the required fields refer to the key fields that need to be extracted from the drug instructions. The push module is used to push a target control to the user that corresponds to the target intent and is filled with all related drugs under the generic name of the target drug, so that the user can select a drug; The filtering module is used to filter the complete drug instruction information corresponding to the drug identifier selected by the user based on the target field, so as to obtain the target drug instruction information; The generation module is used to generate the target answer by calling the second major model based on the target drug instruction information and the natural language question.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the method for accurately querying medication information as described in any one of claims 1-7.

10. A computer-readable storage medium storing a computer program thereon, characterized in that, The computer program, when executed by the processor, performs the method for accurately querying medication information as described in any one of claims 1-7.