Predicting method, training method, device and electronic equipment for reactant molecules

By jointly optimizing synthon prediction and completion tasks through an end-to-end reverse reaction prediction model and constructing target paths using a basic graph, the problems of time consumption and poor generalization performance of traditional methods are solved. This achieves efficient and accurate prediction of reactant molecules, thereby improving the efficiency of new drug and new material development.

CN115240786BActive Publication Date: 2025-10-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210952642.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-09
Publication Date
2025-10-24
Estimated Expiration
2042-08-09

AI Technical Summary

Technical Problem

In existing methods for predicting reactants in retrosynthetic organic chemistry, traditional reaction templates are time-consuming and cannot cover all reaction types, graph generation models have poor generalization performance due to different subtask optimization objectives, and atom-by-atom completion of synthons is highly complex, making it difficult to achieve efficient and accurate prediction of reactant molecules.

Method used

An end-to-end reverse reaction prediction model is adopted, which jointly optimizes the two subtasks of synthon prediction and synthon completion. The target path is constructed by editing the sequence and completing the synthon sequence, and a basic graph is introduced to simplify the path, reduce complexity and improve generalization performance.

Benefits of technology

It improves the generalization performance and accuracy of reactant molecule prediction, reduces prediction complexity, and enables reliable prediction of reactant molecules even in the absence of reaction templates, thereby improving the efficiency of new drug and new material development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115240786B_ABST
    Figure CN115240786B_ABST
Patent Text Reader

Abstract

The application provides a reaction molecule prediction method, a training method, a device and an electronic device. The method comprises: performing feature extraction on a product molecule to obtain a feature of the product molecule; based on the feature of the product molecule, using a reverse reaction prediction model to predict a conversion path between the product molecule and a plurality of reaction molecules, to obtain a target path; and synthesizing a sub-path and completing a sub-path according to the target path to obtain a plurality of reaction molecules corresponding to the product molecule. The method provided by the application can not only reduce the prediction complexity of the reaction molecules and improve the generalization performance of the reaction molecule prediction, but also improve the prediction performance of the reaction molecules. The plurality of reaction molecules corresponding to the sub-path; the basic graph comprises a plurality of atoms or edges for connecting the atoms.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the field of reverse reaction of chemistry, and more particularly, to a reactant molecule prediction method, a training method, an apparatus and an electronic device. BACKGROUND

[0002] Organic chemistry reverse synthesis reactant prediction is a key step in new drug research and development and new material manufacturing, and the purpose is to find a set of reactant molecules for synthesizing product molecules and commercially available. The traditional method uses reaction templates to match reactant molecules to obtain reactant molecules, but the reaction templates need to be manually extracted by professional researchers, and the process is very time-consuming and the reflection templates cannot cover all reaction types. In recent years, the development of deep learning technology makes it possible to learn potential reaction types from a large database of organic chemical reactions. Therefore, it is particularly important to use deep learning technology to build a powerful reverse reaction prediction model.

[0003] So far, the commonly used model structures generally have two models, one is a sequence translation model based on a simplified molecular input line entry system (SMILES) sequence representation, and SMILES is a specification for explicitly describing molecular structures. The other is a graph generation model based on a graph representation.

[0004] The graph generation model generally divides the organic chemistry reverse reaction prediction task into two sub-tasks, namely, synthesis sub-identification and completion of the synthesis sub. Generally, a graph neural network can be constructed to identify the synthesis sub to obtain the synthesis sub of the product molecule, and a graph variational autoencoder can be constructed to complete the synthesis sub atom by atom. However, by constructing two independent networks for synthesis sub identification and completion of the synthesis sub, the prediction complexity is increased, and since the two sub-tasks have different optimization objectives, the generalization performance cannot be good. In addition, when completing the synthesis sub atom by atom, the complexity is high, which limits the prediction performance. SUMMARY

[0005] Embodiments of the present application provide a reactant molecule prediction method, a training method, an apparatus and an electronic device, which can not only reduce the prediction complexity of the reactant molecule and improve the generalization performance of the reactant molecule prediction, but also improve the prediction performance of the reactant molecule.

[0006] In a first aspect, the present application provides a reactant molecule prediction method, comprising:

[0007] performing feature extraction on the product molecule to obtain features of the product molecule;

[0008] Based on the characteristics of the product molecule, a reverse reaction prediction model is used to predict a conversion path between the product molecule and a plurality of reactant molecules, to obtain a target path; the target path includes an editing sequence and a synthon completion sequence;

[0009] According to the edited state indicated by each editing action in the editing sequence, the editing object of each editing action is edited to obtain a plurality of syntheses corresponding to the product molecule; the editing object is an atom or a chemical bond in the product molecule;

[0010] For each synthon in the plurality of syntheses, based on at least one synthon completion action corresponding to the each synthon in the synthon completion sequence, according to the interface atom indicated by each synthon completion action in the at least one synthon completion action, the basic graph indicated by each synthon completion action is added, to obtain a plurality of reactant molecules corresponding to the plurality of syntheses; the basic graph includes a plurality of atoms or edges for connecting atoms.

[0011] In a second aspect, the present application provides a training method of a reverse reaction prediction model, comprising:

[0012] The product molecule is extracted to obtain the characteristics of the product molecule;

[0013] Based on the characteristics of the product molecule, a reverse reaction prediction model is used to predict a conversion path between the product molecule and a plurality of reactant molecules, to obtain a target path;

[0014] Wherein, the target path includes an editing sequence and a synthon completion sequence; each editing action in the editing sequence is used to indicate an editing object and an edited state, and the editing object is an atom or a chemical bond in the product molecule; for a plurality of syntheses of the product molecule obtained by using the editing sequence, the synthon completion sequence includes at least one synthon completion action corresponding to each synthon in the plurality of syntheses, and each synthon completion action in the at least one synthon completion action is used to indicate a basic graph and an interface atom; the basic graph includes a plurality of atoms or edges for connecting atoms;

[0015] Based on the loss between the target path and the training path, the reverse reaction prediction model is trained.

[0016] In a third aspect, the present application provides a prediction device of a reactant molecule, comprising:

[0017] The extraction unit is used for extracting the characteristics of the product molecule to obtain the characteristics of the product molecule;

[0018] predicting, by a prediction unit, a conversion path from the product molecule to a plurality of reactant molecules based on a feature of the product molecule, by using a reverse reaction prediction model, to obtain a target path; the target path comprising an editing sequence and a synthon completion sequence;

[0019] editing, by an editing unit, an editing object of each editing action indication in the editing sequence according to an edited state indicated by the editing action indication, to obtain a plurality of synths corresponding to the product molecule; the editing object being an atom or a chemical bond in the product molecule;

[0020] adding, by an adding unit, a basic graph indicated by each synthon completion action indication in the at least one synthon completion action corresponding to each synthon in the plurality of synths, according to an interface atom indicated by the synthon completion action indication, to obtain a plurality of reactant molecules corresponding to the plurality of synths; the basic graph comprising a plurality of atoms or edges for connecting atoms.

[0021] In a fourth aspect, the present application provides a training device of a reverse reaction prediction model, comprising:

[0022] extracting, by an extracting unit, a feature of a product molecule to obtain the feature of the product molecule;

[0023] predicting, by a prediction unit, a conversion path from the product molecule to a plurality of reactant molecules based on a feature of the product molecule, by using a reverse reaction prediction model, to obtain a target path;

[0024] The target path comprises an editing sequence and a synthon completion sequence; each editing action in the editing sequence is used to indicate an editing object and an edited state, the editing object being an atom or a chemical bond in the product molecule; for a plurality of synths of the product molecule obtained by using the editing sequence, the synthon completion sequence comprises at least one synthon completion action corresponding to each synthon in the plurality of synths, each synthon completion action in the at least one synthon completion action being used to indicate a basic graph and an interface atom; the basic graph comprising a plurality of atoms or edges for connecting atoms;

[0025] training, by a training unit, the reverse reaction prediction model based on a loss between the target path and a training path.

[0026] In a fifth aspect, the present application provides an electronic device, comprising:

[0027] a processor adapted to implement computer instructions; and

[0028] The computer readable storage medium stores computer instructions, and the computer instructions are adapted to be loaded by the processor and execute the reaction molecule prediction method of the first aspect or the reverse reaction prediction model training method of the second aspect.

[0029] In a sixth aspect, the embodiments of the present application provide a computer readable storage medium, which stores computer instructions. When the computer instructions are read and executed by a processor of a computer device, the computer device executes the reaction molecule prediction method of the first aspect or the reverse reaction prediction model training method of the second aspect.

[0030] In a seventh aspect, the embodiments of the present application provide a computer program product or a computer program, which includes computer instructions stored in a computer readable storage medium. The processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the reaction molecule prediction method of the first aspect or the reverse reaction prediction model training method of the second aspect.

[0031] Based on the above technical solutions, by introducing the reverse reaction prediction model for predicting the conversion path between the product molecule and the plurality of reactant molecules, the prediction task of the synthon and the prediction task of the synthon completion can be combined and processed, that is, the reverse reaction prediction model introduced in the embodiments of the present application can learn the potential relationship between the synthon prediction and the synthon completion, thereby greatly improving the generalization performance of the model, reducing the prediction complexity of the reactant molecule, and improving the generalization performance of the reactant molecule prediction. In addition, by introducing the basic graph and designing the basic graph as a structure including a plurality of atoms or edges for connecting the atoms, a short and accurate target path can be reasonably constructed, the length of the synthon completion sequence is avoided to be too long, the prediction difficulty of the reactant molecule is reduced, and the prediction accuracy of the reactant molecule is improved, thereby the prediction performance of the reactant molecule can be improved.

[0032] In addition, by improving the prediction performance of the reactant molecule, the following technical effects can also be obtained:

[0033] 1. The synthesis path of the designed drug or new material molecule can be planned, and the research efficiency of the drug or new material molecule is improved.

[0034] 2. Some potential scientific laws can be revealed, and new scientific knowledge can be provided.

[0035] 3. More accurate synthetic route planning than professional researchers can be provided, not only reliable reactant molecules can be predicted in the absence of reaction templates, but also reaction types that have not been clearly defined by professional researchers can be predicted, greatly improving the research and development efficiency of new drugs and new materials. BRIEF DESCRIPTION OF DRAWINGS

[0036] Figure 1 is an example of a system framework provided by an embodiment of the present application.

[0037] Figure 2 is a schematic flowchart of a reactant molecule prediction method provided by an embodiment of the present application.

[0038] Figure 3 is an example of a target path provided by an embodiment of the present application.

[0039] Figure 4 is another schematic flowchart of a reactant molecule prediction method provided by an embodiment of the present application.

[0040] Figure 5 is a schematic flowchart of a training method of a reverse reaction prediction model provided by an embodiment of the present application.

[0041] Figure 6 is a schematic block diagram of a reactant molecule prediction device provided by an embodiment of the present application.

[0042] Figure 7 is a schematic block diagram of a training device of a reverse reaction prediction model provided by an embodiment of the present application.

[0043] Figure 8 is a schematic block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0044] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application.

[0045] The scheme provided by the present application can relate to the field of artificial intelligence (AI).

[0046] Among them, AI is to use digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology of computer science, which tries to understand the essence of intelligence and produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.

[0047] It should be understood that artificial intelligence technology is a comprehensive discipline involving a wide range of fields, both hardware and software. Artificial intelligence basic technology generally includes technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.

[0048] With the research and progress of artificial intelligence technology, artificial intelligence technology has been researched and applied in many fields, such as common smart home, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned vehicles, autonomous vehicles, drones, robots, smart medical care, smart customer service, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0049] Embodiments of the present application can involve computer vision (CV) technology in artificial intelligence technology. Computer vision is a science that studies how to make machines "see". Further, it refers to using cameras and computers to replace human eyes to identify, predict and measure targets, and further process images to make computer processing more suitable for human observation or transmission to instrument detection. As a scientific discipline, computer vision researches related theories and technologies, and attempts to establish artificial intelligence systems that can obtain information from images or multidimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping, etc. It also includes common face recognition, fingerprint recognition and other biometric identification technologies.

[0050] Embodiments of the present application can also involve machine learning (ML) in artificial intelligence. ML is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, etc. It is a discipline that studies how computers simulate or implement human learning behavior to acquire new knowledge or skills, and reorganize existing knowledge structure to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental approach to making computers intelligent, and its applications are widespread in various fields of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and example-based learning.

[0051] Figure 1 is an example of a system framework 100 provided by embodiments of the present application.

[0052] The system framework 100 can be an application system, and the specific type of the application is not limited in this embodiment of the application. The system framework 100 includes: a terminal 131, a terminal 132, and a server cluster 110. The terminal 131 and the terminal 132 can be connected to the server cluster 110 via a wireless or wired network 120.

[0053] Terminals 131 and 132 can be at least one of a smartphone, a game console, a desktop computer, a tablet computer, an e-book reader, an MP4 player, an MP4 player, and a laptop computer. Terminals 131 and 132 have applications installed and running. These applications can be any of online video programs, short video programs, photo sharing programs, audio social programs, animation programs, wallpaper programs, news push programs, supply and demand information push programs, academic exchange programs, technical exchange programs, policy exchange programs, programs with comment mechanisms, programs with opinion publishing mechanisms, and knowledge sharing programs. Terminals 131 and 132 can be the terminals used by users 141 and 142, respectively. User accounts are logged into the applications running on terminals 131 and 132.

[0054] The server cluster 110 includes at least one of a server, multiple servers, a cloud computing platform, and a virtualization center. The server cluster 110 is used to provide background services for applications (such as applications on terminals 131 and 132). Optionally, the server cluster 110 assumes the main computing work, and the terminals 131 and 132 assume the secondary computing work; or, the server cluster 110 assumes the secondary computing work, and the terminals 131 and 132 assume the main computing work; or, a distributed computing architecture is used between the terminals 131 and 132 and the server cluster 110 for collaborative computing. For example, the computing work involved in this application can be computing work related to prediction of organic chemical retrosynthesis reactants or related auxiliary work.

[0055] Optionally, taking the system framework 100 as a web browsing system as an example, the server cluster 110 includes: an access server 112, a web server 111, and a data server 113. There can be one or more access servers 112, and the access servers 112 can be deployed nearby in different cities. The access servers 112 are used to receive service requests from terminals 131 and 132, and forward the service requests to the corresponding servers for processing. The web server 111 is a server for providing web pages to terminals 131 and 132, and the web pages are integrated with embedded code; the data server 113 is used to receive data reported by terminals 131 and 132 (such as business data, etc.).

[0056] Organic chemistry retrosynthesis reactant prediction is a key step in new drug research and development and new material manufacturing, and the purpose is to find a set of reactant molecules for synthesizing product molecules and commercially available. The traditional method uses reaction templates to match reactant molecules to obtain reactant molecules, but the reaction templates need to be manually extracted by professional researchers, and the process is very time-consuming and the reflection templates cannot cover all reaction types. In recent years, the development of deep learning technology has made it possible to learn potential reaction types from a large database of organic chemical reactions. Therefore, it is particularly important to use deep learning technology to build a powerful reverse reaction prediction model.

[0057] So far, the commonly used model structure generally has two models, one is a sequence translation model based on a simplified molecular input line entry system (SMILES) sequence representation, and SMILES is a specification for explicitly describing molecular structures. The other is a graph generation model based on a graph representation.

[0058] The graph generation model generally divides the organic chemistry reverse reaction prediction task into two sub-tasks, namely, synthesis sub-identification and completion of the synthesis sub. Generally, a graph neural network can be constructed to identify the synthesis sub to obtain the synthesis sub of the product molecule, and a graph variational autoencoder can be constructed to complete the synthesis sub atom by atom. However, by constructing two independent networks for synthesis sub identification and completion of the synthesis sub, not only does it increase the prediction complexity, but also because the two sub-tasks have different optimization objectives, they cannot achieve good generalization performance. In addition, when completing the synthesis sub atom by atom, the complexity is high, which limits the prediction performance.

[0059] In view of the above problems, pre-extracted leaving groups can be considered to complete the synthesis sub to reduce the difficulty of completing the synthesis sub, and thus improve the performance of reverse reaction prediction. Among them, the leaving group (leaving group) is an atom or functional group that separates from a larger molecule in a chemical reaction. The functional group is an atom or atomic group that determines the chemical properties of an organic compound. Common functional groups include carbon-carbon double bonds, carbon-carbon triple bonds, hydroxyl groups, carboxyl groups, ether bonds, aldehyde groups, etc.

[0060] However, using pre-extracted leaving groups to complete the synthesis sub does not improve the generalization performance of the model; in addition, due to the characteristics of the leaving group, the distribution of the sample is extremely unbalanced, which limits the prediction effect of the reactant molecules.

[0061] In addition, the two subtasks can be jointly learned by an end-to-end model, that is, the two subtasks of synthetic substructure recognition and synthetic substructure completion are integrated into an end-to-end model, and a synthetic substructure is completed by using atoms or benzene rings one by one. The end-to-end model refers to a model that can be trained and optimized by using a single optimization objective.

[0062] However, although the architecture of the end-to-end model can enable the model to achieve better generalization performance, the use of small units such as single atoms and benzene rings to complete the synthetic substructure requires the prediction of a longer graph editing sequence, which increases the difficulty of prediction, and thus the top-1 accuracy cannot reach the state of the art (sota), where the top-1 accuracy refers to the accuracy of the first-ranked category being consistent with the actual result.

[0063] Therefore, the embodiments of the present application provide a reactant molecule prediction method, a training method, an apparatus, and an electronic device, which can not only reduce the prediction complexity of the reactant molecule and improve the generalization performance of the reactant molecule prediction, but also improve the prediction performance of the reactant molecule. Specifically, the embodiments of the present application design an end-to-end reverse reaction prediction model to jointly optimize the two subtasks of synthetic substructure prediction and synthetic substructure completion. Specifically, the synthetic substructure prediction task can be constructed as predicting an editing sequence that can represent the conversion process of the product molecule to the synthetic substructure, the synthetic substructure completion prediction task can be constructed as predicting a synthetic substructure completion sequence that can represent the conversion process of the synthetic substructure to the reactant molecule, and the target path that can represent the conversion process between the product molecule and the reactant molecule can be constructed by using the editing sequence and the synthetic substructure completion sequence.

[0064] Notably, as the amount of data increases, the scheme provided by the embodiments of the present application can be easily extended to more complex and diverse chemical reaction models. For example, the reverse reaction prediction model provided by the embodiments of the present application can be extended to a multi-step reverse reaction prediction task, for example, the Monte Carlo tree search algorithm can be used to extend the reverse reaction prediction model provided by the embodiments of the present application to a multi-step reverse reaction prediction task.

[0065] In addition, by introducing a basic graph, the embodiments of the present application can greatly avoid the problem that the prediction effect of the reactant molecule is limited due to the extremely unbalanced problem of samples with leaving groups, and solve the problem that the prediction complexity is too high when completing the synthetic substructure by using atoms, thereby improving the prediction accuracy of the reverse reaction prediction model.

[0066] Figure 2A schematic flowchart of a prediction method 200 of a reactant molecule according to an embodiment of the present application is shown, which can be executed by any electronic device with data processing capability. For example, the electronic device can be implemented as a server. The server can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, and basic cloud computing services such as big data and artificial intelligence platforms, etc. The server can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application. For ease of description, the prediction method provided by the present application will be described below based on an example of an apparatus for identifying the score of a video frame.

[0067] As shown in Figure 2 The prediction method 200 can include the following steps:

[0068] S210, feature extraction is performed on the product molecule to obtain the features of the product molecule.

[0069] Exemplarily, the product molecule can be subjected to feature extraction by a Simplified Molecular Input Line Entry System (SMILES) or a Graph Neural Networks (GNN) to obtain the features of the product molecule. Of course, the product molecule can also be subjected to feature extraction by other models or frameworks with type functions, which are not limited in the embodiments of the present application.

[0070] Exemplarily, the features of the product molecule can be determined according to the features of each atom in the product molecule. For example, a global attention pooling function can be used to calculate the features of the product molecule based on the features of all atoms.

[0071] Exemplarily, the features of each atom can be obtained by encoding the original features of each atom and the original features of the chemical bonds between each atom and its neighbor nodes. For example, the original features of each atom and the original features of the chemical bonds between each atom and its neighbor nodes can be encoded by an MPNN to obtain the features of each atom. The original features of each atom are used to represent at least one of the following information: the type of the atom (such as C, N, O, S, etc.), the degree of the chemical bond, chirality, and the number of hydrogen atoms, etc. The original features of the chemical bond are used to represent at least one of the following information: the type of the chemical bond (such as single bond, double bond, triple bond, and aromatic bond, etc.), configuration, and aromaticity, etc.

[0072] Exemplarily, the features of the product molecule can further include features for representing types of chemical bonds in the product molecule. For example, the types of chemical bonds in the product molecule include, but are not limited to, single bond, double bond, triple bond, and no chemical bond.

[0073] Exemplarily, the features of the product molecule can be in the form of a vector or in the form of a matrix, and of course, can be replaced by an array or other formats of information, which is not specifically limited in the present application.

[0074] The features of the product molecule are exemplarily described below taking the feature vector as an example.

[0075] Exemplarily, a molecule containing n atoms and m chemical bonds can be represented as a graph structure G = (V, E), where V is an atom set of size n, and E is a chemical bond set of size m. Each atom v e V has a feature vector x v representing the type of the atom (such as C, N, O, S, etc.), the degree of the chemical bond, chirality, and the number of hydrogen atoms, etc. Similarly, each chemical bond e e E has a feature vector x v,u containing information of the type of the chemical bond (such as single bond, double bond, triple bond, and aromatic bond, etc.), the configuration, and the aromaticity, etc. In addition, a 4-dimensional one-hot vector can be defined to represent the type of the chemical bond in the molecular graph, i.e., single bond, double bond, triple bond, and no chemical bond. The one-hot vector is a vector with and only one element being 1 and the rest elements being 0. All atoms and chemical bonds have a label s e {0, 1} for representing whether they are the editing object involved in the conversion of the product molecule into a synthon.

[0076] Exemplarily, a message passing neural network (MPNN) of L layers can be used to encode each atom in the product molecule G to obtain the feature vector of each atom in the product molecule. The MPNN is a supervised learning framework that can be applied to a graph. Further, a multilayer perceptron (MLP) can be used to encode each chemical bond in the product molecule G to obtain the feature vector of each chemical bond. The MLP is a feedforward artificial neural network model, and the MLP can map multiple input data sets to a single output data set.

[0077] Exemplarily, the feature vector h v of the atom and the feature vector h v,u of the chemical bond can be calculated by the following formula:

[0078]

[0079] wherein MPNN(·) represents a message passing neural network, G represents a graph structure of a product molecule, L represents a number of layers of MPNN(·), represents a feature vector of atom v outputted by the L-th layer of MPNN(·), x v represents a feature vector of atom v before encoding, v,u represents a feature vector of a chemical bond between atom v and atom u before encoding, represents a set of neighbor nodes of atom v, h v,u represents a feature vector of a chemical bond between atom v and atom u after encoding, MLP bond (·) represents a multi-layer perceptron, || represents a concatenation operation, represents a feature vector of atom u outputted by the L-th layer of MPNN(·).

[0080] Further, in order to facilitate subsequent tasks, h v,u may be represented in the form of a self-loop, i.e.,

[0081]

[0082] Further, in order to simplify calculation, atoms and chemical bonds are represented in the same form, i.e.,

[0083]

[0084] wherein i is a label of an atom or a label of a chemical bond.

[0085] Exemplarily, the label of an atom can be an index of the atom, and the label of a chemical bond can be an index of the chemical bond.

[0086] After obtaining the feature vector of an atom, a global attention pooling function can be used to calculate the feature vector h G of the product molecule from the feature vectors of all atoms. It is worth noting that it can be necessary to use the feature vector of a synthon, which can be calculated in the same way as h G , i.e., by using a global attention pooling function from the feature vectors of all atoms included in the synthon. syn

[0087] Of course, in other alternative embodiments, a contrast learning strategy can also be introduced in the encoding process of the product molecule or the synthon, such as masking the graph structure or features of the molecule, i.e., the prediction performance of the reactant molecule can be improved by expanding the feature dimension.

[0088] ​S220, based on the characteristics of the product molecule, predicting a conversion path between the product molecule and a plurality of reactant molecules by using a reverse reaction prediction model, to obtain a target path; the target path includes an editing sequence and a complement sequence of a synthon.

[0089] Exemplarily, the editing sequence is a sequence formed by editing actions, and the complement sequence of the synthon is a sequence formed by synthon complement actions.

[0090] In other words, the prediction task of the reverse reaction prediction model is defined as a reactant molecule generation task. That is, the prediction task of the reverse reaction prediction model is to predict a target path describing the conversion path from the product molecule graph to the reactant molecule graph, which is defined by editing actions for the product molecule and synthon complement actions for the synthon, that is, the target path is constructed by the (Edit) sequence formed by editing actions and the complement sequence of the synthon formed by synthon complement actions, so that a target path describing the conversion path from the product molecule graph to the reactant molecule graph can be defined for each product molecule. The synthon complement action can also be referred to as a basic graph adding (Adding Motif) action, and the complement sequence of the synthon can also be referred to as a basic graph adding sequence.

[0091] In other words, the target path contains an editing sequence and a complement sequence of a synthon. The editing sequence is used to describe the changes in chemical bonds and atoms from the product molecule to the synthon. The complement sequence of the synthon is used to describe the process of complementing the synthon using a basic graph (motif). Further, for the editing sequence, each change from the product to the synthon is represented by introducing an editing action, and for the complement sequence of the synthon, each complement operation in the process of complementing the synthon using a basic graph (motif) is described by introducing a synthon complement action.

[0092] Exemplarily, the editing action is an action of editing an atom or editing a chemical bond in the product molecule in the process of converting the product molecule into a plurality of synths of the product molecule.

[0093] Exemplarily, the synthon complement action is an action of adding a basic graph in the process of the plurality of synths to the plurality of reactant molecules.

[0094] Exemplarily, the editing sequence can further comprise an editing completion action. For example, the target path comprises, in sequence, at least one editing action, an editing completion action, and at least one synthon completion action. The editing completion action is used to connect or distinguish the at least one editing action and the at least one synthon completion action. In other words, the editing completion action is used to trigger the inverse reaction prediction model to initiate a synthon completion task. In the embodiments of the present application, the editing completion action is introduced innovatively to connect the at least one editing action to the at least one synthon completion action, thereby constructing the target path.

[0095] Exemplarily, the editing sequence can further comprise a start action. For example, the target path comprises, in sequence, the start action, at least one editing action, an editing completion action, and at least one synthon completion sequence. The start action is used to trigger the inverse reaction prediction model to initiate a synthon prediction task or to trigger the inverse reaction prediction model to initiate a reactant prediction task.

[0096] Of course, in other alternative embodiments, the editing completion action can also be an action in the synthon completion sequence, which is not specifically limited in the present application.

[0097] S230, editing the editing object indicated by each editing action in the editing sequence according to the edited state indicated by the editing action, to obtain a plurality of synthons corresponding to the product molecule; the editing object is an atom or a chemical bond in the product molecule.

[0098] In some embodiments, if the editing object indicated by the editing action is an atom, the edited state indicated by the editing action is to change the number of charges on the atom or to change the number of hydrogen atoms on the atom; if the editing object indicated by the editing action is a chemical bond, the edited state indicated by the editing action is any one of the following: adding a chemical bond, deleting a chemical bond, changing the type of a chemical bond.

[0099] Exemplarily, the edited state indicated by the editing action is related to the editing object indicated by the editing action.

[0100] For example, if the editing object indicated by the editing action is a chemical bond, the edited state indicated by the editing action includes but is not limited to the following states: addition of a chemical bond, deletion of a chemical bond, or change of the type of a chemical bond. For another example, if the editing object indicated by the editing action is an atom, the edited state indicated by the editing action includes but is not limited to the following states: changing the number of charges on the atom or changing the number of hydrogen atoms.

[0101] In some embodiments, the editing action is represented by the following tags: an action tag indicating that editing is to be performed, a tag indicating an editing object, and a tag indicating a state after editing.

[0102] For example, an edit action in an edit sequence can be defined as an edit triplet, i.e., (π1, o, τ), where π1 indicates that the action predicted by the inverse reaction prediction model is an edit action, o indicates the label of the edit object corresponding to the edit action predicted by the inverse reaction prediction model, and τ indicates the label of the edited state corresponding to the edit action predicted by the inverse reaction prediction model. For example, suppose an edit triplet is (π1, b, none), where π1 indicates that the action predicted by the inverse reaction prediction model is an edit action, b indicates that the edit object corresponding to the edit action is a chemical bond with label b, and none indicates that the edited state corresponding to the edit action is the deletion of the chemical bond with label b.

[0103] Of course, in other alternative embodiments, the editing action can be defined as a binary value or a numerical value in other formats. For example, when the editing action can be defined as a binary value, it can be specifically defined as a label for indicating the edited object and a label for indicating the edited state.

[0104] S240, for each synthon in the multiple synthons, based on at least one synthon completion action corresponding to the each synthon in the synthon completion sequence, according to the interface atoms indicated by each synthon completion action in the at least one synthon completion action, adding a basic graph (Motif) indicated by each synthon completion action to obtain a plurality of reactant molecules corresponding to the multiple synthons; the basic graph includes a plurality of atoms or edges for connecting atoms.

[0105] Exemplarily, the reverse reaction prediction model predicts the synthon completion sequence based on the first order of the multiple synthons. When adding a basic graph to each synthon in the multiple synthons, the traversal order of the multiple synthons is the second order. In this case, at least one synthon completion action corresponding to each synthon in the synthon completion sequence can be determined based on the first order and the second order, and then the basic graph indicated by each synthon completion action in the at least one synthon completion action is added according to the interface atoms indicated by each synthon completion action. The first order and the second order can be the same or different. For example, based on the first order, the second order, and the number of the at least one synthon completion action corresponding to each synthon, at least one synthon completion action corresponding to each synthon in the synthon completion sequence can be determined, and then the basic graph indicated by each synthon completion action in the at least one synthon completion action is added according to the interface atoms indicated by each synthon completion action.

[0106] In the case that the first order is equivalent to the second order, and the second order and the number of the at least one synthetic sub-completion action corresponding to each synthetic sub are preset values, the traversal order of the plurality of synthetic subs used in predicting the synthetic sub-completion sequence can be predicted according to the reverse reaction prediction model. For each synthetic sub in the plurality of synthetic subs, the interface atom indicated by each synthetic sub-completion action in the preset number of synthetic sub-completion actions corresponding to the synthetic sub is added to the basic motif indicated by the synthetic sub-completion action. For example, assuming that the plurality of synthetic subs include synthetic sub 1 and synthetic sub 2, the first synthetic sub-completion action in the synthetic sub-completion sequence is a synthetic sub-completion action for synthetic sub 1, and the remaining synthetic sub-completion actions in the synthetic sub-completion sequence are synthetic sub-completion actions for synthetic sub 2. At this time, the basic motif indicated by the first synthetic sub-completion action is added to the interface atom indicated by the first synthetic sub-completion action to obtain a plurality of reactant molecules corresponding to the synthetic sub 1. Further, the basic motifs indicated by the remaining synthetic sub-completion actions are added to the interface atoms indicated by the remaining synthetic sub-completion actions to obtain a plurality of reactant molecules corresponding to the synthetic sub 2.

[0107] For example, the interface atom indicated by each synthetic sub-completion action is an atom on the basic motif indicated by the synthetic sub-completion action as a connection node when the synthetic sub-completion is performed by using the basic motif indicated by the synthetic sub-completion action.

[0108] For example, when the basic motif (Motif) indicated by the synthetic sub-completion action is added, the interface atom indicated by the synthetic sub-completion action and the attachment atom for the synthetic sub-completion action can be taken as a connection node to obtain a plurality of reactant molecules corresponding to the product molecule. It is worth noting that the interface atom indicated by the synthetic sub-completion action and the attachment atom for the synthetic sub-completion action are the same atom in the reactant molecule.

[0109] For example, the attachment atom involved in the embodiments of the present application includes an atom selected as an editing object and an atom at both ends of a chemical bond selected as an editing object.

[0110] In some embodiments, the synthetic sub-completion action is characterized by the following labels: an action label indicating that the synthetic sub-completion is performed, a label indicating the basic motif, and a label indicating the interface atom.

[0111] Exemplarily, the synthon completion action in the synthon completion sequence can be defined as a synthon completion triple, i.e., (π3, z, q). π3 represents that the action predicted by the inverse reaction prediction model is the synthon completion action. z represents the label of the basic graph indicated by the synthon completion action predicted by the inverse reaction prediction model. q represents the label of the interface atom corresponding to the synthon completion action predicted by the inverse reaction prediction model. For example, (π3, z1, q1). π3 represents that the action predicted by the inverse reaction prediction model is the synthon completion action. z1 represents the label of the basic graph indicated by the synthon completion action predicted by the inverse reaction prediction model, i.e., the basic graph with the label z1. q1 represents the label of the atom with the label q1 in the basic graph with the label z1, which is the interface atom. Based on this, based on (π3, z1, q1), the synthon completion can be performed on the basic graph with the label z1 with the atom with the label q1 in the basic graph with the label z1 as the interface atom.

[0112] Of course, in other alternative embodiments, the synthon completion action can be defined as a binary tuple or other format of numerical value. For example, when the synthon completion action is defined as a binary tuple, it can be specifically defined as a label used to indicate a basic graph and a label used to indicate an interface atom.

[0113] By introducing the inverse reaction prediction model for predicting the conversion path between the product molecule and the plurality of reactant molecules, the prediction task of the synthon and the prediction task of the synthon completion can be combined and processed, i.e., the inverse reaction prediction model introduced in the embodiments of the present application can learn the potential relationship between the two sub-tasks of synthon prediction and synthon completion, thereby greatly improving the generalization performance of the model, reducing the prediction complexity of the reactant molecule and improving the generalization performance of the reactant molecule prediction; in addition, by introducing the basic graph and designing the basic graph as a structure including a plurality of atoms or edges for connecting the atoms, a short and accurate target path can be reasonably constructed, avoiding the length of the synthon completion sequence being too long, reducing the prediction difficulty of the reactant molecule and improving the prediction accuracy of the reactant molecule, thereby improving the prediction performance of the reactant molecule.

[0114] In addition, by improving the prediction performance of the reactant molecule, the following technical effects can also be obtained:

[0115] 1. The synthesis path can be planned for the designed drug or new material molecule, and the research efficiency of the drug or new material molecule is improved.

[0116] 2. Some potential scientific laws can be revealed, and new scientific knowledge can be provided.

[0117] 3. It can provide more accurate synthetic route planning than professional researchers, not only can predict reliable reactant molecules in the absence of reaction templates, but also can predict reaction types that have not been clearly defined by professional researchers, greatly improving the efficiency of new drug and new material research and development.

[0118] In some embodiments, the S220 can include:

[0119] Based on the t-1th action predicted by the reverse reaction prediction model, the input feature of the tth action is obtained; based on the input feature corresponding to the tth action and the hidden feature corresponding to the tth action, the tth action is predicted until the action predicted by the reverse reaction prediction model is a synthetic sub-completion action and all attached atoms on the plurality of synthetic sub-molecules and all attached atoms on the basic graph added for the plurality of synthetic sub-molecules have been traversed, the target path is obtained; wherein the hidden feature of the tth action is related to the action predicted by the reverse reaction prediction model before the tth action.

[0120] Illustratively, the attached atom includes an atom selected as an editing object and an atom at both ends of a chemical bond selected as an editing object.

[0121] Illustratively, the reverse reaction prediction model can be a recurrent neural network (RNN), based on which the t-1th action can correspond to time t-1, and the tth action can correspond to time t; that is, based on the action predicted by the RNN at time t-1, the input feature of the RNN at time t is obtained, and based on the input feature of the RNN at time t and the hidden feature of the RNN at time t, the action of the RNN at time t is predicted until the action predicted by the RNN is a synthetic sub-completion action and all attached atoms on the plurality of synthetic sub-molecules and all attached atoms on the basic graph added for the plurality of synthetic sub-molecules have been traversed, the target path is obtained.

[0122] It is worth noting that the multi-layer perceptron and the convolutional neural network have a feature that the input is assumed to be an independent unit without context connection, such as an input being a picture, and the network identifies whether it is a dog or a cat. However, for some sequential input with obvious context features, such as predicting the playback content of the next frame in a video, it is obvious that such output must depend on the previous input, that is, the network must have a certain memory ability. The RNN just gives the network such a memory ability.

[0123] Of course, in other alternative embodiments, the reverse reaction prediction model can also be other models, which are not limited in the present application.

[0124] Exemplarily, the reverse reaction prediction model can predict the t-th action based on the input feature corresponding to the t-th action and the hidden feature corresponding to the t-th action to obtain an output feature u t The output feature u t is then concatenated with the feature h G of the product molecule to obtain a feature ψ t for identifying the t-th action.

[0125] Exemplarily, the output feature u t and the feature ψ t for identifying the t-th action can be obtained in the following manner.

[0126] u t = GRU (input t-1 , hidden t-1 ), where input0= 0, hidden0= h G (h G );

[0127] ψ t = h G ||u t .

[0128] where GRU (·) is a gated recurrent unit, input t-1 and hidden t-1 are respectively an input feature (i.e., a feature of the intermediate molecular fragment after being edited based on the (t-1)-th action) and a hidden state (hidden state) passed down by the node for predicting the t-th action, and their initial values are respectively a 0 vector and a feature of the product molecule graph, σ G (·) is an embedding function of the feature of the product molecule.

[0129] Exemplarily, the reverse reaction prediction model can identify the t-th action by using the following formula:

[0130]

[0131] where softmax (·) is a classification function, MLP bond (·) represents a multi-layer perceptron, and ψ t represents the feature for identifying the t-th action.

[0132] It should be understood that, in the embodiments of the present application, the output feature u t is concatenated with the feature h G of the product molecule.The splicing processing, i.e., splicing the features of the product molecules and the output features of the RNN, is used for subsequent action prediction, which can integrate global topological information into the action prediction process, and further improve the accuracy of action prediction.

[0133] In some embodiments, the target path can be determined in the following manner:

[0134] According to the beam search manner of the hyperparameter k, the k first prediction results with the highest scores are obtained from the prediction results of the t-1th action; based on the k first prediction results, the k first input features corresponding to the tth action are determined; then, based on each of the k first input features and the hidden feature corresponding to the tth action, the tth action is predicted, and according to the beam search manner of the hyperparameter k, the k second prediction results with the highest scores are obtained from the 2k prediction results obtained by prediction; based on the k second prediction results, the k second input features corresponding to the t+1th action are determined; based on each of the k second input features and the hidden feature corresponding to the t+1th action, the t+1th action is predicted, until the action predicted by the inverse reaction prediction model is a synthetic sub-completion action and all the attached atoms on the plurality of synthetic sub-molecules and all the attached atoms on the basic graph added for the plurality of synthetic sub-molecules have been traversed, the target path is obtained.

[0135] For example, when the k first prediction results with the highest scores are obtained from the prediction results of the t-1th action according to the beam search manner of the hyperparameter k, the prediction results of the t-1th action can be sorted according to the scores first, and then the k prediction results with the highest scores in the prediction results of the t-1th action are taken as the k first prediction results. For example, when the prediction results of the t-1th action are sorted according to the scores, the scores of all the prediction results that have been predicted on the path where each prediction result is located can be accumulated and calculated first to obtain the score accumulation corresponding to each prediction result, and then the k prediction results with the highest score accumulations in the prediction results of the t-1th action are taken as the k first prediction results.

[0136] Exemplarily, the Beam Search with hyperparameter k is used to select multiple alternatives for the input sequence at each time step based on conditional probabilities. The number of multiple alternatives depends on a hyperparameter k called BeamWidth. At each time, the beam search selects the best k alternatives with the highest probabilities as the most likely choices at the current time. That is, at each time, the k best results with the highest scores are selected based on a log-likelihood scoring function as the input for the next time. In other words, this process can be described as a construction of a search tree, where the highest scoring leaf nodes are expanded with their child nodes, while other leaf nodes are pruned.

[0137] In some embodiments, if the (t-1)th action is the editing action, the input feature of the tth action is determined based on the feature of the subgraph obtained by editing using the (t-1)th action, and the editing object and the edited state indicated by the tth action are predicted using the inverse reaction prediction model based on the input feature of the tth action and the hidden feature of the tth action, until the action predicted using the inverse reaction prediction model is the last editing action in the editing sequence, and the editing sequence is obtained.

[0138] Exemplarily, the last editing action is an editing completion action.

[0139] In other words, if the (t-1)th action is the editing action, the input feature of the tth action is determined based on the feature of the subgraph obtained by editing using the (t-1)th action, and the editing object and the edited state indicated by the tth action are predicted using the inverse reaction prediction model based on the input feature of the tth action and the hidden feature of the tth action, until the action predicted using the inverse reaction prediction model is the editing completion action, and the editing sequence is obtained.

[0140] Exemplarily, t is an integer greater than 1 or greater than 2.

[0141] Exemplarily, when the (t-1)th action is the first editing action, the (t-1)th action is a start action, and at this time, the feature of the subgraph obtained by editing using the (t-1)th action is the feature of the product molecule.

[0142] Exemplarily, when the inverse reaction prediction model predicts the tth action, the intermediate molecular fragment processed based on the (t-1)th action can be decoded to obtain the feature of the intermediate molecular fragment edited based on the (t-1)th action.

[0143] Exemplarily, if the tth action is the editing action, the inverse reaction prediction model can assign a score to each chemical bond and atom predict the editing object corresponding to the t-th action.

[0144] For example, if the t-th action is the editing action, the inverse reaction prediction model can first assign a score to each chemical bond and atom when predicting the editing object corresponding to the t-th action The score represents the probability that the chemical bond or atom is considered as the editing object in the t-1-th action; then assign a score to each chemical bond and atom based on predict the editing object corresponding to the t-th action.

[0145] For example, the inverse reaction prediction model can assign a score to each chemical bond and atom by the following formula

[0146]

[0147] wherein, represents the score of the i-th chemical bond or atom, sigmoid(·) is a logistic regression function, MLP target (·) represents the features output by the multi-layer perceptron for determining the score of the i-th chemical bond or atom, ψ t represents the features for identifying the t-th action, σ e (·) represents an embedding function of the features of the atom or chemical bond, e i represents the i-th chemical bond or atom.

[0148] Then, the inverse reaction prediction model predicts the edited state of the editing object corresponding to the t-th action

[0149] For example, the inverse reaction prediction model can predict the edited state of the editing object corresponding to the t-th action by the following formula

[0150]

[0151] wherein, represents the predicted edited state of the editing object, for example, the type of the edited chemical bond, softmax(·) is a classification function, MLP type (·) represents the features output by the multi-layer perceptron for determining the type of the chemical bond, ψ t represents the features for identifying the t-th action, σ e (·) represents an embedding function of the features of the atom or chemical bond, argmax(·) represents finding the atom or chemical bond with the maximum score, represents the features of the atom or chemical bond with the maximum score.

[0152] Exemplarily, the inverse reaction prediction model applies the predicted editing object corresponding to the t-th action and the predicted state after editing corresponding to the t-th action to the intermediate molecular fragment before editing corresponding to the t-th action to obtain the intermediate molecular fragment after editing corresponding to the t-th action, and then calculates the feature of the intermediate molecular fragment after editing corresponding to the t-th action by using the MPNN (·) Then, based on the obtained feature of the intermediate molecular fragment after editing corresponding to the t-th action the editing object corresponding to the t-th action and the state after editing corresponding to the t-th action, the input feature input corresponding to the (t+1)-th action is obtained t .

[0153] Exemplarily, the input feature input corresponding to the (t+1)-th action can be obtained according to the following formula t :

[0154]

[0155] wherein, indicates the feature of the intermediate molecular fragment after editing corresponding to the t-th action obtained based on the feature of the intermediate molecular fragment before editing corresponding to the t-th action, σ e (·) represents an embedding function of the feature of an atom or a chemical bond, argmax (·) represents finding an atom or a chemical bond with the maximum score, indicates the feature of the atom or the chemical bond with the maximum score, indicates the score of the i-th chemical bond or atom, indicates the predicted state after editing of the editing object, σ b (·) represents an embedding function of .

[0156] In some embodiments, if the t-1-th action is the last editing action in the editing sequence or the synthon completion action, the input feature of the t-th action is determined based on the feature of the subgraph obtained by editing by using the t-1-th action and the feature of the attached atom corresponding to the t-1-th action, and the basic graph and the interface atom indicated by the t-th action are predicted based on the input feature of the t-th action and the hidden feature of the t-th action; until the action predicted by the inverse reaction prediction model is the synthon completion action and all attached atoms on the plurality of synths and the basic graphs added for the plurality of synths have been traversed, the synthon completion sequence is obtained.

[0157] Exemplarily, the last editing action is an editing completion action.

[0158] In other words, if the (t-1)th action is an edit action or a synthon completion action, the input feature of the tth action is determined based on the feature of the subgraph obtained by editing using the (t-1)th action and the feature of the attached atom corresponding to the (t-1)th action, and the basic graph and the interface atom indicated by the tth action are predicted based on the input feature of the tth action and the hidden feature of the tth action; until the action predicted by the inverse reaction prediction model is a synthon completion action and all attached atoms on the synthon and the basic graph added to the synthon have been traversed, the synthon completion sequence is obtained.

[0159] Illustratively, if the action predicted by the inverse reaction prediction model is the last edit action, it indicates that the synthon prediction phase ends and the reactant prediction process enters the synthon completion phase. At this time, all attached atoms are sorted according to their label order in the product molecule so as to perform synthon completion.

[0160] Illustratively, if the action predicted by the inverse reaction prediction model is the last edit action, the input feature corresponding to the (t+1)th action can be determined according to the following formula: t :

[0161] input t =h syn +σ atom (a t ),where a t ∈{a}。

[0162] wherein, represents the feature of the obtained edited intermediate molecular fragment corresponding to the tth action, σ atom (·) represents an embedding function of the feature of the attached atom, and a t represents the attached atom corresponding to the tth action.

[0163] Illustratively, in the synthon completion phase, the inverse reaction prediction model traverses all attached atoms on the synthon and all attached atoms on the added basic graph in turn, and assigns a basic graph (motif) to each attached atom. The prediction of the basic graph can be regarded as a multi-classification task in the pre-stored dictionary Z. The basic graph prediction obtains a basic graph After that, the interface atom corresponding to the attached atom a t on the basic graph

[0164] Illustratively, the inverse reaction prediction model can predict the basic graph corresponding to the tth action according to the following formula:

[0165]

[0166] wherein, denotes the basic graph corresponding to the t-th action, softmax(·) is a classification function, MLP motif (·) denotes the feature output by the multi-layer perceptron for predicting the basic graph corresponding to the t-th action, ψ t denotes the feature for identifying the t-th action.

[0167] Exemplarily, the inverse reaction prediction model can predict the basic graph corresponding to the t-th action according to the following formula wherein, the interface atom a t corresponds to the attached atom a

[0168]

[0169] wherein, denotes the basic graph corresponding to the t-th action wherein, the interface atom a t corresponds to the attached atom a interface (·) denotes the feature output by the multi-layer perceptron for predicting , softmax(·) is a classification function, MLP t denotes the feature for identifying the t-th action, σ z (·) denotes the embedding function of the feature of the basic graph , ψ denotes the basic graph corresponding to the t-th action.

[0170] If the t-1-th action is the last editing action or the synthetic sub-completion action, and the interface atom of the basic graph corresponding to the t-1-th action only includes one interface atom, then the input feature of the t-th action is determined based on the feature of the sub-graph obtained by editing using the t-1-th action and the feature of the attached atom corresponding to the t-1-th action.

[0171] Exemplarily, if the predicted basic graph only contains one interface atom, then the input feature input t of the t+1-th action can be determined according to the following formula

[0172] input t = h syn + σ atom (a t ), where a t ∈{a}.

[0173] wherein, represents the feature of the obtained edited intermediate molecular fragment corresponding to the t-th action, σ atom (·) represents an embedding function of the feature of the attached atom, a t represents the attached atom corresponding to the t-th action.

[0174] If the t-1-th action is the last editing action or the synthon completion action, and the interface atom of the base graph corresponding to the t-1-th action only includes a plurality of interface atoms, the input feature of the t-th action is determined based on the feature of the subgraph obtained by editing using the t-1-th action, the feature of the base graph corresponding to the t-1-th action, and the feature of the attached atom corresponding to the t-1-th action.

[0175] Exemplarily, if the predicted base graph only includes a plurality of interface atoms, the input feature of the t+1-th action can be determined according to the following formula: t

[0176]

[0177] wherein, represents the feature of the obtained edited intermediate molecular fragment corresponding to the t-th action, σ z (·) represents an embedding function of the feature of the base graph , represents the base graph corresponding to the t-th action, σ atom (·) represents an embedding function of the feature of the attached atom, a t represents the attached atom corresponding to the t-th action.

[0178] It can be known from the above scheme that after the editing sequence and the synthon completion sequence are predicted by the reverse reaction prediction model, the target path can be obtained, and thus the reactant molecular graph can be obtained by acting the target path on the product molecular graph.

[0179] Figure 3 is an example of the target path provided by the embodiments of the present application.

[0180] As Figure 3 shown, the left side of (a) in Figure 3 shows the reactant prediction of the product molecule, which can be obtained according to the process shown in (c) in Figure 3 , to obtain the target path shown in (b) in Figure 3 , and further obtain Figure 3 ​The two reactant molecules are shown on the right side of (a). π1 indicates that the reverse reaction prediction model predicts an edit action, π2 indicates that the reverse reaction prediction model predicts an edit completion action, and π3 indicates that the reverse reaction prediction model predicts a synthon completion action. a1-a3 represent attachment atoms, q1-q4 represent interface atoms, z1-z3 represent the base graph, b indicates that the edited object corresponding to the edit action is the chemical bond labeled b, and none indicates that the edited state corresponding to the edit action is the deletion of the chemical bond labeled b. Attached atoms are interfaces for adding base graphs (motifs).

[0181] Specifically, when the input of the reverse reaction prediction model is the start action, the label of the predicted first editing action is the triplet (π1, b, none), and then the triplet (π1, b, none) is used as input, and the label of the second action is predicted to be π2; then, all attached atoms are sorted according to the order of their labels in the product molecule, and the binary pairs (π3, a1), (π3, a2), and (π3, a3) are input in sequence, and the labels of the actions predicted in sequence are the triplet (π3, z1, q1), the triplet (π3, z2, q2), and the triplet (π3, z3, q4). Based on this, the target path can be defined as Figure 3 The path shown in (b) is: triple (π1, b, none), π2, triple (π3, z1, q1), triple (π3, z2, q2), triple (π3, z3, q4). Therefore, by applying the target path to the product molecule, we can get the following: Figure 3 The reactant molecules are shown on the right side of (a).

[0182] In other words, in Figure 3 In the reactant prediction process shown, the edit sequence includes only one edit action, defined as the triple (π1, b, none). The synthon completion sequence includes three synthon completion actions, defined as the triples (π3, z1, q1), (π3, z2, q2), and (π3, z3, q4).

[0183] It is worth noting that when adding the motif of the synthetic sub-completion action indication, the interface atom of the synthetic sub-completion action indication and the attachment atom for the synthetic sub-completion action can be taken as the connection node. It is worth noting that the interface atom of the synthetic sub-completion action indication and the attachment atom for the synthetic sub-completion action are the same atom in the reactant molecule. For example, when adding z1 based on the triple (π3, z1, q1), a1 and q1 are the same atom (i.e., an N atom) in the reactant molecule; similarly, when adding z2 based on the triple (π3, z2, q2), a2 and q2 are the same atom (i.e., an O atom) in the reactant molecule; after adding z2, the interface atom q3 becomes the attachment atom a3, and when adding z3 based on the triple (π3, z3, q4), a3 and q4 are the same atom (i.e., a C atom) in the reactant molecule.

[0184] It should be understood that, Figure 4 The examples are merely for the purpose of illustration of the present application and should not be construed as limiting the present application.

[0185] For example, in other alternative embodiments, the target path can also include other numbers of editing actions or synthetic sub-completion actions, or even other numbers of syntheses or reactant molecules, which are not limited in the embodiments of the present application.

[0186] Figure 3 is another schematic flow chart of the prediction method of the reactant molecule provided by the embodiments of the present application. Wherein, π1 represents that the action predicted by the reverse reaction prediction model is an editing action, π2 represents that the action predicted by the reverse reaction prediction model is an editing completion action, π3 represents that the action predicted by the reverse reaction prediction model is a synthetic sub-completion action, a1-a3 represent attachment atoms, q1-q3 represent interface atoms, z1-z3 represent motifs, g represents that the editing object corresponding to the editing action is a chemical bond with a label g, and none represents that the state after the editing action corresponds to deleting the chemical bond with the label g. The attachment atom is the interface for adding the motif.

[0187] Specifically, the input of the reverse reaction prediction model is the starting action, the label of the first editing action predicted is the triple (π1, g, none), then the triple (π1, g, none) is taken as the input, and the label of the second action predicted is π2; then, all the attachment atoms are sorted according to the label order in the product molecule, and the binary tuples (π3, a1), (π3, a2), (π3, a3) are input in turn, and the labels of the actions predicted in turn are the triple (π3, z1, q1), the triple (π3, z2, q2), and the triple (π3, z3, q4). Based on this, the target path obtained can be defined as Figure 4the path shown in (b) of FIG. 1: triple (pi1, b, none), pi2, triple (pi3, z1, q1), triple (pi3, z2, q2), triple (pi3, z3, q4), where a1-a3, q1-q3, z1-z3 are shown in the figure. Based on this, the target path is applied to the product molecule, and the final reactant molecule is obtained.

[0188] In Figure 4 In the reactant prediction process shown in (b) of FIG. 1, the edit sequence only includes one edit action, which is defined as triple (pi1, b, none). The synthon completion sequence includes 3 synthon completion actions, which are respectively defined as triple (pi3, z1, q1), triple (pi3, z2, q2), and triple (pi3, z3, q4). It is worth noting that when adding the motif indicated by the synthon completion action, the interface atom indicated by the synthon completion action and the attachment atom corresponding to the synthon completion action can be used as the connection node. It is worth noting that the interface atom indicated by the synthon completion action and the attachment atom corresponding to the synthon completion action are the same atom in the reactant molecule.

[0189] In other words, the reactant prediction process includes an edit phase and a motif addition phase. The edit phase describes the changes of bonds and atoms from the product to the synthon, i.e., the prediction process of the synthon, while the motif addition phase completes the generation of the reactant by adding appropriate motifs to the synthon.

[0190] In the edit phase, the input molecule graph is first encoded by a graph neural network (GNN) to obtain the output of the GNN. Then, if the t-th action is an edit action, a recurrent neural network (RNN) performs action prediction based on the output of the GNN corresponding to the t-th action and the hidden state output by the last node. If the t-th action is an edit completion action or a synthon completion action, the RNN performs action prediction based on the output of the GNN corresponding to the t-th action, the attachment atom corresponding to the t-th action, and the hidden state output by the last node. In other words, in the edit phase, the RNN gradually predicts the edit sequence until the edit completion action is predicted, ending the edit phase and starting the motif addition phase. In the motif addition phase, the RNN adds motifs one by one until all attachment atoms are traversed.

[0191] In Figure 3In the example of FIG. 6, the first editing action is applied to the chemical bond S=O, and the new chemical bond type is none, indicating that the chemical bond is deleted. In the synthon completion action, the interface atoms (q1, q2, and q3) in the base graph and the attachment atoms (a1, a2, and a3) in the synthon / intermediate represent the same atom, which are merged into a single atom when the base graph is attached to the synthon / intermediate. For example, when z1 is added based on the triple (pi3, z1, q1), a1 and q1 are the same atom (i.e., the S atom) in the reactant molecule; similarly, when z2 is added based on the triple (pi3, z2, q2), a2 and q2 are the same atom (i.e., the O atom) in the reactant molecule; after z2 is added, the interface atom q3 becomes the attachment atom a3, and when z3 is added based on the triple (pi3, z3, q4), a3 and q4 are the same atom (i.e., the C atom) in the reactant molecule.

[0192] It should be understood that, Figure 4 and Figure 5 are merely examples of the present application and should not be construed as limiting the present application.

[0193] For example, in other alternative embodiments, the target path can not include a start action or an edit completion action.

[0194] Figure 5 A schematic flowchart of a training method 300 of a reverse reaction prediction model according to an embodiment of the present application is shown, which can be executed by any electronic device having data processing capability. For example, the electronic device can be implemented as a server. The server can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, and basic cloud computing services such as big data and artificial intelligence platforms, etc. The server can be connected directly or indirectly through wired or wireless communication, which is not limited in the present application. For ease of description, the prediction method provided by the present application will be described below based on an example of an apparatus for identifying the score of a video frame.

[0195] As Figure 6 shown, the training method 300 can include:

[0196] S310, performing feature extraction on the product molecule to obtain the features of the product molecule;

[0197] S320, based on the features of the product molecule, using a reverse reaction prediction model to predict the conversion path between the product molecule and a plurality of reactant molecules to obtain a target path;

[0198] The target path includes an edit sequence and a synthon completion sequence. Each edit action in the edit sequence is used to indicate an edit object and an edited state, and the edit object is an atom or a chemical bond in the product molecule. The synthon completion sequence includes at least one synthon completion action corresponding to each synthon in the plurality of synths obtained by using the edit sequence. Each synthon completion action is used to indicate a basic graph and an interface atom. The basic graph includes a plurality of atoms or edges connecting the atoms.

[0199] S330, training the reverse reaction prediction model based on the loss between the target path and the training path.

[0200] Based on the above technical solutions, by introducing a conversion path between the product molecule and the plurality of reactant molecules, the reverse reaction prediction model can learn the potential relationship between the synthon prediction and the synthon completion, thereby greatly improving the generalization performance of the model, reducing the prediction complexity of the reactant molecule, and improving the generalization performance of the reactant molecule prediction.

[0201] In addition, by introducing a basic graph and designing the basic graph to include a plurality of atoms or edges connecting the atoms, a short and accurate target path can be reasonably constructed, the length of the synthon completion sequence is avoided to be too long, the prediction difficulty of the reactant molecule is reduced, and the prediction accuracy of the reactant molecule is improved, thereby improving the prediction performance of the reactant molecule.

[0202] In some embodiments, before S320, the method 300 can further include:

[0203] Obtaining a candidate reactant molecule corresponding to the product molecule; obtaining a basic graph dictionary by comparing the molecular structures of the product molecule and the candidate reactant molecule; and obtaining the training path based on the basic graph dictionary.

[0204] For example, the candidate reactant molecule can be all reactant molecules of the product molecule. That is, the candidate reactant molecule can be used to generate all reactant molecules of the product molecule.

[0205] In some embodiments, a connection tree is constructed based on the basic graph dictionary. The connection tree includes a tree structure with the plurality of synths as root nodes and the basic graphs in the basic graph dictionary as child nodes. The shortest path is determined as the training path by traversing the connection tree.

[0206] Since the reactant molecule can be decomposed into synthons and motifs, where a synthon is a molecular fragment obtained by breaking chemical bonds of the product molecule graph, and a motif is a subgraph of the reactant, the connection relationship between the synthons and motifs is maintained by constructing a connection tree. The connection tree represents the synthons and motifs as a hierarchical tree structure, where the synthons are root nodes and the motifs are child nodes. An edge between two nodes in the connection tree represents that the two subgraphs are directly connected in the reactant molecule graph, where a triple of an attachment atom, a motif and an interface atom can be used to represent each edge.

[0207] In this embodiment, the connection relationship between the synthons and motifs is represented by constructing a tree structure (i.e., a connection tree), which can be used to provide an effective strategy for constructing a training path and reduce the training complexity.

[0208] Exemplarily, a depth-first search can be used to traverse the entire connection tree, and the shortest path after traversal is determined as the training path.

[0209] The depth-first traversal manner can refer to that a vertex v in the tree structure is traversed according to the following manner:

[0210] 1. visiting the vertex v;

[0211] 2. successively starting from unvisited adjacent points of v, performing depth-first traversal on the tree structure; until all vertices in the tree structure that have a path connected with v are visited;

[0212] 3. if there are still unvisited vertices in the tree structure at this time, starting from an unvisited vertex, re-performing depth-first traversal until all vertices in the tree structure are visited.

[0213] The search strategy followed by the depth-first search is to search as "deeply" as possible in the tree. Its basic idea is: in order to obtain a solution to a problem, a certain possible case is first selected to explore forward (child node), and in the exploration process, once it is found that the original selection does not meet the requirements, the father node is returned to reselect another node and continue to explore forward, and so on until the optimal solution is obtained. In other words, the depth-first search starts from a vertex V0, and walks along a path to the end, if it is found that the target solution cannot be reached, it returns to the last node, and then starts from another path to the end. The concept of trying to walk as deeply as possible is the concept of depth-first.

[0214] In some embodiments, molecular fragments other than the plurality of synthon in the candidate reactant are determined as a plurality of candidate subgraphs; if a first candidate subgraph in the plurality of candidate subgraphs comprises a first atom and a second atom, and the first atom and the second atom belong to different rings, a chemical bond between the first atom and the second atom is broken to obtain a plurality of first subgraphs; if a second candidate subgraph in the plurality of candidate subgraphs comprises a third atom and a fourth atom connected to each other, one of the third atom and the fourth atom belongs to a ring, and the other of the third atom and the fourth atom has a degree greater than or equal to a preset value, a chemical bond between the third atom and the fourth atom is broken to obtain a plurality of second subgraphs; candidate subgraphs other than the first candidate subgraph and the second candidate subgraph in the plurality of candidate subgraphs, the plurality of first subgraphs, and the plurality of second subgraphs are determined as the basic graphs in the basic graph dictionary.

[0215] Exemplarily, since a product molecule can be decomposed into a set of incomplete subgraphs, called synthon, after combining appropriate basic graphs (motifs) to each attached atom, the synthon can be reconstructed into a reactant molecule graph. In other words, a basic graph (motif) can be regarded as a subgraph on a reactant molecule graph. Therefore, embodiments of the present application divide the basic graph (motif) extraction process into the following steps:

[0216] 1. Break the edges that exist in the synthon but not in the corresponding reactant to obtain a series of subgraphs. These subgraphs retain the interface atoms corresponding to the attached atoms on the synthon.

[0217] It should be understood that the synthon corresponding reactant can include a molecule containing the synthon or a reactant.

[0218] 2. If there are two connected atoms on a subgraph belonging to two rings respectively, break the chemical bond connected between the two atoms to obtain two smaller subgraphs.

[0219] It should be understood that the ring involved in embodiments of the present application can be a monocyclic ring, i.e. there is only one ring in the molecule. Correspondingly, if there are two connected atoms on a subgraph belonging to two monocyclic rings respectively, break the chemical bond connected between the two atoms to obtain two smaller subgraphs. In addition, the ring involved in embodiments of the present application can be a cycloalkane, which can be classified based on the number of carbon atoms on the ring. Exemplarily, when the number of carbon atoms on the ring is 3-4, it is called a small ring, when the number of carbon atoms on the ring is 5-6, it is called a normal ring, when the number of carbon atoms on the ring is 7-12, it is called a medium ring, and when the number of carbon atoms on the ring is greater than 12, it is called a large ring.

[0220] 3. If in a subgraph, two connected atoms have one atom belonging to a ring and the other atom has a degree greater than 1, then break the chemical bond between the two atoms to obtain two smaller subgraphs.

[0221] Finally, a dictionary Z with a preset number of motifs can be extracted. For example, a dictionary Z with 210 motifs can be extracted.

[0222] In some embodiments, before the S330, the method 300 can further include:

[0223] The loss between the target path and the training path is determined based on the following information:

[0224] The difference between the label of the predicted action in the target path and the label of the training action in the training path, the difference between the score of the editing object corresponding to the predicted action and the score of the editing object corresponding to the training action, the difference between the edited state corresponding to the predicted action and the edited state corresponding to the training action, the difference between the motif indicated by the predicted action and the motif indicated by the training action, and the difference between the interface atom indicated by the predicted action and the interface atom indicated by the training action.

[0225] In the embodiments of the present application, since the training target of the reverse reaction prediction model is to give a training path and predict a target path, the reverse reaction prediction model is modeled as an autoregressive molecular generation problem. That is, given a product molecule G P , for each step t, the autoregressive model obtains a new graph structure G t When the reactant molecule G R is predicted, it means that the generation process is completed. Therefore, the generation process of the reactant molecule graph can be defined as the following joint probability likelihood function:

[0226]

[0227] where G R represents the reactant molecule, N is the length of the target path, G t is the intermediate molecular fragment corresponding to the t-th action, and G0=G P .

[0228] It should be noted that the intermediate molecular fragment G tInstead of being generated directly by the reverse reaction prediction model, the reverse reaction prediction model generates a new graph editing action, an editing object (i.e., a chemical bond, an atom, or a basic graph) and its edited state (i.e., a new chemical bond type or an interface atom) according to the historical action, and then applies it to the intermediate molecular fragment of the previous step to obtain a new intermediate molecular fragment. Based on this, given the editing object, the edited state, and the intermediate molecular fragment of the history, the likelihood function can be modified as follows:

[0229]

[0230] Exemplarily, the cross-entropy loss can be used to optimize the difference between the label of the predicted action in the target path and the label of the training action in the training path, the difference between the edited state corresponding to the predicted action and the edited state corresponding to the training action, the difference between the basic graph indicated by the predicted action and the basic graph indicated by the training action, and the difference between the interface atom indicated by the predicted action and the interface atom indicated by the training action, and the binary cross-entropy loss is used to optimize the difference between the score of the editing object corresponding to the predicted action and the score of the editing object corresponding to the training action.

[0231] For example, the loss between the target path and the training path can be determined using the following formula:

[0232]

[0233] wherein N1 represents the length of the editing sequence or the length of the sequence formed by the editing sequence and the editing completion action, and N2 represents the length of the editing sequence and the synthesis sub-completion sequence.

[0234] It should be understood that the implementation of S320 in the training method 300 can refer to the implementation of S220 in the prediction method 200, and details are not repeated here to avoid repetition.

[0235] It should be understood that the preferred embodiments of the present application are described in detail above in combination with the drawings, but the present application is not limited to the specific details in the above embodiments. Within the technical concept range of the present application, various simple modifications can be made to the technical solutions of the present application, and these simple modifications all belong to the protection range of the present application.

[0236] For example, various specific technical features described in the above specific embodiments can be combined in any appropriate manner without contradiction, and various possible combination manners are not described again in the present application to avoid unnecessary repetition. For another example, various different embodiments of the present application can also be combined in any manner, as long as it does not deviate from the idea of the present application, and it should also be considered as disclosed content of the present application.

[0237] For example, in order to reduce the convergence difficulty, a teacher-forcing strategy can be used to train the model.

[0238] It is worth noting that there are two training modes for RNN, namely free-running mode and teacher-forcing mode. The free-running mode refers to the output of the previous state as the input of the next state. The working principle of the teacher-forcing mode is that at time t in the training process, the expected output or the actual output y(t) of the training data set is used as the input x(t+1) of the next time step, instead of the output h(t) generated by the model.

[0239] For another example, after pre-training based on the basic graph dictionary, fine-tuning can be performed on the benchmark data set.

[0240] For another example, the hyperparameters in the reverse reaction prediction model can be adjusted, such as the number of layers of GNN and GRU.

[0241] It should also be understood that in various method embodiments of the present application, the size of the sequence number of the above processes does not mean the order of execution, and the execution order of the processes should be determined according to their functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0242] The above describes the method provided by the embodiments of the present application, and the following describes the device provided by the embodiments of the present application.

[0243] Figure 6 is a schematic block diagram of the reactant molecule prediction device 400 provided by the embodiments of the present application.

[0244] As shown in Figure 7 , the reactant molecule prediction device 400 can include:

[0245] The extraction unit 410 is configured to perform feature extraction on the product molecule to obtain the features of the product molecule.

[0246] The prediction unit 420 is configured to use a reverse reaction prediction model to predict the conversion path between the product molecule and a plurality of reactant molecules based on the features of the product molecule, to obtain a target path; the target path includes an edit sequence and a synthon completion sequence; the edit sequence is a sequence formed by edit actions, and the synthon completion sequence is a sequence formed by synthon completion actions.

[0247] The editing unit 430 is configured to edit the editing object according to the edited state indicated by each editing action in the editing sequence, to obtain a plurality of synthesis of the product molecule; the editing object is an atom or a chemical bond in the product molecule;

[0248] The adding unit 440 is configured to, for each synthesis in the plurality of synthesis, based on at least one synthesis completion action corresponding to the each synthesis in the synthesis completion sequence, add a basic graph indicated by each synthesis completion action in the at least one synthesis completion action according to the interface atom indicated by the each synthesis completion action, to obtain a plurality of reactant molecules corresponding to the plurality of synthesis; the basic graph includes a plurality of atoms or edges for connecting atoms.

[0249] In some embodiments, the prediction unit 420 is specifically configured to:

[0250] obtain the input feature of the t th action based on the t-1 th action predicted by the reverse reaction prediction model;

[0251] predict the t th action based on the input feature corresponding to the t th action and the hidden feature corresponding to the t th action, until the action predicted by the reverse reaction prediction model is a synthesis completion action and all attached atoms on the plurality of synthesis and all attached atoms on the basic graph added for the plurality of synthesis have been traversed, to obtain the target path;

[0252] The hidden feature of the t th action is related to the action predicted by the reverse reaction prediction model before the t th action.

[0253] In some embodiments, the prediction unit 420 is specifically configured to:

[0254] obtain the k first prediction results with the highest scores from the prediction results of the t-1 th action according to the beam search mode of the hyperparameter k;

[0255] determine the k first input features corresponding to the t th action based on the k first prediction results;

[0256] The target path is obtained by:

[0257] predict the t th action based on each of the k first input features and the hidden feature corresponding to the t th action, and obtain the k second prediction results with the highest scores from the 2k prediction results predicted according to the beam search mode of the hyperparameter k;

[0258] determine the k second input features corresponding to the t+1 th action based on the k second prediction results;

[0259] based on the hidden feature corresponding to each of the k second input features and the (t+1)th action, predicting the (t+1)th action until the action predicted by the inverse reaction prediction model is the synthetic complement action and all the attached atoms on the plurality of synthetic and the attached atoms on the basic graph added for the plurality of synthetic are traversed, obtaining the target path.

[0260] In some embodiments, the prediction unit 420 is specifically configured to:

[0261] If the (t-1)th action is the editing action, determining the input feature of the tth action based on the feature of the subgraph obtained by editing using the (t-1)th action, and predicting the editing object and the edited state indicated by the tth action using the inverse reaction prediction model based on the input feature of the tth action and the hidden feature of the tth action until the action predicted by the inverse reaction prediction model is the optimal editing action in the editing sequence, obtaining the editing sequence.

[0262] If the (t-1)th action is the last editing action or the synthetic complement action, determining the input feature of the tth action based on the feature of the subgraph obtained by editing using the (t-1)th action and the feature of the attached atom corresponding to the (t-1)th action, and predicting the basic graph and the interface atom indicated by the tth action based on the input feature of the tth action and the hidden feature of the tth action; until the action predicted by the inverse reaction prediction model is the synthetic complement action and all the attached atoms on the plurality of synthetic and the attached atoms on the basic graph added for the plurality of synthetic are traversed, obtaining the synthetic complement sequence.

[0263] In some embodiments, the editing action is characterized by the following label table: an action label for indicating editing, a label for indicating the editing object, and a label for indicating the edited state; and the synthetic complement action is characterized by the following label table: an action label for indicating synthetic complement, a label for indicating the basic graph, and a label for indicating the interface atom.

[0264] In some embodiments, if the editing object indicated by the editing action is an atom, the edited state indicated by the editing action is to change the number of charges on the atom or change the number of hydrogen atoms on the atom; and if the editing object indicated by the editing action is a chemical bond, the edited state indicated by the editing action is any one of the following: adding a chemical bond, deleting a chemical bond, and changing the type of a chemical bond.

[0265] Figure 7 is a schematic block diagram of a training device 500 of an inverse reaction prediction model provided by an embodiment of the present application.

[0266] like Figure 8 As shown, the training device 500 for the reverse reaction prediction model may include:

[0267] An extraction unit 510 is used to extract features of the product molecules to obtain features of the product molecules;

[0268] A prediction unit 520 is configured to predict the conversion path from the product molecule to multiple reactant molecules based on the characteristics of the product molecule and using a reverse reaction prediction model to obtain a target path;

[0269] The target path includes an edit sequence and a synthon completion sequence; each edit action in the edit sequence is used to indicate an edit object and an edited state, and the edit object is an atom or chemical bond in the product molecule; for multiple synthons of the product molecule obtained using the edit sequence, the synthon completion sequence includes at least one synthon completion action corresponding to each synthon in the multiple synthons, and each synthon completion action in the at least one synthon completion action is used to indicate a basic graph and an interface atom; the basic graph includes multiple atoms or edges for connecting atoms;

[0270] The training unit 530 is configured to train the reverse reaction prediction model based on the loss between the target path and the training path.

[0271] In some embodiments, before obtaining the target path, the prediction unit 520 is configured to:

[0272] Obtaining candidate reactant molecules corresponding to the product molecules;

[0273] Obtaining a basic graph dictionary by comparing the molecular structures of the product molecule and the candidate reactant molecule;

[0274] Based on the basic graph dictionary, the training path is obtained.

[0275] In some embodiments, the prediction unit 520 is specifically configured to:

[0276] Constructing a connection tree based on the basic graph dictionary; the connection tree includes a tree structure with the multiple synthesizers as root nodes and the basic graphs in the basic graph dictionary as child nodes;

[0277] By traversing the connection tree, the shortest path is determined as the training path.

[0278] In some embodiments, the prediction unit 520 is specifically configured to:

[0279] Determining the molecular fragments of the candidate reactant other than the multiple synthons as multiple candidate subgraphs;

[0280] if the first candidate subgraph in the plurality of candidate subgraphs comprises a first atom and a second atom, and the first atom and the second atom belong to different rings, then breaking a chemical bond between the first atom and the second atom to obtain a plurality of first subgraphs;

[0281] if the second candidate subgraph in the plurality of candidate subgraphs comprises a third atom and a fourth atom connected to each other, one of the third atom and the fourth atom belongs to a ring, and the other of the third atom and the fourth atom has a degree greater than or equal to a preset value, then breaking a chemical bond between the third atom and the fourth atom to obtain a plurality of second subgraphs;

[0282] determining the candidate subgraphs in the plurality of candidate subgraphs except the first candidate subgraph and the second candidate subgraph, the plurality of first subgraphs, and the plurality of second subgraphs as the basic graphs in the basic graph dictionary.

[0283] In some embodiments, before training the inverse reaction prediction model based on the loss between the target path and the training path, the training unit 530 is further configured to:

[0284] determine the loss between the target path and the training path based on the following information:

[0285] a difference between a label of the predicted action in the target path and a label of the training action in the training path, a difference between a score of an edited object corresponding to the predicted action and a score of an edited object corresponding to the training action, a difference between an edited state corresponding to the predicted action and an edited state corresponding to the training action, a difference between a basic graph indicated by the predicted action and a basic graph indicated by the training action, and a difference between an interface atom indicated by the predicted action and an interface atom indicated by the training action.

[0286] It should be understood that the device embodiments and the method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, no longer described here. Specifically, the prediction device 400 of the reactant molecule can correspond to the corresponding subject performing the method 200 of the embodiments of the present application, and each unit in the prediction device 400 is respectively for realizing the corresponding process in the method 200; similarly, the training device 500 of the inverse reaction prediction model can correspond to the corresponding subject performing the method 300 of the embodiments of the present application, and each unit in the training device 500 is respectively for realizing the corresponding process in the method 300; for the sake of brevity, no longer described here.

[0287] It should also be understood that each unit in the prediction device 400 or the training device 500 involved in the embodiments of the present application can be combined into one or several other units respectively or entirely, or some unit(s) therein can be further split into a plurality of units with smaller functions to constitute, which can achieve the same operation without affecting the implementation of the technical effects of the embodiments of the present application. The above units are divided based on logical functions, and in actual application, the function of one unit can also be implemented by a plurality of units, or the functions of a plurality of units can be implemented by one unit. In other embodiments of the present application, the prediction device 400 or the training device 500 can also include other units, and in actual application, these functions can also be assisted by other units, and can be implemented by a plurality of units in cooperation. According to another embodiment of the present application, the prediction device 400 or the training device 500 involved in the embodiments of the present application and the method of the embodiments of the present application can be constructed and implemented by running a computer program (including program codes) capable of executing each step involved in the corresponding method on a general computing device including processing elements and storage elements such as central processing units (CPUs), random access storage media (RAMs), read-only storage media (ROMs), etc. The computer program can be recorded on, for example, a computer readable storage medium, and loaded into an electronic device through the computer readable storage medium, and run therein to implement the corresponding method of the embodiments of the present application.

[0288] In other words, the units involved above can be implemented in the form of hardware, in the form of instructions of software, or in the form of combination of hardware and software. Specifically, each step of the method embodiments in the embodiments of the present application can be completed by integrated logic circuits and / or instructions of software in hardware in a processor, and the steps of the method disclosed in the embodiments of the present application can be directly embodied as hardware decoding processors for execution, or executed by combination of hardware and software in decoding processors. Alternatively, the software can be located in mature storage media in the art such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, register, etc. The storage media are located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiments in combination with the hardware thereof.

[0289] Figure 8 is a schematic structural diagram of the electronic device 600 provided by the embodiments of the present application.

[0290] As Figure 8As shown, the electronic device 600 at least includes a processor 610 and a computer readable storage medium 620. The processor 610 and the computer readable storage medium 620 can be connected by a bus or other means. The computer readable storage medium 620 is configured to store a computer program 621, and the computer program 621 includes computer instructions. The processor 610 is configured to execute the computer instructions stored in the computer readable storage medium 620. The processor 610 is a computing core and a control core of the electronic device 600, and is suitable for implementing one or more computer instructions, and is particularly suitable for loading and executing one or more computer instructions to implement a corresponding method flow or a corresponding function.

[0291] As an example, the processor 610 can also be referred to as a central processing unit (CPU). The processor 610 can include, but is not limited to, a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic component, a discrete hardware component, and the like.

[0292] By way of example, computer-readable storage media 620 can be RAM. Additionally or alternatively, computer-readable storage media 620 can be non-volatile memory, such as at least one disk storage device; optionally, computer-readable storage media 620 can be remotely located from processor 610. Specifically, computer-readable storage media 620 includes, but is not limited to, volatile and / or non-volatile memory. Non-volatile memory can be, for example, read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically EPROM (EEPROM), or flash memory. Volatile memory can be, for example, random access memory (RAM), which acts as external cache. By way of example, and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DR RAM). Of course, the disclosure is not limited in this regard - but rather, computer-readable storage media 620 can be any medium that can be used to store digital information.

[0293] As shown in FIG. 6, the electronic device 600 can further include a transceiver 630. Figure 1

[0294] The processor 610 can control the transceiver 630 to communicate with other devices, specifically, can transmit information or data to other devices, or receive information or data transmitted by other devices. The transceiver 630 can include a transmitter and a receiver. The transceiver 630 can further include an antenna, and the number of antennas can be one or more.

[0295] It should be understood that various components in the communication device 600 are connected through a bus system, wherein the bus system includes, in addition to a data bus, a power supply bus, a control bus, and a status signal bus.

[0296] ​In an implementation manner, the electronic device 600 can be any electronic device with data processing capability; the computer readable storage medium 620 stores first computer instructions; the first computer instructions stored in the computer readable storage medium 620 are loaded and executed by the processor 610 to implement ​ the corresponding steps in the method embodiments shown in the method embodiments; in a specific implementation, the first computer instructions in the computer readable storage medium 620 are loaded and executed by the processor 610 to implement the corresponding steps, to avoid repetition, which will not be described here.

[0297] According to another aspect of the present application, the embodiments of the present application also provide a computer readable storage medium (Memory), which is a memory device in the electronic device 600, used to store programs and data. For example, the computer readable storage medium 620. It can be understood that the computer readable storage medium 620 here can include the built-in storage medium in the electronic device 600, and of course can also include the expansion storage medium supported by the electronic device 600. The computer readable storage medium provides a storage space, which stores the operating system of the electronic device 600. And in the storage space, one or more computer instructions suitable for being loaded and executed by the processor 610 are also stored, and these computer instructions can be one or more computer programs 621 (including program codes).

[0298] According to another aspect of the present application, the embodiments of the present application also provide a computer program product or computer program, which includes computer instructions stored in a computer readable storage medium. For example, the computer program 621. At this time, the data processing device 600 can be a computer, the processor 610 reads the computer instructions from the computer readable storage medium 620, and the processor 610 executes the computer instructions to make the computer execute the methods provided in the various optional manners.

[0299] In other words, when implemented using software, the functions can be implemented in whole or in part using one or more computer programs that include one or more sets of instructions executable by a computer. When the computer program is loaded into the computer and executed, it can run the flowcharts or processes of the embodiments of the present application or implement the functions of the embodiments of the present application. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer program can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, from a website site, a computer, a server, or a data center to another website site, a computer, a server, or a data center through wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) means.

[0300] Those skilled in the art can realize that the units and flow steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware, or in a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0301] Finally, it should be noted that the above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method of predicting a reactant molecule, characterized by, The method comprises: characteristic extraction is performed on a product molecule to obtain a characteristic of the product molecule; a reverse reaction prediction model is used to predict a conversion path between the product molecule and a plurality of reactant molecules based on the characteristic of the product molecule, to obtain a target path; the target path comprises an editing sequence and a synthon completion sequence; each editing object indicated by each editing action in the editing sequence is edited according to an edited state indicated by the editing action, to obtain a plurality of synthons corresponding to the product molecule; the editing object is an atom or a chemical bond in the product molecule; for each synthon in the plurality of synthons, at least one synthon completion action corresponding to the synthon in the synthon completion sequence is used to add a basic graph indicated by each synthon completion action in the synthon completion action to an interface atom indicated by the synthon completion action, to obtain a plurality of reactant molecules corresponding to the plurality of synthons; the basic graph comprises a plurality of atoms or edges for connecting atoms.

2. The method of claim 1, wherein, The method comprises: input features of a tth action are obtained based on a (t-1)th action predicted by the reverse reaction prediction model; the tth action is predicted based on the input features corresponding to the tth action and hidden features corresponding to the tth action, until the action predicted by the reverse reaction prediction model is a synthon completion action and all attached atoms on the plurality of synthons and the basic graph added for the plurality of synthons have been traversed, to obtain the target path; wherein the hidden features of the tth action are related to actions predicted by the reverse reaction prediction model before the tth action.

3. The method of claim 2, wherein, The method comprises: k first prediction results with the highest scores are obtained from prediction results of the (t-1)th action in a beam search manner according to a hyperparameter k; k first input features corresponding to the tth action are determined based on the k first prediction results; wherein the target path is obtained by: each of the k first input features and the hidden features corresponding to the tth action are used to predict the tth action, and k second prediction results with the highest scores are obtained from 2k prediction results in a beam search manner according to the hyperparameter k; k second input features corresponding to a (t+1)th action are determined based on the k second prediction results. predicting the (t+1)th action based on the hidden feature corresponding to each of the k second input features and the (t+1)th action until the action predicted by the inverse reaction prediction model is the synthetic complement action and all the attached atoms on the plurality of synthetic complements and all the attached atoms on the basic graph added for the plurality of synthetic complements have been traversed, to obtain the target path.

4. The method of claim 2, wherein, The obtaining the target path comprises: if the (t-1)th action is the editing action, determining the input feature of the tth action based on the feature of the subgraph obtained by editing using the (t-1)th action, and predicting the editing object and the edited state indicated by the tth action using the inverse reaction prediction model based on the input feature of the tth action and the hidden feature of the tth action until the action predicted by the inverse reaction prediction model is the last editing action in the editing sequence, to obtain the editing sequence; if the (t-1)th action is the last editing action or the synthetic complement action, determining the input feature of the tth action based on the feature of the subgraph obtained by editing using the (t-1)th action and the feature of the attached atom corresponding to the (t-1)th action, and predicting the basic graph and the interface atom indicated by the tth action based on the input feature of the tth action and the hidden feature of the tth action until the action predicted by the inverse reaction prediction model is the synthetic complement action and all the attached atoms on the plurality of synthetic complements and on the basic graph added for the plurality of synthetic complements have been traversed, to obtain the synthetic complement sequence.

5. The method according to any one of claims 1 to 4, characterized in that, The editing action is characterized by the following labels: an action label indicating editing, a label indicating an editing object, and a label indicating an edited state; and the synthetic complement action is characterized by the following labels: an action label indicating synthetic complement, a label indicating a basic graph, and a label indicating an interface atom.

6. The method according to any one of claims 1 to 4, characterized in that, If the editing object indicated by the editing action is an atom, the edited state indicated by the editing action is to change the number of charges on the atom or the number of hydrogen atoms on the atom; if the editing object indicated by the editing action is a chemical bond, the edited state indicated by the editing action is any one of the following: adding a chemical bond, deleting a chemical bond, and changing the type of a chemical bond. 7.A method for training a reverse reaction prediction model, characterized in that, The method comprises: extracting features of a product molecule to obtain features of the product molecule; based on the features of the product molecule, using an inverse reaction prediction model to predict a conversion path between the product molecule and a plurality of reactant molecules to obtain a target path; The target path includes an editing sequence and a synthon completion sequence; each editing action in the editing sequence is used to indicate an editing object and an edited state, the editing object being an atom or a chemical bond in the product molecule; the synthon completion sequence includes at least one synthon completion action corresponding to each synthon in the plurality of synths obtained by using the editing sequence, each synthon completion action being used to indicate a basic graph and an interface atom, a plurality of reactant molecules corresponding to the plurality of synths being obtained by adding the basic graph indicated by each synthon completion action to the interface atom indicated by the synthon completion action; the basic graph includes a plurality of atoms or edges connecting the atoms; The reverse reaction prediction model is trained based on a loss between the target path and the training path.

8. The method of claim 7, wherein, Before the target path is obtained, the method further includes: obtaining a candidate reactant molecule corresponding to the product molecule; obtaining a basic graph dictionary by comparing the molecular structures of the product molecule and the candidate reactant molecule; obtaining the training path based on the basic graph dictionary.

9. The method of claim 8, wherein, The obtaining of the training path based on the basic graph dictionary includes: constructing a connection tree based on the basic graph dictionary; the connection tree includes a tree structure with the plurality of synths as root nodes and the basic graphs in the basic graph dictionary as child nodes; determining a shortest path as the training path by traversing the connection tree.

10. The method of claim 8, wherein, The obtaining of the basic graph dictionary by comparing the molecular structures of the product molecule and the candidate reactant molecule includes: determining molecular fragments other than the plurality of synths in the candidate reactant as a plurality of candidate subgraphs; if a first candidate subgraph in the plurality of candidate subgraphs includes a first atom and a second atom, and the first atom and the second atom belong to different rings, then breaking a chemical bond between the first atom and the second atom to obtain a plurality of first subgraphs; if a second candidate subgraph in the plurality of candidate subgraphs includes a third atom and a fourth atom connected to each other, one of the third atom and the fourth atom belongs to a ring, and the other of the third atom and the fourth atom has a degree greater than or equal to a preset value, then breaking a chemical bond between the third atom and the fourth atom to obtain a plurality of second subgraphs; determining candidate subgraphs other than the first candidate subgraph and the second candidate subgraph in the plurality of candidate subgraphs, the plurality of first subgraphs, and the plurality of second subgraphs as basic graphs in the basic graph dictionary.

11. The method according to any one of claims 7 to 10, characterized in that, Before the reverse reaction prediction model is trained based on the loss between the target path and the training path, the method further includes: determining the loss between the target path and the training path based on the following information: a difference between a label of the predicted action in the target path and a label of a training action in a training path, a difference between a score of an editing object corresponding to the predicted action and a score of an editing object corresponding to the training action, a difference between an edited state corresponding to the predicted action and an edited state corresponding to the training action, a difference between a basic graph indicated by the predicted action and a basic graph indicated by the training action, and a difference between an interface atom indicated by the predicted action and an interface atom indicated by the training action.

12. A prediction device of a reactant molecule, characterized by, The method comprises: extracting features of a product molecule to obtain features of the product molecule; predicting, based on the features of the product molecule, a conversion path from the product molecule to a plurality of reactant molecules by using a reverse reaction prediction model to obtain a target path; the target path comprises an editing sequence and a synthon completion sequence; editing, according to an edited state indicated by each editing action in the editing sequence, an editing object of the editing action to obtain a plurality of synths corresponding to the product molecule; the editing object is an atom or a chemical bond in the product molecule; adding, for each synthon in the plurality of synths, based on at least one synthon completion action corresponding to the synthon in the synthon completion sequence, an interface atom in each synthon completion action to obtain a plurality of reactant molecules corresponding to the plurality of synths; the basic graph comprises a plurality of atoms or edges for connecting atoms. 13.A device for training a reverse reaction prediction model, comprising: The method comprises: extracting features of a product molecule to obtain features of the product molecule; predicting, based on the features of the product molecule, a conversion path from the product molecule to a plurality of reactant molecules by using a reverse reaction prediction model to obtain a target path; wherein the target path comprises an editing sequence and a synthon completion sequence; each editing action in the editing sequence is used to indicate an editing object and an edited state, and the editing object is an atom or a chemical bond in the product molecule; for a plurality of synths of the product molecule obtained by using the editing sequence, the synthon completion sequence comprises at least one synthon completion action corresponding to each synthon in the plurality of synths, each synthon completion action in the at least one synthon completion action is used to indicate a basic graph and an interface atom, and a plurality of reactant molecules corresponding to the plurality of synths are obtained by adding a basic graph indicated by each synthon completion action to an interface atom indicated by the synthon completion action; the basic graph comprises a plurality of atoms or edges for connecting atoms; training the reverse reaction prediction model based on a loss between the target path and a training path.

14. An electronic device, comprising: The method comprises: a processor adapted to execute a computer program; A computer readable storage medium having stored therein a computer program which, when executed by the processor, implements the method of predicting a reactant molecule as claimed in any one of claims 1 to 6 or the method of training a reverse reaction prediction model as claimed in any one of claims 7 to 11.

15. A computer readable storage medium characterized by: A computer program for storing which causes a computer to execute the method of predicting a reactant molecule as claimed in any one of claims 1 to 6 or the method of training a reverse reaction prediction model as claimed in any one of claims 7 to 11.

16. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instructions, when executed by the processor, implement the method of predicting a reactant molecule as claimed in any one of claims 1 to 6 or the method of training a reverse reaction prediction model as claimed in any one of claims 7 to 11.