Question and answer generation method and device based on knowledge in drug research and development field
By establishing a correspondence between query requests and fine-grained process knowledge in the field of drug development, optimizing query requests, and utilizing a drug knowledge base for retrieval filtering and fusion, the problem of insufficient accuracy and professionalism in question-and-answer generation in the field of drug development is solved, and efficient and reliable answer generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DONGGUAN DONGYANGGUANG ARTIFICIAL INTELLIGENCE PHARMACEUTICAL RESEARCH & DEVELOPMENT CO LTD
- Filing Date
- 2025-12-12
- Publication Date
- 2026-05-01
AI Technical Summary
Existing question-answering generation technologies based on natural language large models suffer from insufficient accuracy and professionalism in the field of drug development. In particular, the complex terminology and heterogeneous literature structure in the field of drug development lead to inaccurate and unreliable generated answers.
By establishing an accurate correspondence between query requests and fine-grained process knowledge in the field of drug development, query requests are obtained and optimized. A pre-built drug knowledge base is used for retrieval filtering and knowledge fusion to generate structured enhanced prompts which are then input into a large language model to ensure the accuracy and traceability of the answers.
It significantly improves the accuracy, professionalism, and reliability of question-and-answer generation results. By implementing dual constraint matching of query semantics and drug development process information in the drug knowledge base, it enhances the professionalism and targeting of knowledge retrieval, reduces illusory information, and improves the verifiability and domain consistency of generated content.
Smart Images

Figure CN121958474A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a question-and-answer generation method, a question-and-answer generation device, an electronic device, a computer-readable storage medium, and a computer program product based on knowledge in the field of drug development. Background Technology
[0002] Drug development is a knowledge-intensive field involving multiple disciplines such as pharmaceutics, pharmacology, materials science, medicinal chemistry synthesis, drug solid-state crystal forms, and regulatory science. Researchers need to integrate and analyze massive amounts of information from various sources, including but not limited to scientific literature, patents, pharmacopoeia standards, and formulation and process data of marketed products. In recent years, Large Language Models (LLMs) have achieved great success in natural language understanding and generation. Automated knowledge extraction and question-answering generation using natural language processing technology is becoming an important trend in the intelligentization of drug development.
[0003] Currently, some solutions employ Retrieval-Augmented Generation (RAG) technology, which retrieves text fragments related to the question from external literature databases and inputs them as context into the LLM (Limited Learning Model) to improve the accuracy and traceability of the answers. However, due to the characteristics of the drug development field, such as complex terminology, highly heterogeneous literature structure, and highly specialized knowledge, the coarse-grained text-based retrieval and modeling methods in these solutions result in insufficient accuracy and professionalism in the answers generated by the models. Summary of the Invention
[0004] This invention aims to at least partially solve one of the aforementioned technical problems or at least provide a useful commercial solution. In view of this, this invention provides a question-answering generation method and apparatus based on knowledge in the field of drug development, which significantly improves the accuracy, professionalism, and reliability of the question-answering generation results by establishing an accurate correspondence between query requests and fine-grained process knowledge in the field of drug development.
[0005] In a first aspect, the present invention provides a question-answering generation method based on knowledge in the field of drug development. The method includes: acquiring a user's query request; optimizing the query request text to obtain enhanced query text; wherein the enhanced query text includes target drug development process entry information to provide contextual knowledge support based on the drug development process; performing retrieval and filtering in a pre-constructed drug knowledge base based on the enhanced query text to obtain a target knowledge set; fusing the enhanced query text with the target knowledge set based on a prompt word template to obtain structured enhanced prompt words; and inputting the structured enhanced prompt words into a large language model to obtain an output result; wherein the output result includes citation information.
[0006] In an exemplary embodiment, optimizing the query request to obtain enhanced query text includes: standardizing the chemical structure string in the query request to obtain a standard chemical structure formula; performing molecular fingerprint calculation on the standard chemical structure formula to obtain a chemical structure molecular fingerprint; performing a similarity search on the chemical structure molecular fingerprint in a pre-built drug knowledge base to obtain a target drug development process entry; and fusing the target drug development process entry with the query request to obtain enhanced query text.
[0007] In an exemplary embodiment, the step of fusing the target drug development process entry with the query request to obtain enhanced query text includes: performing language conversion based on the language differences between the query request and the target drug development process entry to obtain the target drug development process entry and the query request in the same language; fusing the target drug development process entry and the query request in the same language to obtain enhanced query text; wherein the enhanced query text is in the same language as the target drug development process entry.
[0008] In an exemplary embodiment, the step of performing retrieval and filtering in a pre-built drug knowledge base based on the enhanced query text to obtain a target knowledge set includes: performing multi-level retrieval in the pre-built drug knowledge base based on the enhanced query text to obtain a candidate knowledge set; sorting the candidate knowledge set based on the relevance between the candidate knowledge set and the query request to obtain a sorting result; and filtering the sorting result based on a relevance threshold to obtain the target knowledge set.
[0009] In an exemplary embodiment, the step of performing multi-level retrieval in a pre-built drug knowledge base based on the enhanced query text to obtain a candidate knowledge set includes: performing semantic retrieval in the pre-built drug knowledge base based on the enhanced query text to obtain a first retrieval result; performing keyword retrieval in the pre-built drug knowledge base based on the enhanced query text to obtain a second retrieval result; wherein the keywords include at least one of professional terms and entity names; and performing weighted fusion of the first retrieval result and the second retrieval result to obtain a candidate knowledge set.
[0010] In an exemplary embodiment, the step of sorting the candidate knowledge set based on the relevance between the candidate knowledge set and the query request to obtain a sorting result includes: calculating the relevance between the candidate knowledge set and the query request based on a re-ranking model to obtain a relevance result; and sorting the candidate knowledge set based on the relevance result to obtain a sorting result.
[0011] In an exemplary embodiment, the reordering model is selected from a cross-encoder model fine-tuned based on drug development knowledge, which includes at least one of pharmaceutics expertise, pharmaceutical expertise, and drug solid-state crystal form expertise, and the pharmaceutics expertise includes at least one of formulation process, excipient function, and pharmacopoeia regulations.
[0012] In an exemplary embodiment, the step of fusing the enhanced query text with the target knowledge set based on the prompt word template to obtain structured enhanced prompt words includes: fusing each knowledge block in the target knowledge set with its metadata to obtain a structured knowledge block set; wherein the metadata includes at least one of: identification information, source information, content type information, and hierarchical title information; embedding the structured knowledge block set into the prompt word template according to a preset format and combining it with the enhanced query text to obtain structured enhanced prompt words.
[0013] In an exemplary embodiment, the prompt word template includes: a knowledge retrieval section for containing contextual chunks of text and their corresponding metadata fields; and an instruction compliance section for defining generation rules, including at least one of the following: drug domain expert role instructions, context analysis requirements, structured subject response requirements, inline citation requirements, and independent reference list output requirements.
[0014] In an exemplary embodiment, the method further includes: verifying the citation information in the output result; wherein the verification includes: checking whether the citation number in the preliminary answer actually exists in the provided context; and removing invalid citation markers.
[0015] In an exemplary embodiment, the construction of the drug knowledge base includes: acquiring drug development knowledge, which includes: a first knowledge document and a second knowledge document; the first knowledge document includes at least one of: books, papers, patents, and regulations; the second knowledge document includes at least one of: prescriptions, processes, and experimental data; performing knowledge structuring processing on the first knowledge document to obtain text knowledge blocks; performing text vectorization processing on the text knowledge blocks to obtain a vector database; performing standardization processing on the second knowledge document based on a chemical structure matching strategy to obtain structured process entries; calculating the chemical structure features of active pharmaceutical ingredients on the structured process entries to obtain a chemical structure database; and constructing a drug knowledge base based on the vector database and the chemical structure database.
[0016] In an exemplary embodiment, the knowledge structuring process includes at least one of: block processing, merging processing, and annotation processing; wherein, the block processing includes: segmenting the first knowledge document based on the document's title hierarchy to obtain a first set of text blocks; performing semantic block processing on the first set of text blocks to obtain a second set of text blocks; and performing fine-grained partitioning processing on the second set of text blocks to obtain a third set of text blocks; the merging processing includes: merging text blocks with a length lower than a predetermined threshold; and the annotation processing includes: annotating each knowledge block with metadata, the metadata including at least one of: text type, source file name, and chapter title.
[0017] In an exemplary embodiment, the step of performing text vectorization processing on the text knowledge block to obtain a vector database includes: using a text embedding model to perform format conversion on the text knowledge block, generating vectorized text containing an index, and obtaining a vector database.
[0018] In an exemplary embodiment, the standardization process of the second knowledge document based on a chemical structure matching strategy to obtain structured process entries includes: obtaining a second knowledge document table; converting the second knowledge document table into structured text in the form of a dictionary data structure of "column name: text content"; the column name includes at least one of: drug number, generic name, chemical structure, specification, excipient name, excipient dosage, and process parameters; and deduplicating the structured text using chemical molecular structure identifiers as the standard to obtain structured process entries.
[0019] In an exemplary embodiment, the step of calculating the chemical structure features of active pharmaceutical ingredients for the structured process entries to obtain a chemical structure database includes: parsing the structured process entries based on cheminformatics tools to obtain chemical structure molecular fingerprints; and constructing a dictionary data structure with "structured process entry: chemical structure molecular fingerprint" as key-value pairs to obtain the chemical structure database.
[0020] In an exemplary embodiment, the drug development field includes at least one of the following: drug formulation vertical field, drug chemical synthesis vertical field, and drug solid crystal form vertical field.
[0021] In an exemplary embodiment, the drug development field is the pharmaceutical formulation vertical field.
[0022] Secondly, the present invention provides a question-and-answer generation device based on knowledge in the field of drug development. The device includes: an acquisition module, an optimization module, a retrieval module, a fusion module, and an output module.
[0023] The system includes the following modules: an acquisition module for acquiring user query requests; an optimization module for optimizing the query requests to obtain enhanced query text, which includes target drug development process information to provide contextual knowledge support based on the drug development process; a retrieval module for performing retrieval filtering on the enhanced query text in a pre-built drug knowledge base to obtain a target knowledge set; a fusion module for fusing the enhanced query text with the target knowledge set based on prompt word templates to obtain structured enhanced prompt words; and an output module for inputting the structured enhanced prompt words into a large language model to obtain output results, which include citation information.
[0024] Thirdly, the present invention provides an electronic device comprising: a processor and a memory; the memory for storing a computer program; and the processor for executing the computer program to implement the question-and-answer generation method based on knowledge in the field of drug development as provided in the first aspect.
[0025] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions or programs that, when executed on a computer, cause the question-and-answer generation method based on knowledge in the field of drug development, as provided in the first aspect, to be executed.
[0026] Fifthly, the present invention provides a computer program product comprising computer instructions that, when some or all of the computer instructions are executed on a computer, cause the question-and-answer generation method based on knowledge in the field of drug development, as provided in the first aspect, to be executed.
[0027] In a sixth aspect, the present invention provides a computer program that, when run on a computer, causes the computer to execute the question-and-answer generation method based on knowledge in the field of drug development as provided in the first aspect.
[0028] In summary, the solution provided by this invention embeds target drug development process information into the query request, enabling the enhanced query text to provide contextual knowledge support based on drug development process information for the large language model. This achieves dual constraint matching of query semantics and drug development process information during the drug knowledge base retrieval stage, improving the matching accuracy of professional knowledge in the drug development field during subsequent retrieval stages. Then, by performing retrieval filtering based on the enhanced query text in the pre-built drug knowledge base, a set of target knowledge highly relevant to the query intent can be selected from the knowledge in the drug development field, significantly improving the professionalism and targeting of knowledge retrieval. Furthermore, the enhanced query text and target knowledge set are structurally integrated based on prompt word templates, ensuring that the prompt information input to the large language model has a unified format, clear semantic boundaries, and traceable knowledge sources. This effectively reduces illusory information during model generation, improving the accuracy, verifiability, and domain consistency of the generated content. Moreover, the final output includes citation information, making the model-generated answer traceable and auditable, further enhancing the reliability of the answer. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 This is a schematic diagram of a system architecture according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating a question-answer generation method based on knowledge in the field of drug development according to an embodiment of the present invention. Figure 3 A schematic diagram of a question-and-answer generation device based on knowledge in the field of drug development according to an embodiment of the present invention; Figure 4 This is a schematic block diagram of an electronic device according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the technical architecture of the knowledge question-answering generation method based on the vertical domain of pharmaceutical formulation according to Embodiment 1 of the present invention; Figure 6 This is a schematic diagram illustrating the application route of intelligent prescription and process design according to Embodiment 1 of the present invention; Figure 7 This is a schematic diagram showing the performance comparison of different question-answering models according to Embodiment 1 of the present invention. Detailed Implementation
[0031] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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.
[0032] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in sequences other than those illustrated or described herein. In embodiments of the invention, "B corresponding to A" means that B is associated with A. In one implementation, B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.
[0033] In this embodiment of the invention, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0034] Before introducing the technical solution of this invention, the relevant knowledge of this invention will be introduced below: In this embodiment of the invention, a “user’s query request” refers to an information request submitted by an end user in natural language or a structured format for a drug development issue. The request may include a text description, drug name, chemical structure string (e.g., SMILES), or other identifiers.
[0035] In this embodiment of the invention, "text optimization" refers to a series of text-level preprocessing actions performed on the user's query request to improve the matching degree and utilization rate of professional information by the retrieval and subsequent generation modules. Text optimization includes, but is not limited to: vocabulary normalization, entity recognition and standardization, chemical structure string recognition and standardization, query rewriting and expansion, language conversion, and incorporating retrieved structured reference entries into the query text.
[0036] In this embodiment of the invention, "enhanced query text" refers to a text information carrier obtained after text optimization processing based on the original query request. This carrier includes relevant information from the target drug development process item and can provide contextual knowledge support based on the drug development process, so that the large language model can obtain clear professional prompts under conditions of few samples.
[0037] In this embodiment of the invention, "standard chemical structure formula" refers to a standardized representation of a chemical molecular structure string (such as in SMILES format) that has been normalized to obtain a unique representation that can characterize the molecular stereochemistry and functional group information. The normalization process may include operations such as eliminating redundant representations, standardizing isomer labels, and standardizing bond types, for use in knowledge base retrieval and similarity matching.
[0038] In this embodiment of the invention, "chemical structure molecular fingerprint" refers to the characteristic of converting the standard chemical structure formula into a digital vector or bit string form through cheminformatics methods (such as MACCSKeys or other molecular fingerprint algorithms) to indicate whether a specific substructure or functional group exists in the molecule.
[0039] In this embodiment of the invention, the "target drug development process entry" refers to drug development process information highly relevant to the query request, retrieved from the corresponding drug knowledge base. This includes formulation composition, usage of various materials (e.g., excipients), various process parameters (e.g., formulation process parameters), and various experimental data. This entry, as part of the enhanced query text, provides contextual knowledge support based on process principles for the large language model. The target drug development process entry includes, for example, formulation development process entries for the target drug. The formulation development process information represents formulation development process information highly relevant to the user's query, retrieved from the pharmaceutics knowledge base. This may include, but is not limited to: formulation composition, excipient selection criteria, key formulation process steps, core process parameters, process window settings, quality control points, and related experimental data.
[0040] In this embodiment of the invention, "language conversion" refers to the process of converting a query request and a target drug development process entry into a unified language when there are language differences. This operation ensures the semantic consistency of text fusion and the correctness of structured prompts.
[0041] In this embodiment of the invention, a "drug knowledge base" refers to a database system formed by structuring and characterizing documents in the field of drug development (including first knowledge documents such as books, papers, patents, and regulations, and second knowledge documents such as prescriptions, processes, and experimental data). The knowledge base includes a text vector database and a chemical structure database, and can support multi-level retrieval, semantic retrieval, and similarity retrieval based on the molecular fingerprint of chemical structures.
[0042] In this embodiment of the invention, a "text knowledge block" refers to a structured text unit formed by processing general knowledge documents (books, papers, patents, regulations) through segmentation, merging, and metadata annotation. Each knowledge block contains explicit semantic information and corresponding metadata (such as text type, source file name, chapter title, etc.) for knowledge base indexing and retrieval.
[0043] In this embodiment of the invention, "vector database" refers to a database formed by vectorizing text knowledge blocks through a text embedding model. Each vector contains the semantic representation and index information of the text block, which is used for retrieval and sorting based on semantic similarity.
[0044] In this embodiment of the invention, the "chemical structure database" refers to a structured data set formed after performing table field recognition, dictionary conversion, deduplication of chemical structures, and calculation of molecular features on the second knowledge document. The chemical structure database is stored in key-value pairs of "structured process entry: chemical structure molecular fingerprint" and is used for chemical similarity retrieval and enhanced query text construction.
[0045] In this embodiment of the invention, "prompt word template" refers to a formatted template used to organize input information in a large language model, including a knowledge retrieval section (containing contextual knowledge blocks and their metadata) and an instruction compliance section (defining generation rules, such as expert role instructions, structured answer requirements, citation annotation requirements, etc.).
[0046] In this embodiment of the invention, "structured enhanced prompt words" are text information that can be directly input into a large language model after the enhanced query text is fused with the target knowledge set.
[0047] In this embodiment of the invention, the "candidate knowledge set / target knowledge set" is a preliminary set of relevant entries retrieved from the knowledge base based on the enhanced query text; the target knowledge set is a set of highly relevant entries retained after being filtered by a relevance threshold, which is used for prompt word generation and model input.
[0048] In this embodiment of the invention, the "reordering model" refers to a model that uses deep learning methods to finely calculate the matching degree between the candidate knowledge set and the query request, especially a cross-encoder model finely tuned with knowledge from the fields of pharmaceutics, pharmacology, or drug solid crystal forms, in order to improve the professionalism and accuracy of knowledge retrieval.
[0049] The following is through Figure 1 An exemplary system architecture of an embodiment of the present invention will be described.
[0050] Figure 1 This is a schematic diagram of a system architecture according to an embodiment of the present invention. The system architecture includes a computing device 10, and may also include a network, storage device, etc.
[0051] The computing device 10 is used to run a program for generating questions and answers based on knowledge in the field of drug development. Specifically, the computing device 10 receives user query requests, executes the question-and-answer program, and then outputs a professional answer based on the user request, which includes citation information.
[0052] refer to Figure 1 The question-answering generation scheme based on drug development knowledge executed by computing device 10 can receive user query requests and optimize the text of these requests to enhance their structure, semantics, and specialization. This involves introducing drug development process entries highly relevant to the query question, giving the enhanced query text contextual knowledge that can be utilized by the large language model. This provides a small-sample hint based on real-world drug development processes for subsequent retrieval and question-answering generation, resulting in enhanced query text. The enhanced query text is then retrieved from a pre-built drug knowledge base, and the search results are filtered to select the knowledge entries that best match the query semantics and related drug processes, forming a highly relevant knowledge set for question-answering generation, thus obtaining the target knowledge set. Finally, based on existing prompt word templates, the obtained enhanced query text is fused with the target knowledge set, giving the prompts input to the large language model a fixed structure, clear logic, and identifiable knowledge boundaries. This improves model processing efficiency and reduces generation ambiguity, resulting in structured enhanced prompt words. Finally, the obtained structured enhanced prompts are used as input to the large language model, and the response of the large language model is the output, which includes citation information.
[0053] The computing device 10 can be a server.
[0054] For example, the server can be a rack server, blade server, tower server, or cabinet server, etc. The server can be a standalone test server or a test server cluster composed of multiple test servers.
[0055] In this embodiment, the computing device 10 is connected to the storage device via a network. The aforementioned network can be an intranet, the Internet, Global System for Mobile Communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G, 5G, Bluetooth, Wi-Fi, or a voice communication network, or other wireless or wired networks. The aforementioned storage device can be any available medium accessible to the computing device 10, or a data storage device such as a server or data center that integrates one or more available media. This available medium can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0056] The technical solution of this invention will be described in detail below: Figure 2 This is a flowchart illustrating a question-answer generation method based on knowledge in the field of drug development, according to an embodiment of the present invention. (Refer to...) Figure 2 The method may include: S210, Obtain the user's query request; In exemplary embodiments, the query request can be triggered by the user and received by the system through various interactive methods, such as: inputting natural language text through a graphical user interface input box, sending query instructions in a structured format through an application programming interface (API), or converting voice input into text data via a speech recognition module. The query request is typically used to express the user's information needs in the drug development process, such as inquiring about the formulation development strategy, excipient screening logic, process parameter setting principles, medicinal chemical characteristics, crystal form evaluation methods, or regulatory restrictions for a specific active pharmaceutical ingredient (API). Because drug development is a highly specialized field, user query requests often present diverse expressions, including natural language descriptions, chemical structure strings (such as SMILES), formulation ratio parameters, experimental result summaries, or partially incomplete contextual fragments.
[0057] In an exemplary embodiment, the drug development field includes at least one of the following: a pharmaceutical formulation vertical field, a pharmaceutical chemical synthesis vertical field, and a pharmaceutical solid-state crystal form vertical field. In an exemplary preferred embodiment, the drug development field is a pharmaceutical formulation vertical field.
[0058] S220, The query request is optimized to obtain enhanced query text; wherein, the enhanced query text includes target drug development process entry information to provide contextual knowledge support based on drug development process. This step optimizes the query text to obtain enhanced query text. It aims to integrate the user's natural language query with structured knowledge within the field of drug development processes, enabling the large model to obtain contextual knowledge support highly relevant to the target chemical structure and related development processes when generating the response. This step utilizes chemical structure standardization, molecular fingerprint-based similarity retrieval, and cross-language information fusion to deeply match drug development process entries with the user query, thereby improving the accuracy and professionalism of query parsing.
[0059] In an exemplary embodiment, the chemical structure string in the query request is automatically identified and standardized to obtain a standard chemical structure formula. For example, the input text can be scanned based on a predefined regular expression or a deep learning-based chemical entity recognition model to locate the chemical structure descriptions contained therein, such as SMILES structures, InChI, molecular formulas, or other resolvable chemical expressions. For the identified structural information, the system calls cheminformatics tools (such as RDKit, OpenBabel, etc.) for normalization processing, including standardizing atomic valence states, completing stereochemical descriptions, and unifying bond type representations, to generate a unique standardized structural representation (such as canonical SMILES or InChIKey). Through the above standardization process, parsing deviations caused by inconsistent writing formats of the same chemical structure can be effectively avoided, improving the accuracy of subsequent structural similarity matching.
[0060] After generating the standard chemical structure formula, the system calculates its molecular fingerprint based on this structure. Various types of molecular fingerprint algorithms can be employed, such as path-based fingerprints (e.g., Daylight fingerprints), ring-feature-based fingerprints, ECFP (Extended-Connectivity Fingerprint) fingerprints based on substructure topology, and MACCS keys based on specific drug properties. The system can select one or more fingerprint combinations according to specific application scenarios to improve the adaptability of similarity retrieval to different types of drug structures.
[0061] The generated target structure molecular fingerprint is compared with the structural fingerprints corresponding to drug development process entries stored in a pre-built drug knowledge base. Similarity calculations are performed using methods such as the Tanimoto coefficient, Dice coefficient, or cosine similarity. In some embodiments, a multi-fingerprint ensemble calculation strategy can be employed, which involves weighted fusion of multiple fingerprint similarities to improve the retrieval sensitivity for compounds with similar structures but significantly different functional groups. Through the above similarity ranking mechanism, one or more drug development process entries that are most similar to the query structure can be automatically retrieved from the knowledge base, i.e., the target drug development process entry.
[0062] After obtaining the drug development process entry that is most similar to the target structure, the entry is merged with the user's original query request to generate enhanced query text.
[0063] Those skilled in the art will understand that in practical applications, drug development process entries in the knowledge base may contain mixed Chinese and English expressions due to the wide range of sources. Therefore, in some other examples of this invention, when the language of the query request and the target drug development process entry is inconsistent, the system can automatically trigger a language conversion module before merging, based on the language difference between the query request and the process entry, to convert both to a consistent language (e.g., all converted to Chinese or all converted to English). Language conversion can be implemented based on statistical machine translation models or neural machine translation models to ensure accuracy of expression and consistency of process terminology.
[0064] After ensuring language consistency, the system utilizes a text generation model or template-based information fusion strategy to combine drug development process entries with the original query, constructing a comprehensive enhanced query text that includes drug structural features, relevant formulation process information, and the user's query intent. The enhanced query text not only retains the user's original needs but also supplements the development process context highly relevant to the target drug structure, making it a few-sample hint signal for large-scale models to perform inference. For example, in the generation of enhanced queries in the pharmaceutical formulation vertical field, the system injects information such as formulation formulations, excipient selection logic, process steps, safety requirements, and quality control parameters matched to the query structure into the enhanced text. This allows large-scale models to reason based on the real process basis of structurally similar drugs when answering professional formulation-related questions, significantly improving the reliability, interpretability, and professional consistency of the generated content. The text enhancement process in this embodiment not only achieves accurate parsing and standardization of the chemical structure in the query but also realizes automatic association of development process knowledge through structural similarity retrieval. This enables the constructed enhanced query text to serve as a few-sample hint based on structural information, improving the generation effect of large-scale models in the field of drug development.
[0065] S230, Based on the enhanced query text, perform retrieval and filtering in the pre-built drug knowledge base to obtain the target knowledge set; This step, based on the enhanced query text generated by S220, performs multi-level retrieval and re-ranking within a pre-built drug knowledge base to obtain a high-quality, strongly causally related set of target knowledge capable of supporting the generation of results by a large model. Since queries in the drug development field typically include multi-dimensional information such as chemical structural features, prescription logic, process parameters, and regulatory points, a single retrieval method often cannot fully capture the query intent. Therefore, this embodiment, through the synergistic fusion of semantic retrieval and keyword retrieval, combined with a cross-encoder re-ranking model fine-tuned from professional corpora in the drug development field, enables the retrieval process to possess both broad coverage and high-precision knowledge matching capabilities, effectively improving the quality of the context ultimately entering the large model.
[0066] In an exemplary embodiment, the system performs multi-level candidate knowledge retrieval based on the enhanced query text. Leveraging the high recall capability at the natural language semantic level, the system employs a vector retrieval module built from a pre-trained language model. This module maps the enhanced query text and knowledge blocks in the knowledge base to vector spaces of the same dimension. Semantic retrieval is achieved by calculating cosine similarity or L2 distance, thereby obtaining a first retrieval result capable of capturing deep semantics such as prescription process logic, excipient functional mechanisms, and structure-property-process relationships. Simultaneously, based on a large number of professional terms (such as "wet granulation," "disintegrant," and "crystal transformation risk") and entity names (such as "microcrystalline cellulose," "povidone," and "anhydrous lactose") used extensively in drug development scenarios, the system extracts keywords from the enhanced query text and performs TF-IDF, BM25, or inverted index retrieval in the knowledge base to obtain a second retrieval result. Since semantic retrieval excels at capturing contextual logic, and keyword retrieval ensures coverage of key entities and professional terms, the system merges the two retrieval results according to preset weights to form a comprehensive and highly relevant candidate knowledge set, thereby improving the input quality of the subsequent ranking module.
[0067] After obtaining the candidate knowledge set, this embodiment further introduces a re-ranking model to rank the candidate knowledge based on relevance. Since texts in the drug development field typically involve causal chains between excipients, processes, and performance, relevance determination cannot be accomplished solely through literal matching. Therefore, this embodiment preferably uses a cross-encoder model fine-tuned based on drug development domain expertise as the re-ranking model. This model can be selected from the cross-encoder structures of BERT, RoBERTa, and ELECTRA, and is fine-tuned using one or more of pharmaceutical expertise (such as formulation processes, excipient functions, and pharmacopoeia regulations), pharmaceutical expertise, and drug solid-state crystal form expertise to significantly improve its ranking performance in terms of formulation logic, process causality, and compliance. For example, for queries containing "risk of crystal form transformation caused by wet granulation," the fine-tuned model can identify that the influencing factors of crystal form transformation belong to the category of drug solid-state properties and determine that the paragraph describing "crystal form changes caused by water content" in the candidate knowledge is highly relevant to the query, while general models cannot capture this professional association.
[0068] During re-ranking, the cross-encoder model receives two inputs: enhanced query text and candidate knowledge blocks, and calculates the relevance score between them one by one. Compared to the dot product similarity of ordinary vector retrieval, the cross-encoder performs deep interactive encoding of the query and candidate knowledge blocks through a multi-layer attention mechanism, which can capture long-range dependencies such as formulation logic, process causal relationships, and physical property influence mechanisms, thereby significantly improving ranking accuracy. In this embodiment, the system can optionally restrict the candidate set to the top N high-recall knowledge blocks to reduce the computational cost of re-ranking, and then select the top few (e.g., M) with the highest scores as the final target knowledge set. Through the above design, the system not only improves the coverage of knowledge recall, but also improves the accuracy of association ranking through a professional domain re-ranking model, making the knowledge context that finally enters the large model both comprehensive and accurate, applicable to various drug development scenarios such as formulation design, process parameter optimization, and excipient substitution analysis.
[0069] In an exemplary embodiment, taking the pharmaceutical formulation vertical domain as an example, the multi-level retrieval process includes a weighted fusion of dense vector retrieval (such as semantic retrieval) and sparse keyword retrieval (such as keyword retrieval), followed by re-ranking using a cross-encoder. The system first uses an embedding model to convert knowledge blocks and queries into high-dimensional vectors, capturing semantic relevance through vector similarity; simultaneously, TF-IDF or BM25 is used for keyword matching to recall knowledge fragments corresponding to professional terms. The system then fuses the two results according to preset weights to achieve a balanced recall of semantics and keywords. After initially recalling N documents, a cross-encoder finely tuned with pharmaceutical expertise is used for re-ranking. The model can understand vertical domain knowledge such as prescription process logic, excipient functional characteristics, and regulatory requirements, and generates a relevance score for each candidate knowledge block. Finally, the system selects the documents with the highest scores to form the final target knowledge set, which supports subsequent large-scale model generation. Through this design, the system can significantly improve the professionalism and reliability of the retrieval results while maintaining a high recall rate, making the results generated by the large model more process-based and interpretable.
[0070] In an exemplary embodiment, the construction of the above-mentioned drug knowledge base includes: Acquiring drug development knowledge, which includes: a first knowledge document and a second knowledge document; the first knowledge document includes at least one of books, papers, patents, and regulations; the second knowledge document includes at least one of prescriptions, processes, and experimental data. The combination of different types of knowledge ensures that the knowledge base possesses both academic authority and practical effectiveness in process manufacturing.
[0071] For first-level knowledge documents containing numerous paragraphs and complex chapter structures, this implementation method transforms them into appropriately granular and easily searchable text knowledge blocks through knowledge structuring. Specifically, the document can be initially segmented based on the document title level, making the chapter boundaries structurally interpretable. Building upon this, semantic segmentation algorithms can be applied to semantically consistently divide long paragraphs, allowing each text block to focus more on a single concept or process logic. For text fragments still containing too many semantic units, further fine-grained segmentation can be performed. This multi-level structuring process enables knowledge blocks to form a clear and well-defined hierarchical structure, making it more suitable for the input requirements of semantic vector retrieval models and cross-encoder models.
[0072] To avoid insufficient semantic information due to overly short knowledge blocks, this implementation further merges text blocks below a preset length threshold to improve retrieval stability.
[0073] In addition, by labeling each knowledge block with metadata such as text type, source, and chapter title, and then combining it with subsequent structured prompt word templates, the large language model can maintain the traceability of references and the ability to interpret context when generating answers.
[0074] After obtaining the text knowledge blocks, this implementation method employs a text embedding model to vectorize them, generating a vector database containing vector indexes. The embedding model can be a general semantic model or a specialized vector model fine-tuned based on a pharmaceutical corpus. Vectorization enables the text knowledge blocks to have a computable distance metric in a high-dimensional semantic space, supporting subsequent dense semantic retrieval, similarity ranking, and knowledge fusion processes. This step makes complex pharmaceutical knowledge machine-readable, allowing the system to trace back to semantically relevant technical content even when faced with user queries expressed in different ways.
[0075] For the second knowledge document, since it is mostly presented in the form of tables or experimental records, this implementation method adopts a standardization process based on a chemical structure matching strategy to ensure the uniqueness and comparability of process entries. Specifically, the tables can be converted into structured text according to a dictionary structure of "column name: text content", and complete entries can be constructed based on fields such as drug number, generic name, chemical structure, specifications, excipient name, excipient dosage, and process parameters. Using chemical molecular structure identifiers as the deduplication benchmark can avoid the same active pharmaceutical ingredient being repeatedly included in the knowledge base due to differences in trade name, specifications, or process text, ensuring the structural stability of the database and facilitating the implementation of subsequent chemical similarity-based retrieval strategies.
[0076] To further enhance the retrieval capability of this type of knowledge, this implementation calculates the chemical structural features of the active pharmaceutical ingredient in structured process entries. Chemical structure fields in process entries are parsed using cheminformatics tools (such as parsing programs based on SMILES or MOL formats), generating molecular fingerprints representing their structural features. A data structure with "structured process entry: chemical molecular fingerprint" as key-value pairs is constructed, ultimately forming a chemical structure database. Molecular fingerprints are highly compressed structural feature codes that reflect the atomic neighborhood characteristics, functional group distribution, and topological structure of active ingredients. Their introduction allows the system to utilize structural similarity to recall process entries during queries, thereby providing more pharmaceutically logical knowledge support in process-related question-and-answer tasks. For example, when a user queries about formulation excipient compatibility or crystal form influence, drugs with similar chemical structures can provide valuable references, significantly improving the rationality of the answer and the quality of process inference.
[0077] By constructing the aforementioned text vector database and chemical structure database, this implementation method forms a drug knowledge base with semantic retrieval capabilities, structural fingerprint retrieval capabilities, and high traceability. It can support subsequent key steps such as enhanced querying, multi-level hybrid retrieval, multi-modal reordering, and structured prompt word generation, effectively improving the professionalism, accuracy, and reliability of question-answering tasks in the field of drug development.
[0078] S240, Based on the prompt word template, the enhanced query text is fused with the target knowledge set to obtain structured enhanced prompt words; In an exemplary embodiment, based on the enhanced query text obtained in S220 and the target knowledge set obtained in S230, the system also needs to perform knowledge fusion processing based on the prompt word template to construct a structured enhanced prompt word that can be directly called by a large language model. This structured prompt word not only provides the model with clearly sourced and hierarchically structured professional contextual knowledge, but also defines the rules that the model should follow when generating answers in the field of drug development, thereby ensuring the controllability, professionalism, and traceability of the final output.
[0079] In an exemplary embodiment, the system first performs structuring processing on each knowledge block in the target knowledge set. Each knowledge block originates from the aforementioned hybrid retrieval and reordering stage, and its text content typically involves key R&D information such as pharmaceutical formulation design logic, excipient functional basis, formulation processing parameters, crystal form and stability data, etc. To improve the interpretability between these knowledge blocks and the large model's generation behavior, they can be integrated with corresponding metadata to form structured knowledge block records. Metadata may include, but is not limited to, knowledge block identification information (such as unique ID), source information (such as regulatory entries, document numbers, pharmacopoeia chapters, manual versions), content type information (such as "formulation process steps," "excipient characteristic description," "regulatory requirements," etc.), and hierarchical heading information (such as chapter number, second-level heading, or content topic). This structured information provides the model with contextual semantic cues, enabling it to understand the knowledge source, content category, and hierarchical relationship when generating answers, thus achieving more stable task behavior.
[0080] After completing the above-mentioned structuring process, the system further utilizes preset prompt word templates to embed the set of structured knowledge blocks into the retrieval knowledge section of the template. The prompt word templates can take various forms to adapt to different drug development scenarios; for example, for a typical prescription process consultation scenario in drug formulation development, the retrieval knowledge section of the template can be designed as a hierarchical context container holding "knowledge block text + metadata fields," enabling the large model to distinguish the source and logical location of different content. To ensure that the model meets regulatory compliance, professional consistency, and structured expression requirements during generation, the template can also include an instruction compliance section. This section can include instructions such as setting the role of drug formulation experts, answer structure requirements, whether inline citations need to be marked in the text, whether an independent reference list needs to be generated, and whether causal analysis based on context is required. In this way, prompt words not only provide cross-document knowledge support but also explicitly constrain the model's generation behavior, thereby improving the reliability and consistency of the generated results.
[0081] In an exemplary embodiment, taking structured enhanced prompts in the pharmaceutical formulation vertical field as an example, the system first selects the top M highly relevant knowledge blocks after reordering, retains their metadata, and integrates them into the retrieval knowledge section of the prompt template to achieve structured contextual knowledge integration. For the hierarchical information, content type differences, and corresponding literature sources that may exist between different knowledge blocks, the system embeds them in a unified format to ensure that the model can understand the relative relationships between each knowledge block. Furthermore, the system can use regularized text boundaries (e.g., special delimiters, title fields, or JSON or similar structures) to achieve a highly explicit knowledge organization method, enabling the model to accurately identify the semantic attributes of each piece of content when parsing prompts. This structured approach significantly improves the interpretability of retrieval knowledge and reduces the probability of the model misusing context compared to traditional "plain text stacking prompts."
[0082] In some further embodiments, the system still needs to ensure the traceability of the generated content, so citation verification can be performed on the basis of structured enhanced prompts. The preliminary answer generated by the model usually contains inline citation identifiers (such as [1], [2], etc.). The system determines whether the citation actually exists by comparing these citation numbers with the list of knowledge blocks provided in the prompts. If the citation does not exist or the corresponding content does not match, the citation can be removed to avoid outputting error information. For citations that pass verification, the system can integrate their corresponding metadata into standardized contextual reference entries, so that the final answer has traceability similar to an expert technical report. Finally, the system can sort all valid citations by index and generate a structured "references" list after the main answer.
[0083] S250, the structured enhanced prompt words are input into the large language model to obtain the output result; wherein, the output result includes citation information.
[0084] In an exemplary embodiment, after constructing the structured enhanced prompts, these prompts are input into a pre-deployed large language model to generate output containing citation information. Specifically, the structured enhanced prompts typically consist of two parts: one part is contextual knowledge content obtained by fusing the enhanced query text and the target knowledge set, and the other part is the generation specifications preset by the prompt template. These structured enhanced prompts are provided to the large language model as a unified input sequence, enabling the model to simultaneously receive semantic intent information from the user query and high-quality knowledge content related to pharmacy obtained through retrieval during the reasoning stage. This results in stronger professional consistency and traceability in answer generation.
[0085] In exemplary embodiments, the large language model can be an autoregressive generative model based on the Transformer architecture, such as an open-source or commercial language model with billions to hundreds of billions of parameters; alternatively, it can be a hybrid language model with retrieval enhancement capabilities. After inputting structured enhancement prompts, the model first performs semantic parsing of contextual knowledge blocks, including metadata fields, based on its internal attention mechanism. This automatically establishes contextual relationships between the enhanced query text and the knowledge blocks, enabling the model to identify the hierarchical structure, content type, and key knowledge sources to refer to when interpreting the question. For example, in a query scenario related to pharmaceutical preparations, the model will prioritize content such as prescription process steps, excipient functional descriptions, or physicochemical properties to generate answer text consistent with the pharmaceutical knowledge system.
[0086] When generating answers, the large language model also follows a partially standardized answer process based on instructions in the prompt word template. This includes reasoning in the tone of a pre-defined expert role, organizing the main content according to a structured format, and automatically inserting citation markers for corresponding knowledge blocks at the end of sentences. Because the target knowledge set has undergone the aforementioned multi-level retrieval and reordering processes, its content possesses high relevance and professional accuracy. Therefore, the model can reference and match knowledge blocks that actually exist in the context when generating each answer, making the final output citation information verifiable. In this embodiment, the citation information included in the output results can include inline citations labeled by number, as well as a contextual reference list generated based on knowledge block metadata. Through the above methods, this embodiment achieves controllable generation of a large language model for the pharmaceutical field, ensuring that the model output not only possesses professional depth but also has a traceable citation chain, significantly improving the reliability and compliance of the generated content in drug development scenarios.
[0087] The above text combined Figure 2 This paper describes an embodiment of the question-answering generation method based on knowledge in the field of drug development according to the present invention. The following section combines... Figure 3 An embodiment of the apparatus of the present invention is described.
[0088] Figure 3 This is a schematic block diagram of a question-and-answer generation device 300 based on knowledge in the field of drug development, provided as an embodiment of the present invention. The device 300 can be configured in an electronic device.
[0089] refer to Figure 3 The question-and-answer generation device 300 based on knowledge in the field of drug development includes: an acquisition module 310, an optimization module 320, a retrieval module 330, a fusion module 340, and an output module 350.
[0090] The system includes: an acquisition module 310 for acquiring user query requests; an optimization module 320 for optimizing the query request text to obtain enhanced query text, wherein the enhanced query text includes target drug development process entry information to provide contextual knowledge support based on drug development process; a retrieval module 330 for performing retrieval filtering in a pre-built drug knowledge base based on the enhanced query text to obtain a target knowledge set; a fusion module 340 for fusing the enhanced query text with the target knowledge set based on prompt word templates to obtain structured enhanced prompt words; and an output module 350 for inputting the structured enhanced prompt words into a large language model to obtain output results, wherein the output results include citation information.
[0091] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details will not be provided here. Specifically, Figure 3 The device 300 shown can perform Figure 2 The corresponding method embodiments, and the foregoing and other operations and / or functions of each module in device 300 are respectively implemented to achieve Figure 2 For the sake of brevity, the corresponding processes in each method are not described in detail here.
[0092] The apparatus 300 of this invention, in conjunction with the accompanying drawings, has been described above from the perspective of functional modules. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments of this invention can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0093] Figure 4 This is a schematic block diagram of an electronic device 400 provided in an embodiment of the present invention. The electronic device 400 may be the training device or execution device described above, but is not limited thereto. Figure 4 As shown, the electronic device 400 may include: The system includes a memory 410 and a processor 420. The memory 410 stores a computer program 430 and transfers the computer program 430 to the processor 420. In other words, the processor 420 can retrieve and run the computer program 430 from the memory 410 to implement the method described in this embodiment of the invention.
[0094] For example, the processor 420 can be used to execute the steps in the above method according to the instructions in the computer program 430.
[0095] In some embodiments of the present invention, the processor 420 may include, but is not limited to: General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0096] In some embodiments of the present invention, the memory 410 includes, but is not limited to: Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0097] In some embodiments of the present invention, the computer program 430 may be divided into one or more modules, which are stored in the memory 410 and executed by the processor 420 to perform the method provided by the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 430 in the electronic device.
[0098] like Figure 4 As shown, the electronic device 400 may further include: Transceiver 440, which can be connected to processor 420 or memory 410.
[0099] The processor 420 can control the transceiver 440 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 440 may include a transmitter and a receiver. The transceiver 440 may further include antennas, and the number of antennas may be one or more.
[0100] It should be understood that the various components in the electronic device 400 are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.
[0101] According to one aspect of the present invention, a computer-readable storage medium is provided having computer instructions or a program stored thereon, which, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of the present invention also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.
[0102] According to another aspect of the present invention, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method of the above-described method embodiments.
[0103] In other words, when implemented using software, it can be implemented wholly or partially as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, the process or function according to embodiments of the present invention is generated, wholly or partially. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0104] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0105] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or modules may be electrical, mechanical, or other forms.
[0106] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs. For example, the functional modules in the various embodiments of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0107] The embodiments of the present invention are described in detail below. It should be noted that the embodiments described below are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0108] Example 1: Intelligent Design Flow of Risdiplam Orally Disintegrating Tablets Formulation and Process Based on Large Language Model This embodiment provides a specific application of a question-answering generation method for pharmaceutical formulations based on a large natural language model in the design scenario of a novel orally disintegrating tablet for liximab, illustrating the feasibility of the present invention in pharmaceutical formulation development tasks. The system architecture and data processing flow in this embodiment can be found in [reference needed]. Figure 5 and Figure 6Its functions cover various R&D stages, including chemical structure identification of active pharmaceutical ingredients (APIs), comprehensive drug characteristic analysis, new dosage form design, and production process generation. By combining the database construction module with a vertical domain architecture consisting of a text optimization module, a search filtering module, and a knowledge fusion module, this embodiment can achieve accurate and verifiable answers to complex questions in the pharmaceutical formulation field.
[0109] In this embodiment, the development of orally disintegrating tablets of risdiplam is taken as a specific application scenario, and the question-and-answer generation method can be performed according to the following steps.
[0110] First, the user inputs the chemical structure identifier of the active pharmaceutical ingredient to be identified. In this embodiment, the input is the SMILES string "Cc1cn2nc(-c3cc(=O)n4cc(N5CCNC6(CC6)C5)ccc4n3)cc(C)c2n1". The system's text optimization module performs chemical structure parsing and format standardization on this string, and retrieves the corresponding formulation process entries in the knowledge base based on the generated structural feature vector. This rewrites the user query, making the query content more accurately reflect the relevant background needs related to the chemical structure. Subsequently, the retrieval and filtering module performs dense vector retrieval and sparse keyword retrieval in parallel, recalling the most relevant pharmaceutical knowledge blocks related to the chemical structure, including information on marketed drugs, literature data, and patent entries. The system uses a re-ranking model fine-tuned in the pharmaceutical field to select the optimal contextual knowledge from the recall results and inputs it along with the rewritten query into the large language model. With guidance from the "pharmaceutics expert" role, the large language model determines that the structure uniquely corresponds to "Risdiplam" based on contextual knowledge, and outputs its generic name and relevant source citations, thus achieving accurate identification of the chemical structure of the active pharmaceutical ingredient.
[0111] Subsequently, the user submits an analysis request regarding the comprehensive properties of the identified active pharmaceutical ingredient (API). While preserving the context of the dialogue, the system again invokes the hybrid search process to retrieve physicochemical property research data such as the solubility and stability of lisclavulanic acid, structure-activity relationship literature, and information on its mechanism of action and pharmacokinetic characteristics from pharmacological databases. Through structured integration of these sources, the system generates a comprehensive analysis report including physicochemical properties, SMN2 splicing regulation mechanism, and oral absorption and metabolism characteristics. This report provides a scientifically evidence-based analytical foundation for subsequent dosage form development, demonstrating the technical effectiveness of this invention in precise drug knowledge retrieval and contextual reasoning.
[0112] Furthermore, the user requested the system to design an orally disintegrating tablet form for liscitabine. The system identified "orally disintegrating tablet" as the core dosage form requirement and, combining this with key drug attributes identified in the preceding steps such as "low water solubility" and "suitable for pediatric use," retrieved formulation knowledge related to orally disintegrating tablet design from the knowledge base, including common excipient categories, solubilization strategies, and formulation design specifications. After integrating existing liscitabine formulation information and precedents for orally disintegrating tablet formulations of other drugs, the system performed cross-document formulation rationale reasoning, generating a structured formulation scheme including active ingredients, fillers, disintegrants, solubilizers, and sweeteners, and providing the rationale for selecting each excipient. For example, the system recommended the use of sulfobutyl ether-β-cyclodextrin (SBE-β-CD) in the formulation to improve the dissolution rate of poorly soluble drugs, based on evidence retrieved from relevant solubilization studies. This step demonstrates the ability of the method of this invention to achieve knowledge-driven decision support in highly specialized formulation design tasks.
[0113] After obtaining the new dosage form formulation, the user further requests the construction of a corresponding manufacturing process. The system conducts in-depth analysis of process development documents and related patents in the knowledge base, identifying the characteristics of lisciniforme that are susceptible to the effects of metal ions and high humidity environments during formulation production. This characteristic is often difficult to obtain directly from a single document in traditional formulation design. In this embodiment, after considering the technical paths for preparing orally disintegrating tablets (such as direct compression or dry granulation), the system provides a suitable process based on the characteristics of lisciniforme and offers mitigation measures for potential risks. For example, the system recommends using dry granulation to reduce moisture introduction and points out that colorants containing iron oxide should be avoided in the coating material. The final output process results include the process steps of key unit operations (mixing, granulation, tableting, coating), the range of key parameters (such as roller pressure, equipment speed, drying temperature) and their supporting explanations, and lists verifiable citation sources to ensure the traceability and practicality of the process scheme.
[0114] As can be seen from this embodiment, the pharmaceutical formulation vertical domain question-answering generation method described in this invention can support the entire R&D process from chemical structure identification and comprehensive drug characteristic analysis to new dosage form formulations and processes, and provides structured and traceable professional output at each step. Compared with traditional tools based on keyword indexing or knowledge graphs, the method of this invention performs better in complex reasoning and professional knowledge integration. Figure 7 This can significantly improve the accuracy of information acquisition and the scientific reliability of generated content during the formulation development process.
[0115] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0116] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A question-answer generation method based on knowledge in the field of drug development, characterized in that, The method includes: Get the user's query request; The query request is optimized to obtain enhanced query text; wherein, the enhanced query text includes information on the target drug development process, so as to provide contextual knowledge support based on the drug development process. Based on the enhanced query text, a search and filtering process is performed in a pre-built drug knowledge base to obtain the target knowledge set; Based on the prompt word template, the enhanced query text is fused with the target knowledge set to obtain structured enhanced prompt words; The structured enhanced prompt words are input into a large language model to obtain the output results; wherein, the output results include citation information.
2. The method according to claim 1, characterized in that, The text optimization of the query request to obtain enhanced query text includes: The chemical structure string in the query request is standardized to obtain the standard chemical structure formula; Molecular fingerprint calculations were performed on the standard chemical structure formula to obtain the chemical structure molecular fingerprint; The chemical structure molecular fingerprint is used for similarity retrieval in the pre-built drug knowledge base to obtain the target drug development process entry; The target drug development process entries are merged with the query request to obtain enhanced query text; Optionally, the step of fusing the target drug development process entry with the query request to obtain enhanced query text includes: Based on the language difference between the query request and the target drug development process entry, a language conversion is performed to obtain the target drug development process entry and the query request in the same language; The target drug development process entries in the same language are merged with the query request to obtain enhanced query text; wherein the enhanced query text is in the same language as the target drug development process entries.
3. The method according to claim 1, characterized in that, The enhanced query text is used to perform retrieval and filtering in a pre-built drug knowledge base to obtain a target knowledge set, including: Based on the enhanced query text, a multi-level search is performed in a pre-built drug knowledge base to obtain a set of candidate knowledge. Based on the relevance between the candidate knowledge set and the query request, the candidate knowledge set is sorted to obtain a sorting result; Based on the relevance threshold, the ranking results are filtered to obtain the target knowledge set; Optionally, the step of performing multi-level retrieval on a pre-built drug knowledge base based on the enhanced query text to obtain a candidate knowledge set includes: Based on the enhanced query text, a semantic search is performed in a pre-built drug knowledge base to obtain the first search result; Based on the enhanced query text, a keyword search is performed in a pre-built drug knowledge base to obtain a second search result; wherein, the keywords include at least one of: professional terms and entity names; The first search result and the second search result are weighted and fused to obtain a candidate knowledge set; Optionally, the step of sorting the candidate knowledge set based on the relevance between the candidate knowledge set and the query request to obtain a sorting result includes: Based on the reordering model, the relevance between the candidate knowledge set and the query request is calculated to obtain the relevance results; Based on the relevance results, the candidate knowledge set is sorted to obtain the sorting results; Preferably, the reordering model is selected from a cross-encoder model fine-tuned based on drug development knowledge, wherein the drug development knowledge includes at least one of pharmaceutics expertise, pharmaceutical expertise, and drug solid-state crystal form expertise, and the pharmaceutics expertise includes at least one of formulation process, excipient function, and pharmacopoeia regulations.
4. The method according to claim 1, characterized in that, The step of fusing the enhanced query text with the target knowledge set based on the prompt word template to obtain structured enhanced prompt words includes: Each knowledge block in the target knowledge set is fused with its metadata to obtain a structured knowledge block set; wherein the metadata includes at least one of the following: identification information, source information, content type information, and hierarchical title information; The structured knowledge block set is embedded into the prompt word template according to a preset format and combined with the enhanced query text to obtain structured enhanced prompt words; Preferably, the prompt word template includes: The knowledge retrieval section is used to contain contextual chunks of text and their corresponding metadata fields; The instruction follow section is used to define the generation rules, including at least one of the following: drug domain expert role instructions, context analysis requirements, structured subject response requirements, inline citation requirements, and independent reference list output requirements.
5. The method according to any one of claims 1-4, characterized in that, Further includes: The reference information in the output results is verified; The verification includes: checking whether the citation number in the preliminary answer actually exists in the provided context; and removing invalid citation markers.
6. The method according to any one of claims 1-4, characterized in that, The construction of the drug knowledge base includes: Acquiring drug development knowledge, wherein the drug development knowledge includes: a first knowledge document and a second knowledge document; the first knowledge document includes at least one of: books, papers, patents and regulations; the second knowledge document includes at least one of: prescriptions, processes and experimental data; The first knowledge document is subjected to knowledge structuring processing to obtain text knowledge blocks; The text knowledge blocks are vectorized to obtain a vector database; The second knowledge document is standardized using a chemical structure matching strategy to obtain structured process entries; The chemical structure characteristics of active pharmaceutical ingredients are calculated for the structured process entries to obtain a chemical structure database. A drug knowledge base is constructed based on the vector database and the chemical structure database. Optionally, the knowledge structuring process includes at least one of: block processing, merging processing, and annotation processing; The segmentation process includes: segmenting the first knowledge document based on its title hierarchy to obtain a first text block set; performing semantic segmentation on the first text block set to obtain a second text block set; and performing fine-grained segmentation on the second text block set to obtain a third text block set. The merging process includes merging text blocks whose length is less than a predetermined threshold; The annotation process includes: annotating each knowledge block with metadata, the metadata including at least one of: text type, source file name, and chapter title; Optionally, the text vectorization process performed on the text knowledge block to obtain a vector database includes: The text knowledge blocks are formatted using a text embedding model to generate vectorized text with an index, resulting in a vector database. Optionally, the standardization process of the second knowledge document based on a chemical structure matching strategy to obtain structured process entries includes: Obtain the second knowledge document form; The second knowledge document table is converted into structured text using a dictionary data structure of "column name: text content"; the column name includes at least one of the following: drug number, generic name, chemical structure, specification, excipient name, excipient dosage, and process parameters; The structured text is deduplicated using chemical molecular structure identifiers to obtain structured process entries. Optionally, the calculation of the chemical structure characteristics of the active pharmaceutical ingredient for the structured process entries to obtain a chemical structure database includes: The structured process entries are analyzed using cheminformatics tools to obtain the molecular fingerprint of the chemical structure; A dictionary data structure with "structured process entry: chemical structure molecular fingerprint" as key-value pairs is constructed to obtain a chemical structure database; Optionally, the drug development field includes at least one of the following: pharmaceutical formulation vertical field, pharmaceutical chemical synthesis vertical field, and pharmaceutical solid crystal form vertical field; Preferably, the drug development field is the pharmaceutical formulation vertical field.
7. A question-and-answer generation device based on knowledge in the field of drug development, characterized in that, The device includes: The acquisition module is used to acquire user query requests; An optimization module is used to optimize the query request to obtain enhanced query text; wherein, the enhanced query text includes target drug development process entry information to provide contextual knowledge support based on drug development process. The retrieval module is used to perform retrieval and filtering in a pre-built drug knowledge base based on the enhanced query text to obtain the target knowledge set; The fusion module is used to perform knowledge fusion between the enhanced query text and the target knowledge set based on the prompt word template to obtain structured enhanced prompt words; The output module is used to input the structured enhanced prompt words into the large language model and obtain the output result; wherein the output result includes citation information.
8. An electronic device, characterized in that, include: Processor and memory; The memory is used to store computer programs; The processor is configured to execute the computer program to implement the question-answer generation method based on knowledge in the field of drug development as described in claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions or programs that, when executed on a computer, cause the question-and-answer generation method based on knowledge in the field of drug development as described in claims 1 to 6 to be executed.
10. A computer program product, characterized in that, The computer program product includes computer instructions that, when some or all of the computer instructions are run on a computer, cause the question-and-answer generation method based on knowledge in the field of drug development as described in claims 1 to 6 to be executed.