32. The method of claim 17 , further comprising grouping at least one unique query into a separate initial label group, a unique query being a query that has not been grouped into one of an initial label group corresponding to a set of matching web pages and an initial label group corresponding to a set of matching labels.
17. A method performed by data processing apparatus, the method comprising: selecting a non-text content item that is associated with each of a plurality of web pages; receiving label data that includes a set of initial labels for the non-text content item and a resource identifier for each initial label, wherein each initial label includes one or more words; selecting one or more sets of matching web pages from the plurality of web pages, wherein each set of matching web pages includes two or more matching web pages; grouping, for each set of matching web pages, initial labels that are associated with the set of matching web pages into a separate initial label group that corresponds to the set of matching web pages; selecting one or more sets of matching labels, wherein each set of matching labels includes two or more initial labels; grouping each set of matching labels into a separate initial label group that corresponds to the set of matching labels; and selecting, as a final label for the non-text content item, an n-gram of one or more words that are included in at least a threshold number of separate initial label groups.