1. A 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; iteratively processing data for the set of actions until a convergence condition is met, the iterative processing comprising: for each action, accessing a corresponding set of command sentences for the action; for each action, determining first n-grams that are semantically relevant for the action and second n-grams that are semantically irrelevant for the action in the correspond set of command sentences; for each action, identifying, from a log of command sentences that includes command sentences not included in the corresponding set of command sentences, candidate command sentences that include at least one first n-gram and a third n-gram that has not yet been determined to be a first n-gram or a second n-gram; for each candidate command sentence, determining each third n-gram that is semantically relevant for an action to be a first n-gram, and determining each third n-gram that is semantically irrelevant for an action to be a second n-gram; and for each action, adjusting the corresponding set of command sentences for the action based on the first n-grams and the second n-grams; and in response to the convergence condition being met, persisting in a computer memory device, for each action, the corresponding set of command sentences.