Physical parametrization of stellar spectra: the neural network approach