Thermodynamic uncertainty relations (TURs) are the inequalities which give lower bounds on the entropy production rate using only the mean and the variance of fluctuating currents. Since the TURs do not refer to the full details of the stochastic dynamics, it would be promising to apply the TURs for estimating the entropy production rate from a limited set of trajectory data corresponding to the dynamics. Here we investigate a theoretical framework for estimation of the entropy production rate using the TURs along with machine learning techniques without prior knowledge of the parameters of the stochastic dynamics. Specifically, we derive a TUR for the short-time region and prove that it can provide the exact value, not only a lower bound, of the entropy production rate for Langevin dynamics, if the observed current is optimally chosen. This formulation naturally includes a generalization of the TURs with the partial entropy production of subsystems under autonomous interaction, which reveals the hierarchical structure of the estimation. We then construct estimators on the basis of the short-time TUR and machine learning techniques such as the gradient ascent. By performing numerical experiments, we demonstrate that our learning protocol performs well even in nonlinear Langevin dynamics. We also discuss the case of Markov jump processes, where the exact estimation is shown to be impossible in general. Our result provides a platform that can be applied to a broad class of stochastic dynamics out of equilibrium, including biological systems.