Predicts the chemical name of any (real or not) chemical formula.
Check out the Live App here.
This scrape data from Wikipedia for training.
- Create a virtual environment and activate it
virtualenv formula-env
source env/bin/activate
-
Install required modules
pip install -r requirements.txt
-
Build the dataset (for custom dataset add train.csv and valid.csv in data folder)
python src/get_data.py
-
Train the model
python src/train.py
You can give args to train.py
args | shortcut | type | example | default |
---|---|---|---|---|
--learning_rate | -lr | float | 0.02 | 0.0003 |
--epochs | -- | int | 10 | 10 |
--continue_training | -- | bool | True | False |
For example
python src/train.py -lr 0.001 --continue_training True
- Test the model
python src/test.py <formula>
for example
python src/test.py NaOH