MTS witch: A Web-based System for Translation between Molecules and Texts (2024)

Abstract: We introduce MTSwitch, a web-based system for the bidirectional translation between molecules and texts, leveraging various large language models (LLMs). It supports two crucial tasks, including molecule captioning (explaining the properties of a molecule) and molecule generation (designing a molecule based on specific properties). To the best of our knowledge, MTSwitch is currently the first accessible system that allows users to translate between molecular representations and descriptive text contents. The system and a screencast can be found in https://github.com/hanninaa/MTSwitch.

## introduction the advent of large language models (llms) has significantly transformed the landscape of natural language processing (nlp) @xcite . their superior language understanding, generation capabilities, and versatility have propelled their utility beyond conversations, now extending into various domains, including bio-medicine @xcite and molecular chemistry @xcite . this emerging trend, marked by many novel methods being proposed, highlights a promising new research direction @xcite . despite the progress made, using the existing models requires familiarisation with invoking the advanced models, which undoubtedly increases the burden on researchers who are not specialists in this field. consequently, designing an intuitive and userfriendly system for translating molecules and texts is imperative. in this paper, we design the first webbased system, named mtswitch (molecule-text switch), to translate between texts and molecules. as shown in figure 1 , mtswitch can translate molecules in smiles (simplified molecular input line entry system) format along with their ## system overview mtswitch offers a user-friendly platform for translation between molecules in smiles format and natural language, whose web interface is structured as two areas for input and output. as shown in figure 1 , users are prompted to first select an appropriate model (e.g. molt5 and meditron) and define their intended task when they access the platform, and then enter their input (either a smiles notation or a natural language text) in the text box on the left-hand side. upon submission, the system processes the user input, selects and executes the corresponding model for either molecule captioning or molecule generation, and exhibits the model output in the text box on the right-hand side. ## evaluation to evaluate the performance of mtswitch, we adopted the evaluation metrics introduced by @xcite , which had taken both semantic similarity in natural languages and fingerprint tanimoto similarity (fts) for molecules into account. rouge, bleu, and meteor are metrics for evaluating generation quality by measuring ngram overlap, precision with brevity penalties, and considering synonymy and stemming, respectively. maccs, rdk, and morgan are types of molecu-1 https://huggingface.co/ language-plus-molecules lar fingerprints that represent molecular structures as binary vectors, with maccs using predefined structural keys, rdk encoding specific molecular features, and morgan (ecfp) generating circular fingerprints by expanding atom environments. we sampled a subset from the validation set of the l+m-24 dataset and assessed the performance of all models across the two tasks. tables 1 and 2 highlight the model performance in molecular captioning and generation, respectively. meditron performs exceptionally well in most captioning metrics, particularly rouge-2 and bleu-2. while llama 3 performed well in rouge-2 and rouge-l, it underperformed in bleu-4 and meteor, indicating its potential coherence and lexical diversity issues in specific text generation tasks. for molecular generation, molt5 and meditron demonstrated superior performance across key indicators, highlighting their potential for advanced molecular design and synthesis prediction applications. the performances of these two models in our system closely aligned with their originally reported results @xcite . ## conclusion we introduced mtswitch, a novel and user-friendly web-based system for bidirectional translation between molecules and texts. leveraging llms, our system demonstrated superior performance, offering users an efficient platform for translating between molecular representations and textual descriptions seamlessly. in the future, we plan to incorporate more models and tasks into the system to make it more comprehensive and effective.