Generation of ligand dictionary and ligand representation