Context. The Microwave Instrument on the Rosetta Orbiter (MIRO) on board the Rosetta spacecraft was designed to investigate the surface and gas activity of the comet 67P/Churyumov-Gerasimenko. The MIRO spectroscopic measurements carry information about the velocity of gas emanating from the nucleus surface. Knowledge of the terminal velocity of the HO gas is valuable for interpretation of in situ measurements, calibrating 3D coma simulations, and studying the physics of gas acceleration. Aims. Using a neural network technique, we aim to estimate the gas terminal velocity from the entire MIRO dataset of nadir geometry pointings. The velocity of the gas is encoded in the Doppler shift of the measured rotational transitions of o-HO and o-HO even when the spectral lines are optically thick with quasi or fully saturated line cores. Methods. Neural networks are robust nonlinear algorithms that can be trained to recognize underlying input to output functional relationships. A training set of about 2200 non-LTE simulated spectra for the two transitions is computed for known input cometary atmospheres, varying column density, temperature, and expansion velocity profiles. Two four-layer networks are used to learn and then predict the gas terminal velocity from the MIRO nadir measured o-HO and o-HO spectra lines, respectively. We also quantify the accuracy, stability, and uncertainty of the estimated parameter. Results. Once trained, the neural network is very effective in inverting the measured spectra. We process the entire dataset of MIRO measurements from August 2014 to July 2016, and investigate correlations and temporal evolution of terminal velocities derived from the two spectral lines. The highest terminal velocities obtained from HO are higher than those from HO with differences that evolve in time and reach about 150 m s-1 on average around perihelion. A discussion is provided on how to explain this peculiar behavior.