7. A system comprising: one or more computers; and one or more storage devices in data communication with the one or more computers and storing instructions that, when executed by the one or more computers, cause the one or more computers to perform operations comprising: maintaining a collection of extract patterns, wherein each extract pattern specifies a text pattern that includes an entity placeholder and an attribute placeholder; maintaining a collection of category definitions, wherein each category definition comprises a category identifier, one or more entity identifiers, and one or more attribute identifiers, each entity identifier comprises an entity-name text string representing a name of an entity in the category, and each attribute identifier comprises an attribute-name text string representing an attribute of the entities in the category; determining that a first search query text string matches a first extract pattern in the collection of extract patterns, including: determining that a first substring of the first search query text string matches an entity placeholder in the first extract pattern; and determining that a second substring of the first search query text string matches an attribute placeholder in the first extract pattern; and determining that the first substring matches an entity identifier in a first category definition in the collection of category definitions; adding the second substring as an attribute identifier to a set of one or more first attribute identifiers in the first category definition, the set of one or more first attribute identifiers comprising at least one of the one or more attribute identifiers; and generating a score for a particular attribute identifier included in the set of one or more first attribute identifiers in the first category definition, wherein the score reflects an extent to which the particular attribute identifier is relevant to characterizing the first category definition.
7. A system comprising: one or more computers; and one or more storage devices in data communication with the one or more computers and storing instructions that, when executed by the one or more computers, cause the one or more computers to perform operations comprising: maintaining a collection of extract patterns, wherein each extract pattern specifies a text pattern that includes an entity placeholder and an attribute placeholder; maintaining a collection of category definitions, wherein each category definition comprises a category identifier, one or more entity identifiers, and one or more attribute identifiers, each entity identifier comprises an entity-name text string representing a name of an entity in the category, and each attribute identifier comprises an attribute-name text string representing an attribute of the entities in the category; determining that a first search query text string matches a first extract pattern in the collection of extract patterns, including: determining that a first substring of the first search query text string matches an entity placeholder in the first extract pattern; and determining that a second substring of the first search query text string matches an attribute placeholder in the first extract pattern; and determining that the first substring matches an entity identifier in a first category definition in the collection of category definitions; adding the second substring as an attribute identifier to a set of one or more first attribute identifiers in the first category definition, the set of one or more first attribute identifiers comprising at least one of the one or more attribute identifiers; and generating a score for a particular attribute identifier included in the set of one or more first attribute identifiers in the first category definition, wherein the score reflects an extent to which the particular attribute identifier is relevant to characterizing the first category definition. 9. The system of claim 7 , wherein the operations further comprise: determining that a second search query text string matches a second extract pattern in the collection of extract patterns, including: determining that a first substring of the second search query text string matches an entity placeholder in the second extract pattern; and determining that a second substring of the second search query text string matches an attribute placeholder of the second extract pattern; and determining that the first substring of the second search query matches an entity identifier in the first category definition; determining that both the second substring of the second search query text string and the second substring of the first search query text string identify a common attribute of an entity within the first category definition and identifying the second substring of the second search query text string and the second substring of the first search query text string as being semantically related to each other; and determining a weighted frequency with which the common attribute is used to characterize the entity within the first category.