We construct a parametrization of the lepton energy spectrum in inclusive semileptonic decays of B mesons, based on the available experimental information: moments of the spectrum with cuts, their errors and their correlations, together with kinematical constraints. The result is obtained in the form of a Monte Carlo sample of neural networks trained on replicas of the experimental data, which represents the probability density in the space of lepton energy spectra. This parametrization is then used to extract the b quark mass m 1S b in a way that theoretical uncertainties are minimized, for which the value m 1S b = 4.84 ± 0.14 exp ± 0.05 th GeV is obtained.