Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

49 Commits

Folders and files

Repository files navigation

SMILES Tokenization

The files train/train_ape.py, train/train_spe.py, and train/train_trie.py contain the code for building the Atom-Pair Encoding, SMILES-Pair Encoding, and Trie-based encoding compressors, respectively. We use the PubChem parquet data files in the data/ folder.

Usage

To run, first install the necessary requirements:

pip install -r requirements.txt

Then, run the training files (train_*.py) in train/ for the desired compressors and run experiments/bench_lengths.py to compare the compressed vocabularies generated by the SPE, APE, Trie, and Trie+TTG algorithms.

Results

The results will be visible in both the standard output of bench_lengths.py and the visualisations folder, which contains JSON formatted data for the histograms and the histograms themselves for each of the compression algorithms. Other outputs are stored in data/, such as run time.

Experiments

Various experiments were conducted during the review of this paper to test different properties about the generated encodings for each of the three tokenizers. The relevant code can be found in files labeled experiments/test_e#.py, replacing # with the experiment number.

Remaining Python files are a mix of utilities (see e.g. utils.py), implementations of the underlying compressor algorithms (see e.g. ape_tokenizer.py, and trie_funcs.py).

Most output is directed into one of the top-level directories in this repository, usually data/ or visualisations/.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages