The invention provides a method for training an
aptamer generation model and a method for generating an
aptamer, and the method comprises the steps: inputting the sequence features and structural features of a training
protein nucleic acid pair into an initial generation model, and generating a training prediction
nucleic acid based on the initial generation model; calculating
generation loss based on the training predicted
nucleic acid, and performing parameter correction on the initial generation model based on the
generation loss to obtain a to-be-optimized generation model; and carrying out adversarial training on the basis of the to-be-optimized generation model, the
test protein nucleic acid pair and the combined nucleic acid discrimination model, and optimizing to obtain the nucleic acid
aptamer generation model. According to the method provided by the invention, the generative adversarial training is carried out on the to-be-optimized generation model through the nucleic acid discrimination model to optimize the
model parameters of the to-be-optimized generation model so as to obtain the final nucleic acid aptamer generation model, so that the ability of the nucleic acid aptamer generation model to generate the nucleic acid aptamer interacting with
protein is ensured; and the generation of the nucleic acid aptamer with higher efficiency, higher accuracy and higher affinity is realized.