1. A speech recognition apparatus comprising: a first storing unit configured to store a first acoustic model invariable regardless of speaker and environment; a second storing unit configured to store second acoustic models that vary in accordance with at least either one of a specific speaker and a specific environment; a third storing unit configured to store a classification model that has shared parameters with the first acoustic model and non-shared parameters with the first acoustic model to classify the second acoustic models into different groups; a first recognizing unit configured to calculate a first likelihood with regard to the input speech by applying the first acoustic model to the input speech and obtain calculation result on the shared parameter and a plurality of candidate words that have relatively large values as the first likelihood; a calculating unit configured to calculate a second likelihood for each of the groups with regard to the input speech by use of the calculation result on the shared parameters and the non-shared parameters of the classification model; a selecting unit configured to select a group that has a largest value for the second likelihood from among the groups; and a second recognizing unit configured to recognize the input speech by applying a second acoustic model that belongs to the selected group onto the input speech to calculate a third likelihood for each of the candidate words and obtain as the recognition result a candidate word that has a largest value as the third likelihood.