1. A computer-implemented method performed by a data processing apparatus, comprising: for each action of a set of actions, generating a training set of command sentences from a corresponding set of command sentences for the action, the generating the training set of command sentences including retaining first n-grams determined to be semantically relevant for the action and removing second n-grams that are determined to be semantically irrelevant for the action from each sentence in the corresponding set of command sentences for the action; and for each action, generating a command model from the training set of command sentences and persisting the command model in a computer memory device, the command model facilitating the generation of an action score for the action for an input sentence based on: the first n-grams determined to be semantically relevant for the action; and second n-grams for the action that are also second n-grams for all other actions.