Pattern Recognition of Chemical Fingerprints from Large-Scale Databases of Molecules and Reactions