ACS Spring 2023

Standardization of chemical compounds using language modeling


With the growing amount of chemical data stored digitally, it has become crucial to represent chemical compounds consistently. Harmonized representations facilitate the extraction of insightful information from datasets, and are advantageous for machine learning applications, where structural errors and inconsistencies lead to losses in the models' predictive abilities. Compound standardization is typically accomplished using rule-based algorithms that modify undesirable descriptions of functional groups, resulting in a consistent format throughout the dataset. Manually crafted and coded rules have inherent disadvantages, the most notable of which are the needs for programming expertise and time resources. Even more importantly, it is not always possible to develop a set of rules to automate chosen modifications. Here, we present the first deep-learning model for molecular standardization. We enable custom schemes based solely on data, which also support standardization options that are difficult to encode in rules. The model can learn multiple popular standardization procedures simultaneously with accuracies > 95%, allowing the user to query it in a prompt-based fashion and select the preferred standardization practice. We also leverage a pre-trained model to fine-tune it on a small dataset of catalysts, where formatting possibilities are numerous and the standardization process cannot be reduced to a set of rules. The model can capture commonalities in molecular structure representation and predicts the preferred modifications with an average test accuracy of 62%. We show that our model learns not only the grammar and syntax of molecular representations, but also the details of atom ordering, types of bonds, and display of charged species.