Understanding the patterns that neural networks learn from chemical spectra