A method and device for generating conditional molecules based on attribute values
Patent Information
- Application Number
- CN202410968604.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-07-19
AI Technical Summary
[0003]目前,条件分子生成作为前沿的AI理念,其可以建立分子性质与分子之间的关联关系,然后在现有关系的基础上产生分子;此类方法稀有并且没有从头开始生成分子的方法论
[0026] The present invention has the following advantages: it collects smiles molecular expressions by specifying a public database, performs deduplication processing on the collected smiles molecular expressions, and obtains a molecular data set; and calculates each smiles molecular expression in the molecular data set. , obtain the same molecular expression for each smiles attribute value of a property; combine each smiles molecule expression and the corresponding attribute value according to the set form to construct a new molecule; collect the new molecules to form a new data set, and combine the new molecules The data set is divided into a training set and a verification set according to the set proportion; the conditional attribute values of the new molecules are recoded, Complete the conditional attribute token design process of the new molecule; construct a pre-training model based on the transformer model, train the pre-training model through the training set, the verification set and the cross-entropy loss function, and obtain the trained Pre-training model; according to the set attribute values, the trained model The pre-training model generates the first token; re-enter the first token and the set attribute value into the trained pre-training model to obtain the second token; the trained The pre-trained model is generated repeatedly and iteratively until the terminator is generated, the generation is stopped, and the conditional numerator is obtained. The present invention generates smiles molecular expressions from scratch based on attribute values, which provides a new idea for the field of molecule generation. By setting attribute conditions, the accuracy of generated molecules is improved, and the efficiency of generating molecules is greatly improved.
Smart Images

Figure CN118506901B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of conditional molecule generation, and in particular to a method and device for conditional molecule generation based on attribute values. Background Art
[0002] The discovery of new molecules has always been a difficult and time-consuming task in the chemical industry. Traditional methods often require experienced chemists to search for new molecules from a vast chemical space based on chemical reaction mechanisms, resulting in a large consumption of manpower and material resources. However, with the rapid advancement of advanced AI technologies such as deep learning, the field of chemical molecule research and development is increasingly being profoundly influenced by AI. The integration of AI technology not only opens up new avenues of innovation for chemical researchers, but also provides them with efficient solutions. The assistance of AI has significantly accelerated the speed of molecular research and development and effectively reduced research and development costs. It provides chemical researchers with more diverse options, thereby promoting breakthrough progress in the field of chemical molecule research and development.
[0003] Currently, conditional molecule generation is a cutting-edge AI concept that can establish correlations between molecular properties and molecules, and then generate molecules based on existing relationships; such methods are rare and there is no methodology for generating molecules from scratch.
[0004] Therefore, designing a method to generate smile molecular expressions from scratch based on attribute values is another new idea in the field of molecular generation and has great application value. Summary of the invention
[0005] To this end, the present invention provides a conditional molecule generation method and device based on attribute values. The method generates SMILES molecular expressions from scratch according to the attribute values, providing a new idea for the field of molecule generation. By setting attribute conditions, the accuracy of generated molecules is improved, and the efficiency of generated molecules is greatly improved.
[0006] In order to achieve the above object, the present invention provides the following technical solution: a conditional molecule generation method based on attribute values, comprising:
[0007] Smiles molecular expressions are collected through a designated public database, and the collected Smiles molecular expressions are deduplicated to obtain a molecular data set; each Smiles molecular expression in the molecular data set is calculated to obtain an attribute value of the same property of each Smiles molecular expression; each Smiles molecular expression and the corresponding attribute value are combined in a set form to construct a new molecule; the new molecules are collected to form a new data set, and the new data set is divided into a training set and a validation set according to a set ratio;
[0008] Re-encode the conditional attribute value of the new molecule to complete the conditional attribute token design process of the new molecule;
[0009] Constructing a pre-trained model according to the transformer model, training the pre-trained model through the training set, the validation set and the cross entropy loss function to obtain a trained pre-trained model;
[0010] According to the set attribute value, a first token mark is generated through the trained pre-trained model; the first token mark and the set attribute value are re-input into the trained pre-trained model to obtain a second token mark; the trained pre-trained model is repeatedly iterated until a terminator is generated, and the generation is stopped to obtain a conditional molecule.
[0011] As a preferred scheme of a conditional molecule generation method based on attribute values, in the process of combining each smiles molecular expression and the corresponding attribute value in a set format to construct a new molecule, the set format is: "<attribute name> attribute value|smiles".
[0012] As a preferred solution of a conditional molecule generation method based on attribute values, in the process of dividing the new data set into a training set and a validation set according to a set ratio, the set ratio is 9:1.
[0013] As a preferred solution of the conditional molecule generation method based on attribute values, in the process of re-encoding the conditional attribute value of the new molecule, the conditional attribute value of the new molecule is "<attribute name> attribute value|", and "<attribute name>" and "|" in the conditional attribute value of the new molecule are separately encoded as token marks;
[0014] The attribute value in the conditional attribute value of the new molecule is encoded in the format of "_A_B", wherein A is a number and B is the number of decimal places of number A.
[0015] As a preferred scheme of the conditional molecule generation method based on attribute values, in the process of training the pre-trained model, the new molecule is split, the "<attribute name>attribute value|" part of the new molecule is defined as the conditional part, and the smiles molecular expression of the new molecule is defined as the molecular part; the conditional part token mark and the molecular part token mark of the new molecule are encoded respectively, and the conditional part information is attached to the molecular part information to obtain a coding matrix; the coding matrix is input into the pre-trained model, and the molecular code is output.
[0016] The present invention also provides a conditional molecule generation device based on attribute values, based on the above conditional molecule generation method based on attribute values, comprising:
[0017] A new molecule construction and data set processing module is used to collect smiles molecular expressions through a designated public database, deduplicate the collected smiles molecular expressions, and obtain a molecular data set; calculate each smiles molecular expression in the molecular data set to obtain the attribute value of the same property of each smiles molecular expression; combine each smiles molecular expression and the corresponding attribute value in a set form to construct a new molecule; collect the new molecules to form a new data set, and divide the new data set into a training set and a validation set according to a set ratio;
[0018] A new molecule conditional attribute token design processing module, used to re-encode the conditional attribute value of the new molecule to complete the conditional attribute token design processing of the new molecule;
[0019] A pre-training model construction and training module is used to construct a pre-training model according to the transformer model, train the pre-training model through the training set, the validation set and the cross entropy loss function, and obtain the trained pre-training model;
[0020] The conditional molecule generation module is used to generate a first token mark through the trained pre-trained model according to the set attribute value; re-input the first token mark and the set attribute value into the trained pre-trained model to obtain a second token mark; the trained pre-trained model is repeatedly iterated until a terminator is generated, and the generation is stopped to obtain a conditional molecule.
[0021] As a preferred solution of a conditional molecule generation device based on attribute values, in the new molecule construction and data set processing module, in the process of combining each smiles molecular expression and the corresponding attribute value in a set format to construct a new molecule, the set format is: "<attribute name> attribute value|smiles".
[0022] As a preferred solution of the conditional molecule generation device based on attribute values, in the new molecule construction and data set processing module, in the process of dividing the new data set into a training set and a validation set according to a set ratio, the set ratio is 9:1.
[0023] As a preferred solution of the conditional molecule generation device based on attribute values, in the new molecule conditional attribute token mark design processing module, in the process of re-encoding the conditional attribute value of the new molecule, the conditional attribute value of the new molecule is "<attribute name> attribute value|", and the "<attribute name>" and "|" in the conditional attribute value of the new molecule are separately encoded as token marks;
[0024] The attribute value in the conditional attribute value of the new molecule is encoded in the format of "_A_B", wherein A is a number and B is the number of decimal places of number A.
[0025] As a preferred solution of a conditional molecule generation device based on attribute values, in the pre-training model construction and training module, during the training of the pre-training model, the new molecule is split, the "<attribute name>attribute value|" part of the new molecule is defined as the conditional part, and the smiles molecular expression of the new molecule is defined as the molecular part; the conditional part token mark and the molecular part token mark of the new molecule are encoded respectively, and the conditional part information is attached to the molecular part information to obtain a coding matrix; the coding matrix is input into the pre-training model, and the molecular code is output.
[0026] The present invention has the following advantages: collecting smiles molecular expressions through a designated public database, deduplicating the collected smiles molecular expressions, and obtaining a molecular data set; calculating each smiles molecular expression in the molecular data set, and obtaining the attribute value of the same property of each smiles molecular expression; combining each smiles molecular expression and the corresponding attribute value in a set form to construct a new molecule; collecting the new molecules to form a new data set, and dividing the new data set into a training set and a verification set according to a set ratio; re-encoding the conditional attribute values of the new molecules, and completing the design and processing of the conditional attribute token mark of the new molecules; constructing a pre-trained model according to a transformer model, training the pre-trained model through the training set, the verification set and the cross entropy loss function, and obtaining a trained pre-trained model; generating a first token mark through the trained pre-trained model according to the set attribute value; re-inputting the first token mark and the set attribute value into the trained pre-trained model to obtain a second token mark; the trained pre-trained model is repeatedly iterated and generated until a terminator is generated, and the generation is stopped to obtain a conditional molecule. The present invention generates smiles molecular expressions from scratch according to attribute values, providing a new idea for the field of molecule generation. By setting attribute conditions, the accuracy of generated molecules is improved, and the efficiency of generated molecules is greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.
[0028] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.
[0029] Figure 1 A schematic flow chart of a conditional molecule generation method based on attribute values provided in Example 1 of the present invention;
[0030] Figure 2 A schematic diagram of a conditional molecule generation process in a possible embodiment provided in Example 1 of the present invention;
[0031] Figure 3 This is a schematic diagram of the architecture of a conditional molecule generation device based on attribute values provided in Example 2 of the present invention. DETAILED DESCRIPTION
[0032] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] Example 1
[0034] See also Figure 1 Embodiment 1 of the present invention provides a conditional molecule generation method based on attribute values, comprising the following steps:
[0035] S1. Collect smile molecular expressions through a designated public database, remove duplicates from the collected smile molecular expressions to obtain a molecular data set; calculate each smile molecular expression in the molecular data set to obtain the attribute value of the same property of each smile molecular expression; combine each smile molecular expression and the corresponding attribute value in a set form to construct a new molecule; collect the new molecules to form a new data set, and divide the new data set into a training set and a validation set according to a set ratio;
[0036] S2, re-encoding the conditional attribute value of the new molecule to complete the conditional attribute token design process of the new molecule;
[0037] S3, constructing a pre-trained model according to the transformer model, training the pre-trained model through the training set, the validation set and the cross entropy loss function, and obtaining a trained pre-trained model;
[0038] S4. Generate a first token through the trained pre-trained model according to the set attribute value; re-input the first token and the set attribute value into the trained pre-trained model to obtain a second token; the trained pre-trained model is repeatedly iterated until a terminator is generated, and the generation is stopped to obtain a conditional numerator.
[0039] In this embodiment, in step S1, in the process of combining each smiles molecular expression and the corresponding attribute value in a set format to construct a new molecule, the set format is: "<attribute name> attribute value|smiles". In the process of dividing the new data set into a training set and a validation set in a set ratio, the set ratio is 9:1.
[0040] In this embodiment, in step S2, in the process of re-encoding the conditional attribute value of the new molecule, the conditional attribute value of the new molecule is "<attribute name> attribute value|", and the "<attribute name>" and "|" in the conditional attribute value of the new molecule are separately encoded as token marks; the attribute value in the conditional attribute value of the new molecule is encoded in the format of "_A_B", wherein A is a number and B is the number of decimal places of number A.
[0041] In this embodiment, in step S3, during the training of the pre-trained model, the new molecule is split, the "<attribute name>attribute value|" part of the new molecule is defined as the conditional part, and the smiles molecular expression of the new molecule is defined as the molecular part; the conditional part token flag and the molecular part token flag of the new molecule are encoded respectively, and the conditional part information is attached to the molecular part information to obtain a coding matrix; the coding matrix is input into the pre-trained model, and the molecular code is output.
[0042] Specifically, first, split the new molecule (in the form of "<attribute name>attribute value|smiles"), define the "<attribute name>attribute value|" part as the conditional part, and define the smiles molecular expression as the molecular part; encode the conditional part token and the molecular part token respectively, then append the conditional part information to the molecular part information and input the final result into the transformer model to obtain the molecular encoding output. Secondly, use the cross entropy loss to calculate the loss value between the molecular encoding output and the correct smiles molecular expression, and use back propagation to update the transformer model parameters. Finally, when the transformer model has been trained for multiple rounds and the loss tends to be stable, save the current transformer model and name it V1.
[0043] In this embodiment, in step S4, the pre-trained model V1 is read in, and the condition "<attribute name> attribute value|" is given, and the first token mark is generated through the pre-trained model V1; the first token mark and the set attribute value are re-input into the pre-trained model V1 to obtain the second token mark; the pre-trained model V1 is repeatedly iterated and generated until a terminator is generated, and the generation is stopped to obtain the conditional molecule.
[0044] In a possible embodiment, a specific example of conditional molecule generation is provided as follows:
[0045] See also Figure 2 , the steps for conditional molecule generation based on attribute values are:
[0046] T1. Construction of new molecules and assembly and processing of data sets
[0047] Collect millions of unique molecular expressions smiles molecular expressions, calculate the attribute value of each smiles molecular expression, and then construct a new molecule according to "property name>attribute value|smiles". For example, the attribute is qed, and the qed value of NC1=NC(=O)N(CC=CCCl)C=C1 is 0.574. According to the above requirements, the new molecule is <qed>0.574|NC1=NC(=O)N(CC=CCCl)C=C1.
[0048] A new data set was constructed using new molecules and divided into a training set and a validation set in a ratio of 9:1.
[0049] T2. Token logo design with conditional attributes
[0050] The conditional attribute of the new molecule is "<attribute name> attribute value|". When designing a token, "<attribute name>" and "|" are used as a token respectively, and the attribute value is encoded in the form of _A_B_, where A is the value and B is the decimal point of A. Taking the qed value of 5.7 as an example, the value 5 is encoded as '_5_0_', where 5 is the value itself and 0 is the 0th decimal point of 5, that is, 10 0 , 5=5*10 0 ; 0.7 is encoded as '_7_-1_', where 7 is the value itself and -1 is the -1th decimal place of 7, which is 10 -1 , 0.7=7*10 -1 ; The decimal point '.' is encoded as '_._' and the minus sign '-' is encoded as '_-_'.
[0051] In summary, the conditional attribute " <qed>5.7|" is encoded as ' <qed>', '_5_0_', '_._', '_7_-1_', '|'.
[0052] T3. Build a pre-trained model and perform training
[0053] T31, the model uses the transformer architecture for pre-training tasks, and the parameters are set as follows: epoch is set to 50, batch_size is 128; the number of heads of Multi-Head Attention is 8; the maximum sequence length is 300; the optimizer uses adaptive Adam; dropout is set to 0.1; the parameter of the warm start method is set to 500; the loss function uses the cross entropy loss function;
[0054] T32, the transformer model uses the settings in step T31 to perform pre-training tasks. The main process is as follows: First, the new molecule (in the form of "<attribute name>attribute value|smiles") is split into two parts: the "<attribute name>attribute value|" part is defined as the conditional part, and the smiles molecular expression is defined as the molecular part; the conditional part and the molecular part are encoded as tokens respectively and mapped to a high-dimensional space; the conditional part information is compressed and then attached to the high-dimensional space corresponding to each molecular part to form a coding matrix;
[0055] T33. Input the encoding matrix of the fusion conditional part information and the molecular part information into the encoder part of the transformer, process it with multiple stacked self-attention layers and obtain the encoding representation. Pass the encoding representation to the decoder part to predict the molecular expression of the molecule smiles, and use the cross entropy loss function to calculate the loss between the predicted value and the true value of the molecular expression of the molecule smiles, and use back propagation to update the transformer model parameters. Finally, after multiple rounds of iterative training, when the loss value of the model tends to be stable, that is, the model performance is no longer significantly improved, we save the current Transformer model state and name it V1.
[0056] T4. Generate conditional molecules through pre-training model V1
[0057] First, read in the pre-trained model V1, give the condition "<attribute name> attribute value|", then the model generates the first token based on the given condition, and then sends the generated token and condition to the model again to generate the second token, and repeats until a terminator is generated, the model stops generating, and the conditional numerator is obtained.
[0058] In summary, the present invention collects smiles molecular expressions by specifying a public database, deduplicates the collected smiles molecular expressions, and obtains a molecular data set; calculates each smiles molecular expression in the molecular data set to obtain the attribute value of the same property of each smiles molecular expression; combines each smiles molecular expression and the corresponding attribute value in a set form to construct a new molecule; collects the new molecules to form a new data set, and divides the new data set into a training set and a validation set according to a set ratio; re-encodes the conditional attribute values of the new molecules to complete the design processing of the conditional attribute token mark of the new molecules; constructs a pre-trained model according to the transformer model, trains the pre-trained model through the training set, the validation set and the cross-entropy loss function to obtain the trained pre-trained model; generates a first token mark through the trained pre-trained model according to the set attribute value; re-inputs the first token mark and the set attribute value into the trained pre-trained model to obtain a second token mark; the trained pre-trained model is repeatedly iterated and generated until a terminator is generated, stops generating, and obtains the conditional molecule. The present invention generates smiles molecular expressions from scratch according to attribute values, providing a new idea for the field of molecule generation. By setting attribute conditions, the accuracy of generated molecules is improved, and the efficiency of generated molecules is greatly improved.
[0059] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.
[0060] It should be noted that some embodiments of the present disclosure are described above. In some cases, the actions or steps recorded can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0061] Example 2
[0062] See also Figure 3 Embodiment 2 of the present invention further provides a conditional molecule generation device based on attribute values, comprising:
[0063] The new molecule construction and data set processing module 001 is used to collect smiles molecular expressions through a designated public database, deduplicate the collected smiles molecular expressions, and obtain a molecular data set; calculate each smiles molecular expression in the molecular data set to obtain the attribute value of the same property of each smiles molecular expression; combine each smiles molecular expression and the corresponding attribute value in a set form to construct a new molecule; collect the new molecules to form a new data set, and divide the new data set into a training set and a validation set according to a set ratio;
[0064] A new molecule conditional attribute token design processing module 002 is used to recode the conditional attribute value of the new molecule to complete the conditional attribute token design processing of the new molecule;
[0065] The pre-training model construction and training module 003 is used to construct a pre-training model according to the transformer model, train the pre-training model through the training set, the validation set and the cross entropy loss function, and obtain the trained pre-training model;
[0066] The conditional molecule generation module 004 is used to generate a first token mark through the trained pre-trained model according to the set attribute value; re-input the first token mark and the set attribute value into the trained pre-trained model to obtain a second token mark; the trained pre-trained model is repeatedly iterated until a terminator is generated, and the generation is stopped to obtain a conditional molecule.
[0067] In this embodiment, in the new molecule construction and data set processing module 001, in the process of combining each smiles molecular expression and the corresponding attribute value in a set format to construct a new molecule, the set format is: "<attribute name> attribute value|smiles".
[0068] In this embodiment, in the new molecule construction and data set processing module 001, in the process of dividing the new data set into a training set and a validation set according to a set ratio, the set ratio is 9:1.
[0069] In this embodiment, in the new molecule conditional attribute token mark design processing module 002, in the process of re-encoding the conditional attribute value of the new molecule, the conditional attribute value of the new molecule is "<attribute name> attribute value|", and the "<attribute name>" and "|" in the conditional attribute value of the new molecule are separately encoded as token marks; the attribute value in the conditional attribute value of the new molecule is encoded in the format of "_A_B", wherein A is a number and B is the number of decimal places where the number A is located.
[0070] In this embodiment, in the pre-training model construction and training module 003, during the process of training the pre-training model, the new molecule is split, the "<attribute name> attribute value|" part of the new molecule is defined as the conditional part, and the smiles molecular expression of the new molecule is defined as the molecular part; the conditional part token mark and the molecular part token mark of the new molecule are encoded respectively, and the conditional part information is attached to the molecular part information to obtain a coding matrix; the coding matrix is input into the pre-training model, and the molecular code is output.
[0071] It should be noted that the information interaction, execution process and other contents between the modules of the above-mentioned system are based on the same concept as the method embodiment in Example 1 of the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown above in the present application, and will not be repeated here.
[0072] Example 3
[0073] Embodiment 3 of the present invention provides a non-transitory computer-readable storage medium, in which a program code for a conditional molecule generation method based on attribute values is stored, and the program code includes instructions for executing embodiment 1 or any possible implementation method of a conditional molecule generation method based on attribute values.
[0074] Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0075] Example 4
[0076] Embodiment 4 of the present invention provides an electronic device, including: a memory and a processor;
[0077] The processor and the memory communicate with each other via a bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute a conditional molecule generation method based on attribute values in Example 1 or any possible implementation thereof.
[0078] Specifically, the processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor can be a general-purpose processor implemented by reading software codes stored in a memory. The memory can be integrated in the processor or can be located outside the processor and exist independently.
[0079] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable systems. The computer instructions can be stored in a computer-readable storage medium, or transmitted from a computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center.
[0080] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing system, they can be concentrated on a single computing system, or distributed on a network composed of multiple computing systems, and optionally, they can be implemented by a program code executable by a computing system, so that they can be stored in a storage system and executed by the computing system, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0081] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.< / qed> < / qed> < / qed>
Claims
1. A conditional molecule generation method based on attribute values, characterized in that: include: Collect smile molecular expressions through a designated public database, perform deduplication processing on the collected smile molecular expressions, and obtain a molecular data set; Calculate each smiles molecular expression in the molecular data set to obtain the attribute value of the same property of each smiles molecular expression; combine each smiles molecular expression and the corresponding attribute value in a set form to construct a new molecule; Collecting the new molecules to form a new data set, and dividing the new data set into a training set and a validation set according to a set ratio; Re-encode the conditional attribute value of the new molecule to complete the conditional attribute token design process of the new molecule; Constructing a pre-trained model according to the transformer model, training the pre-trained model through the training set, the validation set and the cross entropy loss function to obtain a trained pre-trained model; According to the set attribute value, the first token mark is generated through the trained pre-trained model; Re-inputting the first token mark and the set attribute value into the trained pre-trained model to obtain a second token mark; the trained pre-trained model is repeatedly iterated until a terminator is generated, and the generation is stopped to obtain a conditional numerator; In the process of combining each smile molecular expression and the corresponding attribute value in a set format to construct a new molecule, the set format is: "<attribute name> attribute value|smiles"; In the process of re-encoding the conditional attribute value of the new molecule, the conditional attribute value of the new molecule is "<attribute name> attribute value|", and "<attribute name>" and "|" in the conditional attribute value of the new molecule are separately encoded as token marks; Encode the attribute value in the conditional attribute value of the new molecule in the format of "_A_B", where A is a number and B is the number of decimal places of number A; In the process of training the pre-trained model, the new molecule is split, the "<attribute name> attribute value|" part of the new molecule is defined as the conditional part, and the smiles molecular expression of the new molecule is defined as the molecular part; the conditional part token mark and the molecular part token mark of the new molecule are encoded respectively, and the conditional part information is attached to the molecular part information to obtain a coding matrix; The encoding matrix is input into the pre-trained model, and the molecular encoding is output.
2. A conditional molecule generation method based on attribute values according to claim 1, characterized in that: In the process of dividing the new data set into a training set and a validation set according to a set ratio, the set ratio is 9:
1.
3. A conditional molecule generation device based on attribute values, using any of the conditional molecule generation methods based on attribute values according to claims 1-2, characterized in that: include: A new molecule construction and data set processing module is used to collect smiles molecular expressions through a designated public database, deduplicate the collected smiles molecular expressions, and obtain a molecular data set; calculate each smiles molecular expression in the molecular data set to obtain the attribute value of the same property of each smiles molecular expression; combine each smiles molecular expression and the corresponding attribute value in a set form to construct a new molecule; Collecting the new molecules to form a new data set, and dividing the new data set into a training set and a validation set according to a set ratio; A new molecule conditional attribute token design processing module, used to re-encode the conditional attribute value of the new molecule to complete the conditional attribute token design processing of the new molecule; A pre-training model construction and training module is used to construct a pre-training model according to the transformer model, train the pre-training model through the training set, the validation set and the cross entropy loss function, and obtain the trained pre-training model; A conditional molecule generation module, used to generate a first token mark through the trained pre-trained model according to a set attribute value; Re-inputting the first token mark and the set attribute value into the trained pre-trained model to obtain a second token mark; the trained pre-trained model is repeatedly iterated until a terminator is generated, and the generation is stopped to obtain a conditional numerator; In the new molecule construction and data set processing module, in the process of combining each smiles molecular expression and the corresponding attribute value in a set format to construct a new molecule, the set format is: "<attribute name> attribute value|smiles"; In the new molecule conditional attribute token design processing module, in the process of re-encoding the conditional attribute value of the new molecule, the conditional attribute value of the new molecule is "<attribute name> attribute value|", and "<attribute name>" and "|" in the conditional attribute value of the new molecule are separately encoded as token marks; Encode the attribute value in the conditional attribute value of the new molecule in the format of "_A_B", where A is a number and B is the number of decimal places of number A; In the pre-training model construction and training module, in the process of training the pre-training model, the new molecule is split, the "<attribute name> attribute value|" part of the new molecule is defined as the conditional part, and the smiles molecular expression of the new molecule is defined as the molecular part; the conditional part token mark and the molecular part token mark of the new molecule are encoded respectively, and the conditional part information is attached to the molecular part information to obtain a coding matrix; The encoding matrix is input into the pre-trained model, and the molecular encoding is output.
4. The device for generating conditional molecules based on attribute values according to claim 3, characterized in that: In the new molecule construction and data set processing module, in the process of dividing the new data set into a training set and a validation set according to a set ratio, the set ratio is 9:1.
