1. A computer-implemented method 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.