首页|基于规则生成医案及Transformer算法构建中医方药推荐模型

基于规则生成医案及Transformer算法构建中医方药推荐模型

扫码查看
目的 使用计算机构建《伤寒论》相关方剂的中医方药推荐模型,测试该模型对《伤寒论》方证知识的运用能力.方法 本研究纳入《伤寒论》中桂枝类方、麻黄类方、柴胡类方、大黄类方、石膏类方、附子类方、苓桂类方共30 首方剂及其加减方,将其改写成特定的方证规则共 105 条作为本模型的实验数据.本模型分为规则生成医案模型及Transformer模型两部分.规则生成医案模型对特定格式的方证规则分别进行组合、笛卡尔积、拼接,生成多个具有完整证、舌、脉、药且符合中医理法方药特点的中医医案.然后基于编码器-解码器架构的深度学习模型Transformer将生成的中医医案用作训练数据,继而模拟方证到方药之间的非线性复杂映射.结果 经规则生成医案模型生成不重复的医案共 1 212 795 例,随机选择5 000 例作为测试集,其余医案作为训练集或验证集.在有5 000 例医案的测试集中,预测方药与目标方药完全相同的医案有4 983 例,按预测方药与目标方药重合个数的比率计算总准确率为 99.90%.结论 本模型可正确运用《伤寒论》的方证知识,模拟预设的方证规则,具备方证识别及病机区分的能力,在构建中医方药推荐系统方面具有发展潜力.
Traditional Chinese Medicine Prescription Recommendation Model Construction Based on Rule Generating Medical Cases and Transformer Algorithm
Objective To build a prescription recommendation model of traditional Chinese medicine(TCM)about prescriptions in Shang Han Lun.To test the ability of this model to apply knowledge of indications of prescriptions in Shang Han Lun.Methods This research adapted rules of 30 TCM prescriptions for model use including Guizhi-related prescriptions,Mahuang-related prescriptions,Chaihu-related prescriptions,Dahuang-related prescriptions,Shigao-related prescriptions,Fuzi-related prescriptions,Fuling-related prescriptions and their adjusted prescriptions from Cold Damage and Miscellaneous Diseases.As many as 105 rules were added to the model.The model consists of two parts which are the rule-based case data generator(RCDG)model and the transformer model.The RCDG model yields multiple TCM cases including symptoms,tongue appearance,pulse appearance,and medicines by executing combination,Cartesian product,and montage respectively on TCM rules.All of the generated cases are in accord with the theory of TCM.After that,generated data is passed to a deep learning model Transformer that is based on the encoder-decoder structure to simulate the complex nonlinear mapping from syndromes to corresponding medicines.Results A total of 1,212,795 non-duplicate cases were generated by the RCDG model.5,000 cases were randomly selected as the test set,and the rest were used as the training set or validation set.In the test set,there were 4,983 out of 5,000 cases in which the predicted prescription was the same as the target prescription.The coincidence rate between the predicted prescriptions and the target prescriptions was 99.90%.Conclusion The model can correctly apply the knowledge and simulate preset rules of indications of prescriptions in Shang Han Lun,and can differentiate different syndromes and pathogeneses,which indicates its great development potential in constructing a TCM prescription recommendation system.

Syndrome differentiation and treatmentCorrespondence of prescription and syndromeTraditional Chinese medicineArtificial intelligenceDeep learningTransformerAttention mechanism

练志润、张家蔚、杨保林

展开 >

广东省中西医结合医院,广东佛山 528200

北京中医药大学东直门医院,北京 100007

辨证论治 方证相应 中医药 人工智能 深度学习 Transformer 注意力机制

国家重点基础研究计划(973计划)项目

2015CB554406

2024

中国中医基础医学杂志
中国中医研究院基础理论研究所

中国中医基础医学杂志

CSTPCD
影响因子:0.779
ISSN:1006-3250
年,卷(期):2024.30(3)
  • 18