15. Software stored in a non-transitory computer readable storage medium and comprising instructions executable by a processing system and upon such execution cause the processing system to perform operations comprising: defining query extraction criteria, the query extraction criteria configured to identify queries related to a subject relevance; identifying a candidate query from the queries stored in a query log according to the extraction criteria; generating relevancy scores for a first set of web documents, each relevancy score associated with a corresponding web document in the first set of web documents and being a measure of the relevance of the candidate query to the web document, the generating comprising defining proper subset criteria, the proper subset criteria configured to identify a proper subset of web documents from a collection of web documents as the first set of web documents, the proper subset of web documents related to the subject relevance; selecting web documents having an associated relevancy score that exceeds a relevancy threshold; generating a query-page candidate tuple from the selected web documents and the candidate query, the query-page candidate tuple including data specifying the candidate query and the selected web documents; generating a first intent measure related to the first set of web documents, the first intent measure being based on a vector of terms identified in the first set of web documents; searching a second set of web documents with the candidate query, the second set of web documents including the first set of web documents and additional web documents; generating a second intent measure from web documents identified by the search of the second set of web documents, the second intent measure being based on a vector of terms identified in the second set of web documents; filtering the web documents in the query-page candidate tuple based on the first intent measure and the second intent measure; storing the query-page candidate tuple as a query-page tuple; comparing the query-page tuple to an advertisement group, the advertisement group being an association of keywords and an advertisement; determining, based on the comparison, that the query-page tuple is relevant to the advertisement group, and in response to the determination associating the candidate query and at least one of the selected web documents of the query-page candidate tuple with the advertisement group; and providing the advertisement in response to a query that includes the candidate query based on the association of the candidate query with the advertisement group.
20. The software of claim 15 , wherein the subject relevance is a commercial relevance.