{"id":41322767,"url":"https://github.com/scbirlab/lchemme","last_synced_at":"2026-01-23T05:56:58.531Z","repository":{"id":284218706,"uuid":"954219626","full_name":"scbirlab/lchemme","owner":"scbirlab","description":"🚄 Training and applying large chemistry models for embeddings.","archived":false,"fork":false,"pushed_at":"2025-06-13T11:59:06.000Z","size":114,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-05T23:14:20.521Z","etag":null,"topics":["ai","bart","cheminformatics","chemisty","llm","smiles-strings"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scbirlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-24T18:36:56.000Z","updated_at":"2025-06-13T11:59:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"348f6d07-b032-4870-85a7-8cfd70417889","html_url":"https://github.com/scbirlab/lchemme","commit_stats":null,"previous_names":["scbirlab/lchemme"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/scbirlab/lchemme","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scbirlab%2Flchemme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scbirlab%2Flchemme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scbirlab%2Flchemme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scbirlab%2Flchemme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scbirlab","download_url":"https://codeload.github.com/scbirlab/lchemme/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scbirlab%2Flchemme/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28681579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T05:48:07.525Z","status":"ssl_error","status_checked_at":"2026-01-23T05:48:07.129Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","bart","cheminformatics","chemisty","llm","smiles-strings"],"created_at":"2026-01-23T05:56:58.138Z","updated_at":"2026-01-23T05:56:58.521Z","avatar_url":"https://github.com/scbirlab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚄 lchemme\n\n![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/scbirlab/lchemme/python-publish.yml)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/lchemme)\n![PyPI](https://img.shields.io/pypi/v/lchemme)\n\nPretraining large chemistry models for embedding.\n\n- [Installation](#installation)\n- [Command-line usage](#command-line-usage)\n    - [Example](#example)\n    - [Other commands](#other-commands)\n- [Python API](#python-api)\n- [Documentation](#documentation)\n\n## Installation\n\n### The easy way\n\nInstall the pre-compiled version from PyPI:\n\n```bash\npip install lchemme\n```\n\n### From source\n\nClone the repository, then `cd` into it. Then run:\n\n```bash\npip install -e .\n```\n\n## Command-line usage\n\n**lchemme**  provides command-line utlities to pre-train BART models.\n\nTo get a list of commands (tools), do\n\n```bash\n$ lchemme --help\nusage: lchemme [-h] [--version] {tokenize,pretrain,featurize} ...\n\nTraining and applying large chemistry models.\n\noptions:\n  -h, --help            show this help message and exit\n  --version, -v         show program's version number and exit\n\nSub-commands:\n  {tokenize,pretrain,featurize}\n                        Use these commands to specify the tool you want to use.\n    tokenize            Tokenize the data inputs.\n    pretrain            Pre-train a large language model using self-supervised learning.\n    featurize           Get vector embeddings of a chemical dataset using a pre-trained large language model.\n```\n\nAnd to get help for a specific command, do\n\n```bash\n$ lchemme \u003ccommand\u003e --help\n```\n\n### Tokenizing\n\nThe first step is to build a tokenizer for your dataset. **LChemME** works with BART models,\nand pulls their architecture from the [Hugging Face Hub](https://huggingface.co/models) or \na local directory. Training data can also be pulled from [Hugging Face Hub](https://huggingface.co/datasets)\nwith the `hf://` prefix, or it can be loaded from local CSV files with a column containing\nSMILES strings.\n\n```bash\nlchemme tokenize \\\n    --train hf://scbirlab/fang-2023-biogen-adme@scaffold-split:train \\\n    --column smiles \\\n    --model facebook/bart-base \\\n    --output my-model\n```\n\nThis should be relatively fast, but could take several hours for millions of rows.\n\nIn principle, existing tokenizers trained on natural language could work, but they have\nmuch larger vocabularies which are largely unused in SMILES.\n\n### Model pretraining\n\n**LChemME** performs semi-supervised pretraining on a SMILES canonicalization task.\nThis requires an understanding of chemical connectivity and atom precedence rules,\nforcing the model to build an internal representation of the chemical graph.\n\n```bash\nlchemme pretrain \\\n    --train hf://scbirlab/fang-2023-biogen-adme@scaffold-split:train \\\n    --column smiles \\\n    --test hf://scbirlab/fang-2023-biogen-adme@scaffold-split:test \\\n    --model facebook/bart-base \\\n    --tokenizer my-model \\\n    --epochs 0.5 \\\n    --output my-model \\\n    --plot my-model/training-log\n```\n\nIf you want to continue training, you can do so with the `--resume` flag.\n\n```bash\nlchemme pretrain \\\n    --train hf://scbirlab/fang-2023-biogen-adme@scaffold-split:train \\\n    --column smiles \\\n    --test hf://scbirlab/fang-2023-biogen-adme@scaffold-split:test \\\n    --model my-model \\\n    --epochs 0.5 \\\n    --output my-model \\\n    --plot my-model/training-log \\\n    --resume\n```\n\nThe dataset state can only be restored if the `--model` was trained with **LChemME**\nand the dataset configuration is identical, i.e. `--train`, `--column` are the same.\n\n### Featurizing\n\nWith a trained model, you can generate embeddings of your chemical datasets,\noptionally with UMAP plots colored by chemical properties.\n\n```bash\nlchemme featurize \\\n    --train hf://scbirlab/fang-2023-biogen-adme@scaffold-split:train \\\n    --column smiles \\\n    --model my-model \\\n    --batch-size 16 \\\n    --method mean \\\n    --plot umap \\\n\u003e featurized.csv\n```\n\nYou can specify one or several aggregation functions with `--method`. **LChemME**\naggregates the sequence dimension of the encoder and decoder, then concatenates\nthem.\n\nIf you want to use additional columns containing numerical values to color the UMAP \nplots, provide the column names under `--extras`.\n\n## Documentation\n\n(Full API documentation to come at [ReadTheDocs](https://lchemme.readthedocs.org).)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscbirlab%2Flchemme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscbirlab%2Flchemme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscbirlab%2Flchemme/lists"}