1. A computer-implemented method performed by a data processing apparatus, comprising: accessing data specifying a set of actions, each action defining a user device operation that is different from user device operations for each other action; for each action, accessing a corresponding set of command sentences for the action; for each action, determining first n-grams in the set of command sentences that are semantically relevant for the action; for each action, determining second n-grams in the set of command sentences that are semantically irrelevant for the action; for each action, generating a training set of command sentences from the corresponding set of command sentences, the generating the training set of command sentences including removing each second n-gram from each sentence in the corresponding set of command sentences for the action; and for each action, generating or updating 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: first n-grams for the action; and second n-grams for the action that are also second n-grams for all other actions.