Skip to main content

An explainer for Chemprop based on LIME and PathExplain.

Project description


A Chemprop explainer based on LIME and PathExplain.


  • Make sure your Python version is >= 3.8
  • conda is required for ChemProp. If it is not installed on your machine, you can take a look at miniconda
  1. Install Chemprop
  2. Then simply run pip install chemexp
  3. You're good to go!


Using Python

import chemexp
from chemprop.utils import load_checkpoint

model = chemexp.ExplanationModel(load_checkpoint("models/"))
exp = model.explain_molecule("COC(=N)Cc1ccccc1")
chemexp.exp_to_png(exp, "mol.png")

A little more detail is available in test/

Web interface

Although you can use this Python module in your scripts, you can also experiment a user-friendly interface.
⚠️ Warning: this only works on Linux for the moment (this is due to the linux-specific paths used to save some files, but it can be adapted for Windows or Mac).

Use the following command to run the web server:

python -m chemexp <path>

where path is a folder containing chemprop models / checkpoints (.pt files)


To cite our work:

  TITLE = {{A Study about Explainability and Fairness in Machine Learning and Knowledge Discovery}},
  AUTHOR = {Bernier, Fabien},
  URL = {},
  PAGES = {58},
  SCHOOL = {{TELECOM Nancy}},
  YEAR = {2021},
  MONTH = Sep,
  KEYWORDS = {machine learning ; explainability ; fairness ; antibiotic classification ; machine learning ; explicabilit{\'e} ; fairness ; classification antibiotique},
  PDF = {},
  HAL_ID = {hal-03371070},
  HAL_VERSION = {v1},

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chemexp-0.2.4.tar.gz (66.8 kB view hashes)

Uploaded Source

Built Distribution

chemexp-0.2.4-py3-none-any.whl (69.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page