The invention discloses a
knowledge base generation method and device and a visual
language model training method and device, and belongs to the technical field of
medical knowledge processing. The method comprises the steps of obtaining a clinical text and extracting a medical entity; constructing a
knowledge graph according to the medical entities and the relationship between the entities; obtaining an
inference path between entities based on the
knowledge graph, wherein the
inference path comprises mapping the medical entities to
knowledge graph nodes and obtaining an association path; generating thinking chain data according to the reasoning path; and generating a
knowledge base according to the knowledge graph, the reasoning path and the thinking chain data. In the entity mapping process, candidate matching nodes are obtained by calculating the similarity, and final matching nodes are obtained by adopting a multi-stage matching strategy. The invention further provides a visual
language model training method using the generated
knowledge base, a visual language network is trained through a multi-stage
fine tuning strategy, and a diagnosis report containing a clinical reasoning process is output. The knowledge base constructed by the method can effectively support
medical diagnosis reasoning, and the accuracy and
interpretability of clinical decisions are improved.