High-Dimensional Inference with the generalized Hopfield Model: Principal Component Analysis and Corrections