A special disease and special prescription cross-modal retrieval method and system based on contrast learning
Patent Information
- Application Number
- CN202610864774.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-16
- Publication Date
- 2026-08-18
AI Technical Summary
[0005]本发明的目的是提供一种基于对比学习的专病专方跨模态检索方法及系统,以解决现有技术中存在的多药方配伍关系不完善、药效趋向性表达不准确、计算结果可靠性偏低的问题
本发明提供通过获取药方文本信息并提取结构化药方,并确保所处理的药方数据在剂量上符合安全规范;然后根据匹配度测试样本生成药方评价参数,调整匹配度测试样本的匹配度,动态优化匹配度模型的匹配准确性,为药方检索和评估奠定可靠的数据基础。
Smart Images

Figure CN122594469A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data retrieval technology, specifically relating to a cross-modal retrieval method and system for specific diseases and prescriptions based on contrastive learning. Background Technology
[0002] With the expanding application of technologies such as big data and artificial intelligence in the medical and health field, especially in the field of traditional Chinese medicine, the specialized disease prescriptions, as a treatment model that emphasizes syndrome differentiation and treatment based on individual conditions, can improve clinical efficacy and optimize treatment pathways by efficiently mining, organizing and applying the specialized disease prescription information contained in traditional Chinese medicine literature, combined with personalized and precise analysis of the patient's actual condition.
[0003] When processing and applying information on specific diseases and prescriptions in traditional Chinese medicine (TCM), the information on prescriptions in traditional TCM literature is scattered and inconsistent in format. Conventional manual retrieval and organization are inefficient, making it difficult to obtain comprehensive and accurate data on specific diseases and prescriptions in a short period of time. Existing technologies mostly match prescriptions based on symptom reports, deleting minor components of prescriptions and easily overlooking the synergistic effects of ingredients in prescriptions. Especially in the process of screening multiple prescriptions, the lack of in-depth identification of the pharmacological mechanisms of prescriptions, drug interactions, and individual patient differences can easily lead to the erroneous elimination of certain key components in the early matching stage, resulting in poor efficacy of the selected prescriptions. Furthermore, existing disease-specific prescription retrieval databases lack the ability to classify and archive traditional Chinese medicine prescriptions, making it difficult to achieve structured management and knowledge graph construction of massive prescriptions. This limits the in-depth mining and intelligent recommendation of disease-specific prescription knowledge, and affects the application and value of traditional Chinese medicine disease-specific prescriptions in clinical practice.
[0004] In summary, this invention provides a cross-modal retrieval method and system for specific diseases and prescriptions based on contrastive learning. Summary of the Invention
[0005] The purpose of this invention is to provide a cross-modal retrieval method and system for specific diseases and prescriptions based on contrastive learning, so as to solve the problems of imperfect compatibility relationships of multiple prescriptions, inaccurate expression of efficacy trends, and low reliability of calculation results in the existing technology.
[0006] To achieve the above-mentioned objectives, the technical solution adopted by the present invention is as follows: A cross-modal retrieval method for specific diseases and prescriptions based on contrastive learning includes the following steps: Based on the prescription to be verified, we will prepare to optimize the matching degree model; Execute the matching degree evaluation function to obtain the verification matching degree of the prescription to be verified; Confirm the matching degree to generate the verification result; Evaluate the reliability of the verification results to determine whether the verification results are reliable data; When the verification result is determined to be reliable data, the reliability parameter of the prescription to be verified is updated based on the structured prescription corresponding to the reliable data. When the verification result is determined to be reliable data, the reliable prescription, reliability parameters and overall compatibility score corresponding to the prescription to be verified are output. The step of preparing and optimizing the matching degree model based on the prescription to be verified includes: acquiring the prescription text information and extracting the corresponding structured prescription to generate a matching degree test sample; scoring the matching degree test sample to obtain a scoring result and generating prescription evaluation parameters based on the scoring result; evaluating the matching degree test sample based on the prescription evaluation parameters to obtain a model feedback value; and adjusting the matching degree of the matching degree test sample based on the model feedback value.
[0007] Preferably, the confirmation and verification of the matching degree to form the verification result includes: Determine whether the verification matching degree is within the preset verification tolerance range.
[0008] Preferably, the evaluation of the reliability of the verification result, to determine whether the verification result is reliable data, includes: Determine whether the verification result matches the matching degree corresponding to the matching degree test sample; when the verification result does not match the matching degree corresponding to the matching degree test sample, place the current output prescription corresponding to the prescription to be verified in the subsequent model iteration queue and use it as new input data for model update.
[0009] Preferably, the step of preparing an optimized matching model based on the prescription to be verified further includes: Generate similarity test samples; generate similarity parameters for the similarity test samples based on the scoring model; compare the similarity parameters with the prescription evaluation parameters to determine the effectiveness of the matching model.
[0010] Preferably, generating similarity test samples includes: Set an initial prescription; while retaining the arrangement of medicinal materials in the initial prescription, randomly add at least one new medicinal material with reference to the maximum safe dosage of the new medicinal material; calculate the pharmacological correlation between the new medicinal material and the original medicinal materials in the initial prescription to generate decision parameters; retain or replace the generated similarity test samples according to whether the decision parameters are positive or negative.
[0011] Preferably, generating similarity parameters for similarity test samples based on the scoring model includes: Each medicinal material in the similarity test sample is paired with other medicinal materials to form a medicinal material pair; the pharmacological interaction parameters of each medicinal material pair are calculated; each pharmacological interaction parameter is multiplied by the dosage of its corresponding medicinal material pair and the results are summed to form an overall compatibility score; the overall compatibility score is summed with the score of the initial prescription corresponding to the similarity test sample to obtain the similarity parameter.
[0012] A cross-modal retrieval system for specific diseases and prescriptions based on contrastive learning includes the following modules: The sample acquisition module is used to acquire prescription text information and extract the corresponding structured prescription to generate matching test samples; The matching degree evaluation module is used to execute the matching degree evaluation function to obtain the verification matching degree of the prescription to be verified; The credibility assessment module is used to confirm the verification matching degree to form the verification result, evaluate the credibility of the verification result, and determine whether the verification result is credible data. The parameter update module is used to update the credibility parameters of the prescription to be verified based on the structured prescription corresponding to the credible data when the verification result is determined to be credible data.
[0013] Preferably, it also includes a model validation module; The model validation module is used to generate similarity test samples, generate similarity parameters for the similarity test samples based on the scoring model, and compare the similarity parameters with the prescription evaluation parameters to determine the effectiveness of the matching model.
[0014] Preferably, generating similarity test samples includes: Set an initial prescription; while retaining the arrangement of medicinal materials in the initial prescription, randomly add at least one new medicinal material with reference to the maximum safe dosage of the new medicinal material; calculate the pharmacological correlation between the new medicinal material and the original medicinal materials in the initial prescription to generate decision parameters; retain or replace the generated similarity test samples according to whether the decision parameters are positive or negative.
[0015] Preferably, generating similarity parameters for similarity test samples based on the scoring model includes: Each medicinal material in the similarity test sample is paired with other medicinal materials to form a medicinal material pair; the pharmacological interaction parameters of each medicinal material pair are calculated; each pharmacological interaction parameter is multiplied by the dosage of its corresponding medicinal material pair and the results are summed to form an overall compatibility score; the overall compatibility score is summed with the score of the initial prescription corresponding to the similarity test sample to obtain the similarity parameter.
[0016] Beneficial effects This invention provides a reliable data foundation for prescription retrieval and evaluation by acquiring prescription text information and extracting structured prescriptions, ensuring that the processed prescription data complies with safety standards in terms of dosage; then generating prescription evaluation parameters based on matching degree test samples, adjusting the matching degree of the matching degree test samples, and dynamically optimizing the matching accuracy of the matching degree model.
[0017] This invention re-matches the prescriptions to be verified based on the adjusted matching degree, generates similarity test samples, generates similarity parameters based on the scoring model, and then compares the similarity parameters with the prescription evaluation parameters to identify the effectiveness of the matching degree model in the current sample set, promptly detect and correct model biases, improve the accuracy and reliability of prescription retrieval results, and avoid potential risks caused by model failure.
[0018] This invention obtains the verification matching degree of the prescription to be verified through verification processing. If the verification matching degree is within the set verification tolerance range, it is taken as the verification result; if the verification matching degree exceeds the set verification tolerance range, it is taken as the prediction result; if the verification result is consistent with the matching degree corresponding to the matching degree test sample, the verification result is determined as reliable data, and the reliability parameters are updated based on the structured prescription corresponding to the reliable data. This distinguishes between reliable prescription matching results and prediction results that need further verification, and continuously improves the reliability of prescription data, providing safer and more effective disease-specific prescription suggestions.
[0019] When generating similarity test samples, this invention randomly adds at least one new medicinal material while retaining the original arrangement of medicinal materials in the initial prescription. Pharmacological relevance is calculated to generate decision parameters for screening. Each medicinal material is paired with other medicinal materials to calculate pharmacological interaction parameters, and combined with dosage to form an overall compatibility score. This simulates the dynamic changes in prescription compatibility and evaluates the interactions between medicinal materials. It effectively identifies potential compatibility risks during prescription retrieval, improving the safety and rationality of prescription compatibility. Attached Figure Description
[0020] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a system module diagram of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the scope of protection of the invention.
[0022] Example 1 Please see Figure 1This embodiment provides a cross-modal retrieval method for specific diseases and prescriptions based on contrastive learning, including the following steps: S1. Sample acquisition and formatting: Obtain multiple prescription text information containing historical medication information from various data sources such as electronic medical records, databases of ancient Chinese medicine books, or clinical trial records. Parse each prescription text information to extract structured prescriptions. Among them, the structured prescription records each medicinal material that makes up the prescription and its corresponding drug dosage through a standardized data format; to ensure the standardization and comparability of the data, the drug dosage of all medicinal materials is verified and constrained within the preset dosage range based on the pharmacopoeia or clinical guidelines, so that the medicinal materials can achieve the expected therapeutic effect in clinical application without causing significant toxic side effects. Extract the indications corresponding to each prescription from the original information and set the indications as key symptoms, and set the corresponding prescriptions as key prescriptions. Specifically, diseases that present with specific symptoms or have been clearly diagnosed in medicine, such as colds or hypertension, can be set as the corresponding indications. The indications corresponding to the prescriptions are used as the search criteria or core matching basis to diagnose specific symptoms or diseases. Based on key prescriptions and key symptoms, other prescriptions that are similar to the key prescriptions in terms of medicinal composition or function and indications are selected from a pre-built sample library containing a large amount of prescription and symptom information through preset correlation screening rules. Other prescriptions that are similar are defined as neighboring prescriptions. Other symptoms that are related to the key symptoms in terms of pathology or clinical manifestations are defined as neighboring symptoms.
[0023] The pre-defined correlation screening rules specifically include: if the key prescription is Xiao Chai Hu Tang and the key symptom is cold and fever, the screening rules will find other prescriptions for treating cold and fever from the sample database as neighboring prescriptions, and find accompanying symptoms such as headache and chills as neighboring symptoms; and in specific implementation, the pre-defined correlation screening rules can be formed and screened by an artificial intelligence agent with existing technology. The screening set consists of key prescriptions, key symptoms, neighboring prescriptions, and neighboring symptoms. All samples used in the processing steps are derived from this screening set, ensuring that all samples involved in the calculation are highly correlated with the target disease, thereby improving processing efficiency and the accuracy of the final result.
[0024] S2. Matching degree update and test sample generation: Establish dynamic optimization of prescription evaluation and matching logic; Based on multiple structured prescriptions used as matching degree test samples, generate quantitative prescription evaluation parameters that represent the overall quality benchmark of the current test sample set; Among them, the matching degree test samples are prescription samples with known scores or clinical feedback used to evaluate and optimize the prescription matching degree model. The process of generating prescription evaluation parameters includes: scoring multiple matching test samples one by one according to the preset scoring criteria, summarizing all the scoring results to calculate their arithmetic mean, and using the arithmetic mean as the prescription evaluation parameter; wherein, the preset scoring criteria can be scores based on clinical efficacy feedback and adverse reaction records after addition and subtraction or scores from expert review; Multiple matching test samples are sorted from high to low according to the prescription evaluation parameters, with a focus on analyzing the prescriptions ranked lower. Through the preset analysis logic, common defects or potential decline in efficacy that may exist in the combination of medicinal materials or dosage settings are identified. The preset analysis logic may include statistical analysis and association rule mining to analyze whether the prescriptions ranked lower generally contain a certain medicinal material or a combination of several medicinal materials. Based on this analysis, quantitative adjustment instructions are generated as model feedback values for the existing matching rules. The adjustment instructions are used to adjust the matching degree model, which can be quantitative adjustment coefficients or weight vectors, etc. The matching degree model is a set of calculation methods and weights that include the similarity or matching degree between prescriptions, and is used to measure the matching degree between prescriptions. Specifically, based on this analysis, quantitative adjustment instructions are generated as model feedback values for the existing matching rules. These include: if it is found that prescriptions ranked lower generally contain a combination of two certain medicinal materials, the weight of this combination of medicinal materials in the matching degree model is reduced by adjusting the instructions, and all weights are normalized to ensure that the sum of the weight vectors is 1, thereby forming a complete model feedback value and thus completing the optimization of the prescription matching degree model.
[0025] S3. Similarity parameters are adjusted and matching degree is recalculated. New test samples are generated to test and optimize the adjusted matching degree model. Based on the adjusted matching degree model, multiple prescriptions to be verified are re-matched, and based on the matching results, multiple similarity test samples are generated by randomly adding or subtracting medicinal materials on the basis of the initial prescriptions while ensuring that the pharmacological relevance meets the conditions. The similarity test sample generation process includes: setting an initial prescription as the benchmark for generating new test samples; randomly adding at least one new medicinal material while retaining its original arrangement structure; when adding a new medicinal material, its dosage must refer to the maximum safe dosage of that medicinal material to ensure that the newly generated prescription is theoretically safe; calculating the pharmacological correlation between the new medicinal material and the original medicinal materials in the initial prescription by querying a medicinal material interaction database or based on a preset pharmacological calculation procedure, and generating quantitative decision parameters that reflect the strength of the synergistic or antagonistic effects that may be produced after the new medicinal material is combined with the original medicinal materials. The pre-defined pharmacological calculation procedure includes: for each newly added medicinal material, querying the medicinal material interaction database to obtain the pharmacological interaction parameters between the newly added medicinal material and all the original medicinal materials in the initial prescription; taking a weighted average of all the pharmacological interaction parameters of the newly added medicinal material with the dosage as the weight, where the higher the dosage of the medicinal material, the higher the contribution weight to the compatibility effect; and then normalizing the result obtained by the weighted average to obtain the decision parameters. The herbal interaction database is a pre-compiled database containing pharmacological interaction parameters containing data on interactions between various herbal medicines. The pharmacological interaction parameters are quantified from pharmacological data as the strength of synergistic effects, the strength of antagonistic effects, the strength of toxicity enhancement effects, or no effect. Among the pharmacological interaction parameters, the strength of synergistic effects is positive, the strength of antagonistic effects and the strength of toxicity enhancement effects are negative, and no effect is 0. Moreover, the absolute value of the strength of toxicity enhancement effects is greater than the absolute value of the strength of antagonistic effects. If the decision parameter is greater than the preset positive threshold, the newly generated similarity test sample is retained; if the decision parameter is less than or equal to the preset positive threshold, at least one original medicinal material is removed from the initial prescription and replaced with other new medicinal materials; the preset positive threshold can be set to 0.5. The process of generating similarity test samples is repeated until the generated decision parameters are greater than the preset positive threshold. Through the scoring process, similarity parameters are calculated for each generated similarity test sample. The scoring process includes: pairing each medicinal material in the sample with other medicinal materials one by one, calculating the pharmacological interaction parameters between each pair of medicinal materials; multiplying each pharmacological interaction parameter by the dosage of the medicinal material pair, and summing all products to form an overall compatibility score; weighting the overall compatibility score with the score of the preset target prescription to obtain similarity parameters. The score of the preset target prescription is a pre-set value representing its basic efficacy or compatibility rationality. The weights corresponding to the overall compatibility score and the score of the preset target prescription can be adjusted according to the actual situation. In this embodiment, they can be 0.6 and 0.4 respectively. The generated similarity parameters are compared with the prescription evaluation parameters to test the effectiveness of the current matching degree model when processing new samples. If there is a significant difference between the similarity parameters and the prescription evaluation parameters, the similarity parameters that need to be compared a second time are identified, and the comparison difference is calculated by subtracting the similarity parameters from the prescription evaluation parameters to evaluate the accuracy of the matching degree model. If the comparison difference is greater than the preset standard threshold, it indicates that the current matching degree model has failed to accurately evaluate the new sample. It is necessary to adjust the matching degree model corresponding to the similar parameters by reducing the weight of this combination of medicinal materials in the matching degree model through adjustment instructions, and repeat the comparison twice until the comparison difference is less than the standard threshold. The preset standard threshold can be set to 20 and can be adjusted according to the actual accuracy requirements.
[0026] S4. Verification and matching degree confirmation: Perform final matching degree evaluation on the specific prescription to be verified; Calculate the verification matching degree of each prescription based on multiple prescriptions to be verified and the currently optimized matching degree evaluation mechanism; The matching degree evaluation mechanism includes the optimized matching degree model and the matching degree evaluation function. When the matching degree evaluation function is used to calculate the current output prescription, the result is the verification matching degree. When the optimized matching degree model is used to calculate, the result is the estimated matching degree. Among them, the matching degree evaluation function is a deep learning model such as a neural network model based on contrastive learning. It is calculated based on fixed objective standards such as the overlap of medicinal ingredients or the similarity of indication texts. The input of the model is the prescription to be verified, and the output is the degree of matching between the prescription and the known prescriptions in the disease-specific prescription knowledge base, which serves as the verification matching degree. Specifically, the matching degree evaluation function can be constructed based on a contrastive learning framework, employing a dual-tower encoder structure. Vector encoding is performed on both the prescription to be verified and the target prescription in the knowledge base to obtain embedding vectors. The encoder input features are composed of two fused parts: Jaccard similarity (as a feature of overlapping medicinal ingredients) and cosine similarity (as a feature of similarity between indications and text). After taking the cosine similarity of the embedding vectors of the prescription to be verified and the target prescription in the knowledge base, the cosine similarity of the embedding vectors, the Jaccard similarity of the overlapping medicinal ingredients, and the cosine similarity of the indications and text are weighted and summed with weights of 0.5, 0.3, and 0.2, respectively. This summation is then input into a Sigmoid function to obtain the verification matching degree. The closer the verification matching degree is to 1, the higher the degree of matching. The matching degree evaluation function can be trained end-to-end on labeled samples using a contrastive learning loss, and can be reproduced using existing deep learning frameworks according to the above structure. The neural network model based on contrastive learning can adopt common neural network models in existing technologies. The obtained verification matching degree is a value between 0 and 1, which represents the similarity or conformity between the prescription to be verified and the target disease prescription in terms of medicinal material composition, compatibility and contraindications, efficacy and indications.
[0027] Determine whether the verification matching degree is within the preset verification tolerance range, which can be set to [0.75, 0.95]. If the verification matching degree is within the preset verification tolerance range, then the verification matching degree is taken as the final verification result. If the verification matching degree exceeds the verification tolerance range, it indicates that the prescription deviates significantly from the basic standard. In this case, the estimated matching degree is taken as the prediction result for further analysis.
[0028] S5. Credibility assessment and parameter output: The verification results are finally confirmed and output. The generated verification results are checked for consistency with the baseline matching degree extracted from the original matching degree test samples. The baseline matching degree can be extracted from a database of known matching degree test samples and their corresponding baseline matching degrees. If the verification result matches the baseline numerically or the difference is less than the preset tolerance threshold, the verification result is determined to be reliable data, and the corresponding current output prescription is identified as a reliable prescription. The preset tolerance threshold can be set to 0.02.
[0029] Based on this reliable data, the verification result is updated to the reliability parameter of the prescription. The reliability parameter is a value between 0 and 1, which represents the reliability of the corresponding prescription. The closer it is to 1, the higher the reliability. The system outputs the reliable prescription, its reliability parameters, risk assessment information, and the calculated overall compatibility score, providing a comprehensive reference for clinical decision-making. The risk assessment information includes textual descriptions of potential adverse drug reactions, contraindications, or allergy risks generated from a pharmacology database. If the verification result does not match the baseline, it indicates that the current output prescription failed the verification in this round of evaluation. It will be moved to the reprocessing queue and used as new input data to participate in the further iterative update of the matching model.
[0030] Example 2 Please see Figure 2 This embodiment provides a cross-modal retrieval system for specific diseases and prescriptions based on contrastive learning. This system can be deployed on computing platforms including personal computers, servers, workstations, or embedded devices, and communicates with data sources such as prescription databases and medical knowledge bases via network interfaces. The system includes the following modules: The matching degree evaluation module is used to obtain the verification matching degree of the prescription based on the prescription to be verified by executing the matching degree evaluation function; when the prescription to be verified is received, the prescription is preprocessed by text segmentation, entity recognition and other processes to convert it into an input format that can be processed by the matching degree model; and the pre-trained matching degree evaluation function is called. The matching degree evaluation function can be a deep learning model such as a neural network model based on contrastive learning. Its input is the prescription to be verified, and its output is the degree of matching between the prescription and the known prescriptions in the disease-specific prescription knowledge base, i.e., the verification matching degree. The verification matching degree is used to represent the similarity or conformity between the prescription to be verified and the target disease-specific prescription in terms of medicinal material composition, compatibility and contraindications, efficacy and indications.
[0031] The credibility assessment module is used to confirm the verification matching degree to form a verification result and to evaluate the credibility of the verification result in order to determine whether the verification result is credible data; it receives the verification matching degree output by the matching degree evaluation module and confirms that the verification matching degree forms a verification result. Determine whether the verification matching degree is within the preset verification tolerance range. If the verification matching degree falls within the preset verification tolerance range, it is considered to form a preliminary verification result. If the verification matching degree exceeds the preset verification tolerance range, it indicates that there is a serious problem with the prescription or the matching degree model output is abnormal. At this time, the verification result may be marked as unreliable. To assess the reliability of the verification results, determine whether the verification results are consistent with the baseline matching degree corresponding to the matching degree test sample. A database containing known matching degree test samples and their corresponding baseline matching degrees is pre-constructed. When the verification results are obtained, a matching degree test sample with similar characteristics to the current prescription to be verified is selected from the database, and the current verification results are compared with the baseline matching degree of the matching degree test sample. If the difference between the verification result and the benchmark matching degree is within the preset error range, the current verification result is determined to be reliable data; otherwise, it is determined to be unreliable data. When the verification result is inconsistent with the baseline matching degree corresponding to the matching degree test sample, the current output prescription corresponding to the prescription to be verified is placed in the reprocessing queue and used as new input data for updating the matching degree model. When the matching degree model shows uncertainty in the verification result of a certain prescription, or does not match the known samples, the prescription is marked as data that needs further learning and optimization to guide subsequent matching degree model iterations and improvements.
[0032] The parameter update module is used to update the credibility parameters of the prescription to be verified based on the structured prescription corresponding to the credible data when the verification result is credible data. When the credibility assessment module determines that the verification result is credible data, it receives the credible data and the structured prescription corresponding to the prescription to be verified; based on the structured prescription, it updates the credibility parameters of the prescription to be verified; wherein, the structured prescription is a standardized, machine-readable prescription representation obtained by processing the prescription text information through entity recognition, relation extraction and other processes, and may specifically include fields such as medicinal material name, dosage, usage, compatibility relationship, etc. The credibility parameters can include the prescription's weight in the knowledge base, the number of times it has been successfully verified, and its similarity score with authoritative prescriptions. The update strategy can use methods such as weighted average and Bayesian update to reflect the reliability level of the prescription in the system. Based on the model feedback value obtained from the evaluation of the matching test samples, the matching degree of the matching test samples is adjusted; when the model feedback value is obtained by comparing the evaluation of the matching test samples with the results of manual annotation, the matching degree label of the matching test samples is fine-tuned according to the model feedback value, so as to provide more accurate supervision signals for further training of the matching model.
[0033] The sample acquisition module is used to acquire prescription text information and extract the corresponding structured prescription to generate matching test samples. It acquires original prescription text information from various sources such as electronic medical records, medical literature, and pharmacopoeia, and uses NLP natural language processing technology to process this prescription text information. The processing content includes, but is not limited to, word segmentation, NER named entity recognition, relation extraction, etc., to convert unstructured prescription text information into structured prescriptions. These structured prescriptions are used to generate matching test samples, which are used to train, validate, and evaluate the matching model. The matching test samples are also scored to obtain scoring results, and prescription evaluation parameters are generated based on the scoring results for evaluating the matching model. The scoring results can be manually annotated by experts or automatically generated by preset rules or auxiliary matching models, reflecting the quality, effectiveness, or safety of the prescription. The matching degree test samples are evaluated based on the prescription evaluation parameters to obtain model feedback values. Specifically, the matching degree predicted by the matching degree model is compared with the prescription evaluation parameters to obtain the performance of the matching degree model on specific samples, thereby generating model feedback values. Based on the model feedback values, the matching degree of the matching degree test samples is adjusted, and the matching degree labels of the matching degree test samples are corrected through the model feedback values, so that the matching degree model can learn from more accurate data.
[0034] The model validation module is used to generate similarity test samples, generate similarity parameters for the similarity test samples based on the scoring model, and compare the similarity parameters with the prescription evaluation parameters to determine the effectiveness of the matching model. An initial prescription is set up. While retaining the arrangement of medicinal materials in the initial prescription, at least one new medicinal material is randomly added, referencing the maximum safe dosage of the new medicinal material, ensuring that the dosage of the new medicinal material does not exceed its maximum safe dosage. The pharmacological correlation between the new medicinal material and the original medicinal materials in the initial prescription is calculated to generate decision parameters. Based on whether the decision parameters are positive or negative, the generated similarity test samples are retained or replaced. The pharmacological correlation can be calculated using data such as the chemical composition, pharmacological effects, and toxic side effects of the medicinal materials. Specifically, if the new medicinal material has a synergistic effect or harmless pharmacological correlation with the original medicinal material, as shown by a positive decision parameter, then the similarity test sample is retained; if there is incompatibility or toxic side effects, as shown by a negative decision parameter, then the similarity test sample is replaced or discarded. Based on the scoring model, similarity parameters are generated for the similarity test samples. Each medicinal material in the similarity test samples is paired with other medicinal materials to form medicinal material pairs. The pharmacological interaction parameters of each medicinal material pair are calculated. Among them, the pharmacological interaction parameters can quantify the synergistic, antagonistic or toxic effects between medicinal material pairs. Each pharmacological interaction parameter is multiplied by the dosage of its corresponding herbal pair and summed to form an overall compatibility score. The overall compatibility score is then combined with the score of the target prescription corresponding to the similarity test sample to obtain the similarity parameter. The similarity parameters are compared with the prescription evaluation parameters to determine the effectiveness of the matching degree model. By comparing the performance of the matching degree model on the similarity test samples reflected by the similarity parameters with the expected prescription evaluation parameters, the accuracy and robustness of the matching degree model in identifying prescription similarity and compatibility are evaluated.
[0035] The output module is used to output the reliable prescription, reliability parameters, and overall compatibility score corresponding to the prescription to be verified when the verification result is determined to be reliable data. Once the verification results are confirmed as reliable data, relevant information will be integrated and output to guide clinical medication, prescription optimization, or knowledge base updates. The output includes: a standardized or optimized credible prescription that has been verified and confirmed as credible; an updated credibility parameter reflecting the reliability level of the prescription; and an overall compatibility score of the prescription calculated by the scoring model to measure the compatibility and safety of the prescription.
[0036] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand and implement the present invention. They should not be construed as limiting the scope of protection of the present invention. All equivalent changes or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A cross-modal retrieval method for specific diseases and prescriptions based on contrastive learning, characterized in that, Includes the following steps: Based on the prescription to be verified, we will prepare to optimize the matching degree model; Execute the matching degree evaluation function to obtain the verification matching degree of the prescription to be verified; Confirm the matching degree to generate the verification result; Evaluate the reliability of the verification results to determine whether the verification results are reliable data; When the verification result is determined to be reliable data, the reliability parameter of the prescription to be verified is updated based on the structured prescription corresponding to the reliable data. When the verification result is determined to be reliable data, the reliable prescription, reliability parameters and overall compatibility score corresponding to the prescription to be verified are output. The step of preparing and optimizing the matching degree model based on the prescription to be verified includes: acquiring the prescription text information and extracting the corresponding structured prescription to generate a matching degree test sample; scoring the matching degree test sample to obtain a scoring result and generating prescription evaluation parameters based on the scoring result; evaluating the matching degree test sample based on the prescription evaluation parameters to obtain a model feedback value; and adjusting the matching degree of the matching degree test sample based on the model feedback value.
2. The cross-modal retrieval method for specific diseases and prescriptions based on contrastive learning according to claim 1, characterized in that, The verification result formed by confirming the matching degree includes: Determine whether the verification matching degree is within the preset verification tolerance range.
3. The cross-modal retrieval method for specific diseases and prescriptions based on contrastive learning according to claim 1, characterized in that, The assessment of the reliability of the verification results, to determine whether the verification results are reliable data, includes: Determine whether the verification result matches the matching degree corresponding to the matching degree test sample; when the verification result does not match the matching degree corresponding to the matching degree test sample, place the current output prescription corresponding to the prescription to be verified in the subsequent model iteration queue and use it as new input data for model update.
4. The cross-modal retrieval method for specific diseases and prescriptions based on contrastive learning according to claim 1, characterized in that, The preparation of the matching degree model based on the prescription to be verified also includes: Generate similarity test samples; generate similarity parameters for the similarity test samples based on the scoring model; compare the similarity parameters with the prescription evaluation parameters to determine the effectiveness of the matching model.
5. A cross-modal retrieval method for specific diseases and prescriptions based on contrastive learning according to claim 4, characterized in that, The generated similarity test samples include: Set an initial prescription; while retaining the arrangement of medicinal materials in the initial prescription, randomly add at least one new medicinal material with reference to the maximum safe dosage of the new medicinal material; calculate the pharmacological correlation between the new medicinal material and the original medicinal materials in the initial prescription to generate decision parameters; retain or replace the generated similarity test samples according to whether the decision parameters are positive or negative.
6. The cross-modal retrieval method for specific diseases and prescriptions based on contrastive learning according to claim 4, characterized in that, The generation of similarity parameters for similarity test samples based on the scoring model includes: Each medicinal material in the similarity test sample is paired with other medicinal materials to form a medicinal material pair; the pharmacological interaction parameters of each medicinal material pair are calculated; each pharmacological interaction parameter is multiplied by the dosage of its corresponding medicinal material pair and the results are summed to form an overall compatibility score; the overall compatibility score is summed with the score of the initial prescription corresponding to the similarity test sample to obtain the similarity parameter.
7. A cross-modal retrieval system for specific diseases and prescriptions based on contrastive learning, characterized in that, Includes the following modules: The sample acquisition module is used to acquire prescription text information and extract the corresponding structured prescription to generate matching test samples; The matching degree evaluation module is used to execute the matching degree evaluation function to obtain the verification matching degree of the prescription to be verified; The credibility assessment module is used to confirm the verification matching degree to form the verification result, evaluate the credibility of the verification result, and determine whether the verification result is credible data. The parameter update module is used to update the credibility parameters of the prescription to be verified based on the structured prescription corresponding to the credible data when the verification result is determined to be credible data.
8. A cross-modal retrieval system for specific diseases and prescriptions based on contrastive learning according to claim 7, characterized in that, It also includes a model validation module; The model validation module is used to generate similarity test samples, generate similarity parameters for the similarity test samples based on the scoring model, and compare the similarity parameters with the prescription evaluation parameters to determine the effectiveness of the matching model.
9. A cross-modal retrieval system for specific diseases and prescriptions based on contrastive learning according to claim 8, characterized in that, The generated similarity test samples include: Set an initial prescription; while retaining the arrangement of medicinal materials in the initial prescription, randomly add at least one new medicinal material with reference to the maximum safe dosage of the new medicinal material; calculate the pharmacological correlation between the new medicinal material and the original medicinal materials in the initial prescription to generate decision parameters; retain or replace the generated similarity test samples according to whether the decision parameters are positive or negative.
10. A cross-modal retrieval system for specific diseases and prescriptions based on contrastive learning according to claim 8, characterized in that, The generation of similarity parameters for similarity test samples based on the scoring model includes: Each medicinal material in the similarity test sample is paired with other medicinal materials to form a medicinal material pair; the pharmacological interaction parameters of each medicinal material pair are calculated; each pharmacological interaction parameter is multiplied by the dosage of its corresponding medicinal material pair and the results are summed to form an overall compatibility score; the overall compatibility score is summed with the score of the initial prescription corresponding to the similarity test sample to obtain the similarity parameter.