Results of a search for the standard model Higgs boson produced in association with a top quark pair in final states with leptons are presented. The analyzed dataset corresponds to an integrated luminosity of 35.9~\mathrm{fb}^{-1} which has been recorded in proton-proton collisions at \sqrt{s} = 13~\mathrm{TeV} center-of-mass energy by the CMS experiment during LHC \mathrm{Run}~2. The sensitivity of the search is improved by using matrix element and machine learning methods to separate the signal from backgrounds. The measured signal rate amounts to times the production rate expected in the standard model, with an observed (expected) significance of (). An upper limit on the signal rate of the standard model production rate is set at the confidence level.