Method, device, computer equipment and storage medium for predicting molecular structure

By combining the first probability distribution and the target path set of pre-trained target molecular generation model, an optimized second probability distribution is generated, and the molecular structure prediction preference problem in the prior art due to the difference in data characteristic distribution is solved, and the accuracy and quality of molecular structure prediction are improved.

CN118782181BActive Publication Date: 2025-05-02BEIJING STONEWISE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411092432.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2025-05-02
Estimated Expiration
2044-08-09

AI Technical Summary

Technical Problem

The existing models used to predict molecular structures encounter differences in the data feature distribution and training data set during the inference stage, resulting in preference for token prediction and reducing the accuracy of molecular structure prediction.

Method used

The pre-trained target molecule generation model is used, combining the first probability distribution of the model and the target path set, and the optimized second probability distribution is generated by calculating the score and path diversity parameters of the candidate token, thereby determining the token that predicts the molecular structure.

Benefits of technology

By optimizing the probability distribution, the preference problems caused by the model due to the distribution problems of the training data are reduced, and the quality and accuracy of the generated molecular structure are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118782181B_ABST
    Figure CN118782181B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of computer technology, and discloses a method, an apparatus, a computer device and a storage medium for predicting a molecular structure. The method comprises: using a target molecule generation model, predicting a first probability distribution of an i-th token according to an input of the target molecule generation model and the first to i-th tokens of the predicted molecular structure; determining a path set corresponding to each candidate token according to the first to i-th tokens of the predicted molecular structure and a target path set; calculating a score of the candidate token according to the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than a corresponding molecular mass score threshold and the number of paths in the path set corresponding to the candidate token; obtaining a second probability distribution of the i-th token according to the score of each candidate token and the first probability distribution of the i-th token; and determining the i-th token of the predicted molecular structure according to the second probability distribution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, apparatus, computer equipment and storage medium for predicting molecular structure. Background Art

[0002] Models for predicting molecular structures, such as those based on transformer models, are widely used in new drug development, such as small molecule new drug development. The main goal of molecular generation is to generate a variety of high-quality molecular structures based on the input specific target pockets.

[0003] At present, the output of the model used to predict the molecular structure is taken as the final result. The accuracy of the prediction result depends entirely on the accuracy of the model. However, the learning of the model is basically dependent on the distribution of the training data. If the feature distribution of the inference data required in the inference stage is far from the training data set, there will be a situation where the prediction of the token at a certain position has an obvious preference and this preference is not beneficial, resulting in a decrease in the accuracy of the predicted molecular structure. How to improve the accuracy of the predicted molecular structure has become a problem that needs to be solved. Summary of the invention

[0004] In view of this, the embodiments of the present disclosure provide a method, apparatus, computer device and storage medium for predicting molecular structure.

[0005] In a first aspect, the present disclosure provides a method for predicting molecular structure, the method comprising:

[0006] Using the pre-trained target molecule generation model, according to the input of the target molecule generation model and the target pathway set, a predicted molecular structure corresponding to the input is obtained, including:

[0007] During prediction of the i-th token of the predicted molecular structure, using a target molecule generation model, based on the input and the 1st to i-1th tokens of the predicted molecular structure, predict a first probability distribution of the i-th token, wherein i is any one from 2 to the number of tokens of the predicted molecular structure, and the first probability distribution indicates a first probability of each candidate token of all candidate tokens of the i-th token being the i-th token;

[0008] According to the 1st token to the i-1th token of the predicted molecular structure and the target path set, determine the path set corresponding to each candidate token, wherein when the path set corresponding to the candidate token is not an empty set, the path set corresponding to the candidate token is found from the target path set and the i-th token of each path in the path set corresponding to the candidate token is the candidate token and the j-th token of each path in the path set corresponding to the candidate token is the same as the j-th token from the 1st token to the i-1th token of the predicted molecular structure, and j is any one from 1 to i-1;

[0009] For each candidate token, the score of the candidate token is calculated according to the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the corresponding molecular mass score threshold and the number of paths in the path set corresponding to the candidate token;

[0010] Obtaining a second probability distribution of the i-th token according to the score of each candidate token and the first probability distribution of the i-th token;

[0011] According to the second probability distribution, the i-th token of the predicted molecular structure is determined from all candidate tokens of the i-th token.

[0012] In a second aspect, an embodiment of the present disclosure provides a device for predicting molecular structure, the device comprising:

[0013] A molecular structure prediction unit, used to use a pre-trained target molecule generation model, according to the input of the target molecule generation model and the target path set, to obtain a predicted molecular structure corresponding to the input, wherein the molecular structure prediction unit includes: a token prediction subunit, used to use the target molecule generation model during the prediction of the i-th token of the predicted molecular structure, according to the input, the 1st token to the i-1th token of the predicted molecular structure, to predict a first probability distribution of the i-th token, wherein i is any one from 2 to the number of tokens of the predicted molecular structure, and the first probability distribution indicates that each candidate token among all candidate tokens of the i-th token is is the first probability of the i-th token; according to the 1st token to the i-1th token of the predicted molecular structure and the target path set, determine the path set corresponding to each candidate token, wherein, when the path set corresponding to the candidate token is not an empty set, the path set corresponding to the candidate token is found from the target path set and the i-th token of each path in the path set corresponding to the candidate token is the candidate token and the j-th token of each path in the path set corresponding to the candidate token is the same as the j-th token from the 1st token to the i-1th token of the predicted molecular structure, and j is any one from 1 to i-1;

[0014] For each candidate token, the score of the candidate token is calculated according to the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the corresponding molecular mass score threshold and the number of paths in the path set corresponding to the candidate token; the second probability distribution of the i-th token is obtained according to the score of each candidate token and the first probability distribution of the i-th token; and the i-th token of the predicted molecular structure is determined from all candidate tokens of the i-th token according to the second probability distribution.

[0015] In a third aspect, an embodiment of the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0016] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding implementation manner thereof.

[0017] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method of the first aspect or any corresponding embodiment thereof.

[0018] The method for predicting molecular structure provided by the disclosed embodiment combines the model experience, i.e., the first probability distribution predicted by the target molecule generation model, and the existing results, i.e., the target path set including the paths that have been generated by the target molecule generation model, to generate an optimized probability distribution, i.e., the second probability distribution, and uses the second probability distribution to predict the token of the predicted molecular structure corresponding to the input of the target molecule generation model. Thus, in the process of using the model to generate molecular structure, the problem of the preference of non-positive returns caused by the distribution problem of training data can be avoided to a certain extent, and a higher quality molecular structure can be generated. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 is a schematic flow chart of a method for predicting molecular structure provided by an embodiment of the present disclosure;

[0021] Figure 2 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0023] refer to Figure 1 , which shows a schematic flow chart of a method for predicting molecular structure provided by an embodiment of the present disclosure, and the method can be executed by an electronic device. The method includes step S101.

[0024] In step S101, a pre-trained target molecule generation model is used to obtain a predicted molecular structure corresponding to the input according to the input of the target molecule generation model and a target pathway set.

[0025] The pre-training may mean that the pre-training of the target molecule generation model is completed before the first execution of step S101.

[0026] In addition, the target molecule generation model may also be pre-trained and fine-tuned. Fine-tuned may mean that fine-tuning of the target molecule generation model is completed before the first execution of step S101.

[0027] In the disclosed embodiment, the target molecule generation model may be any molecule generation model that predicts the tokens of the molecular structure in sequence according to the input of the model.

[0028] In the disclosed embodiments, the molecular structure predicted by the target molecule generation model may be called a predicted molecular structure.

[0029] As an example, the target molecule generation model may be the Lingo3DMol model. For a detailed introduction to the Lingo3DMol model, refer to Feng W, Wang L, Lin Z, et al. Generation of 3D molecules in pockets via a language model [J]. Nature Machine Intelligence, 2024: 1-12. For a predicted molecular structure predicted by the target molecule generation model, a token of the predicted molecular structure may represent a feature of a fragment of the predicted molecular structure.

[0030] For a molecular structure, the molecular structure may be represented by a path of the molecular structure. Predicting a predicted molecular structure may refer to: predicting a path representing the predicted molecular structure.

[0031] For a molecular structure, the path of the molecular structure includes: all tokens of the molecular structure in order, and the path of the molecular structure may be: a sequence including all tokens of the molecular structure.

[0032] As an example, for a molecular structure, the path of the molecular structure is a sequence including 100 tokens of the molecular structure.

[0033] For an input of the target molecule generation model, the target molecule generation model receives the input of the target molecule generation model, and the target molecule generation model outputs a predicted molecular structure corresponding to the input of the target molecule generation model.

[0034] As an example, the input of the target molecule generation model includes: a pocket.

[0035] During the period when the target molecule generation model predicts the predicted molecular structure corresponding to the input of the target molecule generation model, the target molecule generation model predicts each token of the predicted molecular structure corresponding to the input of the target molecule generation model in sequence, and obtains the path representing the corresponding predicted molecular structure corresponding to the input, thereby predicting the predicted molecular structure corresponding to the input.

[0036] For example, the predicted molecular structure corresponding to the input of the target molecule generation model has n tokens, and the path of the predicted molecular structure corresponding to the input of the target molecule generation model includes: n tokens of the predicted molecular structure corresponding to the input of the target molecule generation model in sequence. The n tokens of the predicted molecular structure corresponding to the input of the target molecule generation model in sequence constitute a path representing the predicted molecular structure corresponding to the input. The target molecule generation model first predicts the first token of the predicted molecular structure corresponding to the input of the target molecule generation model. After the target molecule generation model predicts the first token of the predicted molecular structure corresponding to the input of the target molecule generation model, the target molecule generation model predicts the second token of the predicted molecular structure corresponding to the input of the target molecule generation model. After the target molecule generation model first predicts the n-1th token of the predicted molecular structure corresponding to the input of the target molecule generation model, the target molecule generation model predicts the nth token of the predicted molecular structure corresponding to the input of the target molecule generation model.

[0037] In the disclosed embodiment, the target pathway set includes: before the first execution of step S101, the pathways predicted by the pre-trained target molecule generation model, each pathway in the target pathway set belongs to a different predicted molecular structure.

[0038] The predicted molecular structures to which each pathway in the target pathway set belongs have molecular mass scores indicating the high or low quality of the molecular structures.

[0039] In the disclosed embodiment, for a pathway, the molecular mass score corresponding to the pathway is the molecular mass score of the predicted molecular structure to which the pathway belongs.

[0040] As an example, the molecular mass score of the predicted molecular structure may be a score of the non-hydrogen bonding interaction (NCI) between the predicted molecular structure and the pocket.

[0041] In the embodiment of the present disclosure, the target path set may be called a pathbook.

[0042] It should be noted that the paths included in the target path set can be updated. The target path set can be equivalent to a variable.

[0043] Each time a predicted molecular structure is predicted in step S101 , a path representing the predicted molecular structure is predicted, and the path representing the predicted molecular structure can be added to the target path set.

[0044] As an example, after completing the pre-training of the target molecule generation model and before executing step S101 for the first time, the target molecule generation model can be used to perform N predictions to predict N paths, thereby predicting N molecular structures, i.e., the predicted molecular structures to which each path in the N paths belongs. For example, the target molecule generation model can be used to perform 1 million predictions to predict 1 million paths, thereby predicting 1 million predicted molecular structures. The N molecular structures can be scored according to the pre-set molecular mass scoring criteria to obtain the molecular mass scores of the N molecular structures. Thus, the molecular mass scores corresponding to each path in the N paths are obtained.

[0045] In an optional implementation, step S100 is performed before step S101 is performed for the first time.

[0046] It should be noted that, before executing step S100, pre-training of the target molecule generation model has been completed.

[0047] Step S100 includes: step S1001-step S1004.

[0048] In step S1001, a target molecule generation model is used to predict a plurality of preliminary prediction pathways, wherein each preliminary prediction pathway belongs to a different predicted molecular structure.

[0049] Among them, each preliminary predicted pathway belongs to a different predicted molecular structure.

[0050] In step S1001, a target molecule generation model is used to perform multiple initial predictions to predict multiple preliminary prediction pathways.

[0051] Each time the target molecule generation model is used for prediction, the target molecule generation model receives corresponding inputs such as pockets and predicts a corresponding preliminary prediction path.

[0052] As an example, the number of initial predictions is 100,000.

[0053] In step S1002, a target path set including the plurality of preliminary predicted paths is generated.

[0054] It should be noted that, during the execution of step S100, steps S1003 and S1004 may be repeatedly executed until the number of executions of the stage prediction reaches the stage prediction number threshold.

[0055] In step S1003, a target molecule generation model is used to perform stage prediction to obtain a prediction pathway set of the stage prediction. The stage prediction includes multiple predictions. The prediction pathway set of the stage prediction includes: a prediction pathway corresponding to each prediction of the stage prediction.

[0056] Among them, the stage prediction can be called batch.

[0057] In one prediction of this stage, the target molecule generation model receives the corresponding input and predicts the prediction path corresponding to each prediction.

[0058] In step S1004, a path adding operation corresponding to the prediction of this stage is performed.

[0059] The path adding operation corresponding to the prediction at this stage includes: step S10041, for each predicted path in the predicted path set predicted at this stage, when the subpath composed of the 1st token to the mth token in the predicted path does not appear in the target path set, the target molecule generation model is used to perform multiple extended path predictions related to the predicted path, and the extended path predictions related to the predicted path include: taking the 1st token to the mth token of the predicted path as the 1st token to the mth token of the corresponding extended path, and using the target molecule generation model to start prediction from the m+1th token position, predicting the m+1th token to the number of tokens included in the predicted path of the corresponding extended path, and adding the corresponding extended path to the target path set, wherein m is any one from 2 to the number of tokens included in the predicted path - 1; step S10042, adding the predicted path set predicted at this stage to the target path set.

[0060] For example, in step S10041, for predicted path i in the predicted path set predicted in this stage, when the subpath composed of the 1st token to the mth token in the predicted path i does not appear in the target path set, the target molecule generation model is used to perform multiple extended path predictions related to the predicted path i. The extended path predictions related to the predicted path i include: taking the 1st token to the mth token of the predicted path as the 1st token to the mth token of the corresponding extended path, and using the target molecule generation model to start prediction from the m+1th token position, predicting the number of tokens from the m+1th token to the mth token included in the predicted path, and adding the corresponding extended path to the target path set.

[0061] In the embodiment of the present disclosure, for a predicted path in the predicted path set predicted at this stage, when the subpath consisting of the 1st token to the mth token in the predicted path does not appear in the target path set, it means that a new subpath has appeared, and the prediction is continued on the basis of the new subpath, that is, the prediction is started from the m+1th token position using the target molecule generation model.

[0062] In the disclosed embodiment, it is considered that if the target molecule generation model is completely randomly sampled, due to the preference problem of the model, most of the paths in the target path set will be paths with high probability based on the experience of the target molecule generation model, resulting in the problem of uneven distribution of paths. The new sub-path is a sub-path with low probability, and the corresponding expanded path is a path with low probability. The corresponding expanded path is added to the target path set, so that the distribution of the probability of the path in the target path set is more balanced. Improve the accuracy of the target molecule generation model in predicting using the target path set.

[0063] In an optional embodiment, for a predicted pathway in the predicted pathway set predicted at this stage, the number of expanded pathway predictions related to the predicted pathway performed using the target molecule generation model is the number of predictions included in the prediction at this stage.

[0064] In the embodiment of the present disclosure, step S101 includes: step S1011-step S1015.

[0065] In step S1011, during the i-th token of the predicted molecular structure corresponding to the input of the prediction target molecule generation model, the target molecule generation model is used to predict the first probability distribution of the i-th token of the predicted molecular structure corresponding to the input based on the input and the 1st token to the i-1th token of the predicted molecular structure corresponding to the input.

[0066] Wherein, i is any one from 2 to the number of tokens of the predicted molecular structure corresponding to the input of the target molecule generation model.

[0067] The first probability distribution of the i-th token of the predicted molecular structure corresponding to the input of the target molecule generation model indicates: the first probability of each candidate token among all candidate tokens of the i-th token of the predicted molecular structure corresponding to the input being the i-th token of the predicted molecular structure corresponding to the input.

[0068] As an example, the number of candidate tokens for the i-th token of the predicted molecular structure corresponding to the input is 256.

[0069] The candidate token of the i-th token of the predicted molecular structure corresponding to the input of the target molecule generation model is: the token that may be the i-th token of the predicted molecular structure corresponding to the input.

[0070] The sum of the first probabilities of each candidate token of the i-th token of the predicted molecular structure corresponding to the input of the target molecule generation model as the i-th token of the predicted molecular structure corresponding to the input is 1.

[0071] In step S1012, during the i-th token of the predicted molecular structure corresponding to the input of the predicted target molecule generation model, the path set corresponding to each candidate token of the i-th token of the predicted molecular structure corresponding to the input is determined according to the 1st token to the i-1th token and the target path set of the predicted molecular structure corresponding to the input.

[0072] It should be noted that, for a candidate token of the i-th token of the predicted molecular structure corresponding to the input, the path set corresponding to the candidate token may be an empty set.

[0073] Among them, for a candidate token of the i-th token of the predicted molecular structure corresponding to the input of the target molecule generation model, when the path set corresponding to the candidate token is not an empty set, the path set corresponding to the candidate token is found from the target path set and the i-th token of each path in the path set corresponding to the candidate token is the candidate token and the j-th token of each path in the path set corresponding to the candidate token is the same as the j-th token from the 1st token to the i-1th token of the predicted molecular structure, and j is any one from 1 to i-1.

[0074] For example, i is 10, for a candidate token of the i-th token of the predicted molecular structure corresponding to the input of the target molecule generation model, the path set corresponding to the candidate token is found from the target path set, the 10th token of each path in the path set corresponding to the candidate token is the candidate token, the 1st token of each path in the path set corresponding to the candidate token is the same as the 1 token of the predicted molecular structure corresponding to the input, the 2nd token of each path in the path set corresponding to the candidate token is the same as the 2 tokens of the predicted molecular structure corresponding to the input, and so on.

[0075] In step S1013, during the i-th token period of the predicted molecular structure corresponding to the input of the prediction target molecule generation model, for each candidate token of the i-th token of the predicted molecular structure corresponding to the input of the target molecule generation model, the score of the candidate token is calculated according to the number of paths whose corresponding molecular mass scores in the path set corresponding to the candidate token are greater than the corresponding molecular mass score threshold and the number of paths in the path set corresponding to the candidate token.

[0076] As an example, a molecular mass score threshold can be pre-set. For a candidate token,

[0077] If the path set corresponding to the candidate token is an empty set, the score of the candidate token is 0. If the path set corresponding to the candidate token is not an empty set, the score of the candidate token is obtained by dividing the number of paths in the path set corresponding to the candidate token by the number of paths whose molecular mass scores are greater than the molecular mass score threshold in the path set corresponding to the candidate token.

[0078] In an optional implementation, step S10131.

[0079] In step S10131, for a candidate token of the i-th token of the predicted molecular structure corresponding to the input of the target molecule generation model, the score of the candidate token is calculated according to the number of paths whose corresponding molecular mass scores in the path set corresponding to the candidate token are greater than the medium-level molecular mass score threshold, and the number of paths whose corresponding molecular mass scores in the path set corresponding to the candidate token are greater than the high-level molecular mass score threshold, wherein the high-level molecular mass score threshold is greater than the medium-level molecular mass score threshold.

[0080] As an example, for a candidate token of the i-th token of the predicted molecular structure corresponding to the input of the target molecule generation model, if the path set corresponding to the candidate token is an empty set, the score of the candidate token is 0. If the path set corresponding to the candidate token is not an empty set, the number of paths in the path set corresponding to the candidate token whose molecular mass scores are greater than the medium-level molecular mass score threshold can be divided by the number of paths in the path set corresponding to the candidate token to obtain the first sub-score of the candidate token. If the path set corresponding to the candidate token is not an empty set, the number of paths in the path set corresponding to the candidate token whose molecular mass scores are greater than the high-level molecular mass score threshold can be divided by the number of paths in the path set corresponding to the candidate token to obtain the second sub-score of the candidate token. The first sub-score of the candidate token can be added to the second sub-score of the candidate token to obtain the score of the candidate token. The weighted sum of the first sub-score of the candidate token and the second sub-score of the candidate token can also be determined as the score of the candidate token. As an example, the weight of the first sub-score is 0.5, and the weight of the second sub-score is 1.5.

[0081] In an optional embodiment, step S10131 includes: for a candidate token of the i-th token of the predicted molecular structure corresponding to the input of the target molecule generation model, according to the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the medium-level molecular mass score threshold, the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the high-level molecular mass score threshold, and the path diversity parameter of the candidate token, calculating the score of the candidate token, wherein the path diversity parameter of the candidate token is determined according to the ratio of the number of paths included in the path set corresponding to the candidate token to the total number of paths included in the path set corresponding to all candidate tokens of the i-th token.

[0082] As an example, for a candidate token of the i-th token of the predicted molecular structure corresponding to the input of the target molecule generation model, the path diversity parameter of the candidate token can be: 1-the ratio corresponding to the candidate token, and the ratio corresponding to the candidate token is: the number of paths included in the path set corresponding to the candidate token and the total number of paths included in the path set corresponding to all candidate tokens of the i-th token.

[0083] The total number of paths included in the path set corresponding to all candidate tokens of the i-th token is: the sum of the number of paths included in the path set corresponding to each candidate token of the i-th token.

[0084] The fewer the number of paths included in the path set corresponding to the candidate token, the fewer the number of paths of the type to which the path set corresponding to the candidate token belongs, and the larger the path diversity parameter of the candidate token, the more favorable it is for the candidate token to be used as the i-th token. The number of paths of the type to which the path set corresponding to the candidate token belongs can be increased, the richness of the generated paths can be improved, and the generated paths can be avoided from being concentrated on paths with high probability based on the experience of the target molecule generation model.

[0085] As an example, in step S10131, for a candidate token of the i-th token of the predicted molecular structure corresponding to the input of the target molecule generation model, if the path set corresponding to the candidate token is an empty set, the score of the candidate token is 0. If the path set corresponding to the candidate token is not an empty set, the number of paths in the path set corresponding to the candidate token whose molecular mass scores are greater than the medium-level molecular mass score threshold can be divided by the number of paths in the path set corresponding to the candidate token to obtain the first sub-score of the candidate token. The number of paths in the path set corresponding to the candidate token whose molecular mass scores are greater than the high-level molecular mass score threshold can be divided by the number of paths in the path set corresponding to the candidate token to obtain the second sub-score of the candidate token. The sum of the first sub-score of the candidate token and the second sub-score of the candidate token can be multiplied by the path diversity parameter of the candidate token to obtain the score of the candidate token. The weighted sum of the first sub-score of the candidate token and the second sub-score of the candidate token can also be multiplied by the path diversity parameter of the candidate token to obtain the score of the candidate token.

[0086] In an optional embodiment, for a candidate token of the i-th token of the predicted molecular structure corresponding to the input of the target molecule generation model, according to the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the medium-level molecular mass score threshold, the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the high-level molecular mass score threshold, and the path diversity parameter of the candidate token, calculating the score of the candidate token includes: calculating the score of the candidate token according to the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the medium-level molecular mass score threshold, the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the high-level molecular mass score threshold, the path diversity parameter of the candidate token, and the number of additional paths corresponding to the candidate token.

[0087] Among them, when the first probability of the candidate token as the i-th token is greater than the probability threshold, the number of additional paths corresponding to the candidate token is 1; when the first probability of the candidate token as the i-th token is not greater than the probability threshold, the number of additional paths corresponding to the candidate token is 0.

[0088] As an example, for a candidate token of the i-th token of the predicted molecular structure corresponding to the input of the target molecule generation model, if the path set corresponding to the candidate token is an empty set, the score of the candidate token is 0. If the path set corresponding to the candidate token is not an empty set and the first probability of the candidate token as the i-th token is greater than the probability threshold, the first sub-score of the candidate token can be obtained by adding the number of paths in the path set corresponding to the candidate token whose molecular mass scores are greater than the medium-level molecular mass score threshold and 1 to the number of paths in the path set corresponding to the candidate token. If the path set corresponding to the candidate token is not an empty set and the first probability of the candidate token as the i-th token is not greater than the probability threshold, the first sub-score of the candidate token can be obtained by dividing the number of paths in the path set corresponding to the candidate token whose molecular mass scores are greater than the medium-level molecular mass score threshold by the number of paths in the path set corresponding to the candidate token.

[0089] This example continues. If the path set corresponding to the candidate token is not an empty set and the first probability of the candidate token as the i-th token is greater than the probability threshold, the second sub-score of the candidate token can be obtained by adding the number of paths in the path set corresponding to the candidate token whose molecular mass scores are greater than the high-level molecular mass score threshold and 1 and dividing the number of paths in the path set corresponding to the candidate token. If the path set corresponding to the candidate token is not an empty set and the first probability of the candidate token as the i-th token is not greater than the probability threshold, the second sub-score of the candidate token can be obtained by dividing the number of paths in the path set corresponding to the candidate token whose molecular mass scores are greater than the high-level molecular mass score threshold. The sum of the first sub-score of the candidate token and the second sub-score of the candidate token can be multiplied by the path diversity parameter of the candidate token to obtain the score of the candidate token. The weighted sum of the first sub-score of the candidate token and the second sub-score of the candidate token can also be multiplied by the path diversity parameter of the candidate token to obtain the score of the candidate token.

[0090] In the disclosed embodiment, if the first probability of a candidate token of the ith token being the ith token is greater than the probability threshold, the number of additional paths corresponding to the candidate token also participates in the calculation of the score of the candidate token, thereby improving the score of the candidate token and facilitating the candidate token to be used as the ith token. The problem of a certain type of path being never triggered due to too low a score in the experience of the model, thus falling into a local optimum, is considered. It is possible that a candidate token with a small number of paths included in the corresponding path set may also be used as the ith token, thereby increasing the number of paths included in the path set corresponding to the candidate token with a small number of paths included in the corresponding path set. The richness of the generated paths is improved to avoid the generated paths being concentrated on paths with high probabilities based on the experience of the target molecule generation model.

[0091] In step S1014, during the prediction of the i-th token of the predicted molecular structure corresponding to the input of the target molecule generation model, the second probability distribution of the i-th token is obtained according to the score of each candidate token of the i-th token of the predicted molecular structure corresponding to the input and the first probability distribution of the i-th token.

[0092] The second probability distribution of the i-th token indicates: the second probability of each candidate token among all candidate tokens of the i-th token being the i-th token.

[0093] The sum of the second probabilities of each candidate token of all candidate tokens of the i-th token being the i-th token is 1.

[0094] In step S1014, for each candidate token of the i-th token of the predicted molecular structure corresponding to the input, the score of the candidate token and the first probability that the candidate token is the i-th token may be added to obtain the addition result of the candidate token. The addition result of each candidate token of the i-th token is normalized to obtain the normalized addition result of each candidate token of the i-th token.

[0095] In step S1014, for each candidate token of the i-th token of the predicted molecular structure corresponding to the input, the normalized addition result of the candidate token may be used as the second probability that the candidate token is the i-th token.

[0096] In step S1015, according to the second probability distribution, the i-th token of the predicted molecular structure corresponding to the input is determined from all candidate tokens of the i-th token of the predicted molecular structure corresponding to the input.

[0097] The candidate token with the second highest probability of being the i-th token may be determined as the i-th token.

[0098] The disclosed embodiments provide a device for predicting molecular structure. The device is used to implement the above-mentioned embodiments and preferred embodiments, and the descriptions thereof will not be repeated. As used below, the term "unit" may implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and contemplated.

[0099] The device for predicting molecular structure comprises:

[0100] A molecular structure prediction unit is used to use a pre-trained target molecule generation model to obtain a predicted molecular structure corresponding to the input according to the input of the target molecule generation model and a target path set, wherein the molecular structure prediction unit includes: a token prediction subunit, used to use the target molecule generation model during the prediction of the i-th token of the predicted molecular structure, according to the input and the 1st to i-1th tokens of the predicted molecular structure, to predict a first probability distribution of the i-th token, wherein i is any one from 2 to the number of tokens of the predicted molecular structure, and the first probability distribution indicates the first probability of each candidate token among all candidate tokens of the i-th token as the i-th token; according to the 1st to i-1th tokens of the predicted molecular structure and the target path set, determine the path set corresponding to each candidate token, wherein when the path set corresponding to the candidate token is not an empty set, the candidate token is The path set corresponding to the token is found from the target path set, and the i-th token of each path in the path set corresponding to the candidate token is the candidate token, and the j-th token of each path in the path set corresponding to the candidate token is the same as the j-th token from the 1st token to the i-1th token of the predicted molecular structure, where j is any one from 1 to i-1; for each candidate token, the score of the candidate token is calculated according to the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the corresponding molecular mass score threshold and the number of paths in the path set corresponding to the candidate token; the second probability distribution of the i-th token is obtained according to the score of each candidate token and the first probability distribution of the i-th token; according to the second probability distribution, the i-th token of the predicted molecular structure is determined from all candidate tokens of the i-th token.

[0101] In an optional embodiment, the token prediction subunit is further used to calculate the score of the candidate token based on the number of paths in the path set corresponding to the candidate token whose corresponding molecular mass scores are greater than the medium-level molecular mass score threshold, and the number of paths in the path set corresponding to the candidate token whose corresponding molecular mass scores are greater than the high-level molecular mass score threshold, wherein the high-level molecular mass score threshold is greater than the medium-level molecular mass score threshold.

[0102] In an optional embodiment, the token prediction subunit is further used to calculate the score of the candidate token based on the number of paths in the path set corresponding to the candidate token whose corresponding molecular mass scores are greater than the medium-level molecular mass score threshold, the number of paths in the path set corresponding to the candidate token whose corresponding molecular mass scores are greater than the high-level molecular mass score threshold, and the path diversity parameter of the candidate token, wherein the path diversity parameter of the candidate token is determined based on the ratio of the number of paths included in the path set corresponding to the candidate token to the total number of paths included in the path sets corresponding to all candidate tokens.

[0103] In an optional embodiment, the token prediction subunit is further used to calculate the score of the candidate token based on the number of paths in the path set corresponding to the candidate token whose corresponding molecular mass scores are greater than the medium-level molecular mass score threshold, the number of paths in the path set corresponding to the candidate token whose corresponding molecular mass scores are greater than the high-level molecular mass score threshold, the path diversity parameter of the candidate token, and the number of additional paths corresponding to the candidate token, wherein when the first probability of the candidate token as the i-th token is greater than the probability threshold, the number of additional paths corresponding to the candidate token is 1, and when the first probability of the candidate token as the i-th token is not greater than the probability threshold, the number of additional paths corresponding to the candidate token is 0.

[0104] In an optional embodiment, the device for predicting molecular structure further comprises:

[0105] The target pathway set construction unit is used to predict multiple preliminary prediction pathways using the target molecule generation model before obtaining the predicted molecular structure corresponding to the input according to the input of the pre-trained target molecule generation model and the target pathway set; each preliminary prediction pathway belongs to a different predicted molecular structure; generate a target pathway set including the multiple preliminary prediction pathways; use the target molecule generation model to perform stage prediction to obtain the predicted pathway set of the stage prediction, the stage prediction includes multiple predictions, and the predicted pathway set of the stage prediction includes: the predicted pathway corresponding to each prediction of the stage prediction; perform the path joining operation corresponding to the stage prediction, and the path joining operation includes: for each predicted pathway in the predicted pathway set of the stage prediction, when the first one in the predicted pathway is added When a subpath consisting of token to the mth token does not appear in the target path set, a target molecule generation model is used to perform multiple extended path predictions related to the predicted path, and the extended path prediction includes: taking the 1st token to the mth token of the predicted path as the 1st token to the mth token of the corresponding extended path, and using the target molecule generation model to start prediction from the m+1th token position, predicting the m+1th token to the number of tokens included in the predicted path of the corresponding extended path, and adding the corresponding extended path to the target path set, wherein m is any one from 2 to the number of tokens included in the predicted path - 1; adding the predicted path set predicted by the stage to the target path set.

[0106] In an optional embodiment, the number of expanded pathway predictions related to the predicted pathway performed using the target molecule generation model is the number of predictions included in the stage prediction.

[0107] In this embodiment, the device is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and a memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0108] The further functional description of each of the above units is the same as that of the above corresponding embodiments and will not be repeated here.

[0109] refer to Figure 2, which shows a schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).

[0110] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0111] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0112] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0113] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0114] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means.

[0115] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0116] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0117] A portion of the embodiments of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0118] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for predicting molecular structure, characterized in that: The method comprises: Using a pre-trained target molecule generation model, according to the input of the target molecule generation model and a target path set, a predicted molecular structure corresponding to the input is obtained, including: during the prediction of the i-th token of the predicted molecular structure, using the target molecule generation model, according to the input and the 1st to i-1th tokens of the predicted molecular structure, predicting a first probability distribution of the i-th token, wherein the target molecule generation model is a Lingo3DMol model, i is any one from 2 to the number of tokens of the predicted molecular structure, and the first probability distribution indicates the first probability of each candidate token of all candidate tokens of the i-th token being the i-th token; according to the 1st to i-1th tokens of the predicted molecular structure and the target path set, determining the path set corresponding to each candidate token, wherein when the path set corresponding to the candidate token is not an empty set, the path set corresponding to the candidate token is found from the target path set and the i-th token of each path in the path set corresponding to the candidate token is the candidate token and the path set corresponding to the candidate token. The jth token of each path is the same as the jth token among the 1st token to the i-1th token of the predicted molecular structure, where j is any one from 1 to i-1; for each candidate token, the score of the candidate token is calculated according to the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the corresponding molecular mass score threshold and the number of paths in the path set corresponding to the candidate token; the second probability distribution of the i-th token is obtained according to the score of each candidate token and the first probability distribution of the i-th token; according to the second probability distribution, the i-th token of the predicted molecular structure is determined from all candidate tokens of the i-th token, and the method further includes: predicting a plurality of preliminary predicted paths using a target molecule generation model, wherein each preliminary predicted path belongs to a different predicted molecular structure; generating a target path set including the plurality of preliminary predicted paths; performing stage prediction using the target molecule generation model to obtain a predicted path set of the stage prediction, wherein the stage prediction includes multiple predictions, and the predicted path set of the stage prediction includes: a predicted path corresponding to each prediction of the stage prediction;Performing a path adding operation corresponding to the stage prediction, the path adding operation includes: for each predicted path in the predicted path set of the stage prediction, when the subpath consisting of the 1st token to the mth token in the predicted path does not appear in the target path set, using the target molecule generation model to perform multiple extended path predictions related to the predicted path, the extended path prediction includes: using the 1st token to the mth token of the predicted path as the 1st token to the mth token of the corresponding extended path, and using the target molecule generation model to start prediction from the m+1th token position, predicting the m+1th token to the number of tokens included in the predicted path of the corresponding extended path, and adding the corresponding extended path to the target path set, wherein m is any one of 2 to the number of tokens included in the predicted path - 1; adding the predicted path set of the stage prediction to the target path set. ; 2. The method according to claim 1, characterized in that Calculating the score of the candidate token according to the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the corresponding molecular mass score threshold and the number of paths in the path set corresponding to the candidate token includes: The score of the candidate token is calculated according to the number of paths whose corresponding molecular mass scores in the path set corresponding to the candidate token are greater than the medium-level molecular mass score threshold and the number of paths whose corresponding molecular mass scores in the path set corresponding to the candidate token are greater than the high-level molecular mass score threshold, wherein the high-level molecular mass score threshold is greater than the medium-level molecular mass score threshold.

3. The method according to claim 2, characterized in that According to the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the medium-level molecular mass score threshold and the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the high-level molecular mass score threshold, calculating the score of the candidate token includes: The score of the candidate token is calculated based on the number of paths whose corresponding molecular mass scores in the path set corresponding to the candidate token are greater than the medium-level molecular mass score threshold, the number of paths whose corresponding molecular mass scores in the path set corresponding to the candidate token are greater than the high-level molecular mass score threshold, and the path diversity parameter of the candidate token, wherein the path diversity parameter of the candidate token is determined based on the ratio of the number of paths included in the path set corresponding to the candidate token to the total number of paths included in the path sets corresponding to all candidate tokens.

4. The method according to claim 3, characterized in that According to the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the medium-level molecular mass score threshold, the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the high-level molecular mass score threshold, and the path diversity parameter of the candidate token, calculating the score of the candidate token includes: The score of the candidate token is calculated based on the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the medium-level molecular mass score threshold, the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the high-level molecular mass score threshold, the path diversity parameter of the candidate token, and the number of additional paths corresponding to the candidate token, wherein when the first probability of the candidate token as the i-th token is greater than the probability threshold, the number of additional paths corresponding to the candidate token is 1, and when the first probability of the candidate token as the i-th token is not greater than the probability threshold, the number of additional paths corresponding to the candidate token is 0.

5. The method according to claim 1, characterized in that The number of expanded pathway predictions related to the predicted pathway performed using the target molecule generation model is the number of predictions included in the stage prediction.

6. A device for predicting molecular structure, characterized in that: The device comprises: A molecular structure prediction unit is used to use a pre-trained target molecule generation model to obtain a predicted molecular structure corresponding to the input according to the input of the target molecule generation model and a target path set, wherein the molecular structure prediction unit includes: a token prediction subunit, used to use the target molecule generation model during the prediction of the i-th token of the predicted molecular structure, according to the input and the 1st to i-1th tokens of the predicted molecular structure, to predict a first probability distribution of the i-th token, wherein the target molecule generation model is a Lingo3DMol model, i is any one from 2 to the number of tokens of the predicted molecular structure, and the first probability distribution indicates the first probability of each candidate token of all candidate tokens of the i-th token being the i-th token; according to the 1st to i-1th tokens of the predicted molecular structure and the target path set, determine the path set corresponding to each candidate token, wherein when the path corresponding to the candidate token When the set is not an empty set, the path set corresponding to the candidate token is found from the target path set and the i-th token of each path in the path set corresponding to the candidate token is the candidate token and the j-th token of each path in the path set corresponding to the candidate token is the same as the j-th token from the 1st token to the i-1th token of the predicted molecular structure, where j is any one from 1 to i-1; for each candidate token, the score of the candidate token is calculated according to the number of paths whose molecular mass scores in the path set corresponding to the candidate token are greater than the corresponding molecular mass score threshold and the number of paths in the path set corresponding to the candidate token; the second probability distribution of the i-th token is obtained according to the score of each candidate token and the first probability distribution of the i-th token; according to the second probability distribution, the i-th token of the predicted molecular structure is determined from all candidate tokens of the i-th token; The target pathway set construction unit is used to predict multiple preliminary prediction pathways using the target molecule generation model before obtaining the predicted molecular structure corresponding to the input according to the input of the pre-trained target molecule generation model and the target pathway set; each preliminary prediction pathway belongs to a different predicted molecular structure; generate a target pathway set including the multiple preliminary prediction pathways; use the target molecule generation model to perform stage prediction to obtain the predicted pathway set of the stage prediction, the stage prediction includes multiple predictions, and the predicted pathway set of the stage prediction includes: the predicted pathway corresponding to each prediction of the stage prediction; perform the path joining operation corresponding to the stage prediction, and the path joining operation includes: for each predicted pathway in the predicted pathway set of the stage prediction, when the first one in the predicted pathway is added When a subpath consisting of token to the mth token does not appear in the target path set, a target molecule generation model is used to perform multiple extended path predictions related to the predicted path, and the extended path prediction includes: taking the 1st token to the mth token of the predicted path as the 1st token to the mth token of the corresponding extended path, and using the target molecule generation model to start prediction from the m+1th token position, predicting the m+1th token to the number of tokens included in the predicted path of the corresponding extended path, and adding the corresponding extended path to the target path set, wherein m is any one from 2 to the number of tokens included in the predicted path - 1; adding the predicted path set predicted by the stage to the target path set.

7. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 5 by executing the computer instructions.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 5.

9. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Inverse synthesis prediction method of compound molecules and related device

    CN114822703A

  • Molecular generation method of single system

    CN117153294A