Classification of compounds based on molecular structure