The present application relates to a
biliary tract cancer prediction method and
system based on iterative self-consistency and
large model verification, relating to the field of
artificial intelligence, comprising obtaining
electronic medical record text data of a patient to be predicted; the present application inputs a prompt word sequence into a current base large
language model to generate an independent reasoning path set, adopts a majority voting mechanism to select positive samples and negative samples, constructs candidate data pairs, introduces a
verification large
language model to verify the medical logic rationality of the positive samples, guarantees the
diagnosis quality through a double mechanism, improves the accuracy and reliability of the diagnosis reasoning, supervises and fine-tunes the current base large
language model, optimizes a comparison
loss function to obtain an updated base large language model, realizes continuous iterative optimization of the diagnosis logic, inputs the structured prompt word sequence of a new patient to be diagnosed into the final base large language model, generates an optimal reasoning path and a diagnosis conclusion, and outputs a thought chain reasoning result containing medical logic.