15. A system comprising: one or more computers and one or more storage devices storing instructions that are operable, when executed by the one or more computers, to cause the one or more computers to perform operations comprising: receiving a query identifying one or more attributes of an entity; accessing a set of candidate templates for answering the query based on the one or more attributes of the entity, each candidate template having one or more fields, wherein each field is associated with at least one constraint; obtaining a set of information that answers the query; selecting, from among the set of candidate templates, a template from which to generate a phrase that comprises an answer to the query, the selected template selected based on a determination that the selected template has a maximum number of fields with constraints that are satisfied by the set of information, in that no other template in the set of candidate templates has more fields with constraints that are satisfied by the set of information than the maximum number of fields of the selected template; generating the phrase by adding the set of information to the one or more fields of the selected template, such that the phrase comprises an answer to the query; and communicating the phrase to a client device.
19. The system of claim 15 , wherein obtaining a set of information that answers the query comprises obtaining at the server, a plurality of sets of information that answer the query; wherein selecting the template from which to generate the phrase that comprises an answer to the query comprises selecting at the server, for each of the plurality of sets of information, a template from the set of candidate templates; wherein generating the phrase by adding the set of information to the one or more fields of the selected template, such that the phrase comprises an answer to the query comprises generating at the server, for each of the selected templates, a phrase by adding the respective set of information to the one or more fields of the respective selected template; and wherein communicating the phrase for output by a client device comprises communicating from the server, a sentence including the phrases to a client device, wherein the operations further comprise, obtaining a sentence template based on a type of the entity, wherein the sentence template includes a plurality of fields for phrases; and adding the phrases to the fields of the sentence template to form the sentence.