AI Glossary / Retrieval and knowledge systems / Intermediate

Web query classification

Definition

Web query classification is assigning a web-search query to one or more defined categories, such as a subject area or a type of search intent. It helps a search system interpret short requests and choose suitable retrieval or presentation behavior. The classification is an estimate based on available evidence, not direct knowledge of what the person actually intends.

What it means

A query such as jaguar may concern an animal, a vehicle, or another entity. Topic classification estimates the subject, while intent classification estimates the kind of task. These are separate dimensions: a query about vehicles could seek information, a particular website, or an opportunity to buy something.
One influential intent taxonomy distinguishes informational, navigational, and transactional searches. It is a useful historical framework, not a claim that every modern query has exactly one unambiguous intent. A system's categories should reflect its actual purpose and include a way to handle uncertainty.

How it works

Define the category scheme and annotation rules before training or evaluating a classifier. Decide whether labels are mutually exclusive, whether several can apply, and whether the hierarchy permits broad or narrow assignments. Examples help annotators distinguish overlapping categories consistently.
Represent the query using its text and any appropriately available context. Methods can range from rules and keyword features to learned encoders. Some research enriches short queries with retrieved pages or other evidence, but enrichment can introduce errors if the initial search results favor the wrong interpretation.
Produce a category or a ranked set of category scores. If those scores are used as probabilities, their interpretation and calibration need evaluation. A threshold or uncertainty policy can preserve general search behavior when evidence is weak instead of forcing every query into a narrow route.
Evaluate on held-out queries with representative languages, spellings, rare topics, and ambiguous expressions. Prevent duplicate or closely related queries from making evaluation unrealistically easy. Measure downstream search outcomes as well as classification metrics, because a category error matters through the experience or action it changes.

Three practical examples

  • A search portal identifies likely product queries and offers relevant catalog filters alongside ordinary results.
  • A content-discovery service groups queries into broad topics for aggregate analysis of information needs.
  • A web-search system distinguishes requests for a specific site from requests seeking explanatory information, while retaining fallbacks for ambiguity.

Think of it this way

Think of a receptionist deciding which desk might best handle a short request. The receptionist can use clues and offer options, but should not treat a guess as certainty. A request can also involve more than one department, just as a query can have several topics or intentions.

Worked example

Consider an original binary evaluation for a classifier that decides whether a query is transactional. In a reviewed set of 100 queries, 30 are labeled transactional and 70 are labeled otherwise. These are invented labels for this exercise.
The classifier predicts transactional for 25 queries. Of those, 20 are truly transactional and 5 are not. It therefore has 20 true positives, 5 false positives, 10 false negatives, and 65 true negatives.
Precision is 20/(20+5)=80%. Recall is 20/(20+10), approximately 66.67%. Accuracy is (20+65)/100=85%. The F1 score is 2*20/(2*20+5+10)=40/55, approximately 72.73%.
Now raise the decision threshold. Suppose it predicts transactional for only 15 queries, with 14 true positives and 1 false positive. The remaining counts are 16 false negatives and 69 true negatives.
Precision rises to 14/15, approximately 93.33%, but recall falls to 14/30, approximately 46.67%. Accuracy becomes 83%, and F1 is 28/(28+1+16)=28/45, approximately 62.22%.
The higher threshold produces fewer mistaken transactional routes but misses more transactional queries. Whether that is preferable depends on what the classification triggers. These results are not a benchmark, and the binary setup does not represent a complete topic-and-intent taxonomy. Queries with genuinely mixed intent would also require an annotation and evaluation policy that permits that complexity.

Illustrative case study

Fictional case: Alder Search adds topic routing to a business-information site. Its prototype sends short queries into a single specialist section whenever that section has the largest model score.
Tests reveal that the largest score can still be weak evidence. The team adds a general-results fallback and offers category choices for ambiguous queries. It evaluates whether users find useful results, not just whether the assigned label matches a reference label.
The team also reviews newly emerging terminology and updates its test set. This hypothetical case illustrates cautious use of classification, not a real deployment or a claim of measured commercial improvement.

Common misconceptions and mistakes

Topic and intent are not interchangeable. Knowing what a query concerns does not fully reveal what the user wants to do.
A high score is not automatically a calibrated probability. Likewise, a forced single-label output can conceal genuine ambiguity or multiple intentions.
Do not assume that unclicked results show disinterest. Presentation, position, and exposure affect behavioral signals. Also avoid treating a classifier trained on one site's queries as automatically suitable for another audience, language, or category scheme.

Business use

Businesses can use query classification to support navigation, content planning, specialized retrieval, and relevant filtering. The value comes from improving the user's task, not simply adding a label to every request.
Define the consequences of each category decision and evaluate mistakes accordingly. If a wrong category hides useful results, preserve a broader route or let users revise the interpretation. Monitor coverage of uncommon queries and changing terminology. Use aggregate analysis with suitable data handling rather than treating inferred query categories as reliable personal attributes.

People also ask

Is this the same as classifying web pages?

No. The object being classified is the query, though page evidence may help.

Can a query have multiple labels?

Yes, if the scheme allows it.

Must AI be used?

No. Rules can work for narrow, well-defined cases, while learned models can handle more varied patterns.

Check your understanding

Why did precision rise when the threshold increased?

Answer: A larger share of the remaining positive predictions was correct.

Why did recall fall?

Answer: More genuinely transactional queries were left outside that category.

Why can a correct topic label still lead to poor search?

Answer: It may not capture the user's intended task or needed level of detail.

Related terms

  • Text classification
  • Ambiguity
  • Taxonomy
  • Precision
  • Recall
  • Calibration
  • Query intent
  • topic classification
  • F1 score

Learn next

Learn how topic and intent labels differ, then define a small annotation scheme with ambiguous examples. Evaluate classification thresholds and downstream search behavior together before using predicted labels to restrict what users can find.

More in Retrieval and knowledge systems

  • Universal code - A universal code, in this information-retrieval context, is an integer coding scheme with an efficiency guarantee across a specified class of source...
  • URL normalization - URL normalization converts a web address into a consistent representation using rules that preserve its intended meaning.
  • Variable byte encoding - Variable byte encoding represents an integer using one or more bytes, reserving a bit in each byte to mark whether the number continues.
  • Webometrics - Webometrics is the quantitative study of information resources, relationships, and activity on the World Wide Web, drawing particularly on bibliometric and...
  • Weighted zone scoring - Weighted zone scoring ranks a document by combining Boolean query matches from different parts, or zones, of that document.
  • Word embedding - A word embedding is a numerical vector used to represent a word in a space where learned relationships can support language-processing tasks.

Sources

Primary research: Shen and colleagues, Building Bridges for Web Query Classification: https://www.microsoft.com/en-us/research/wp-content/uploads/2006/01/p131-shen.pdf Primary intent taxonomy: Broder, A taxonomy of web search: https://sigir.hosting.acm.org/files/forum/F2002/broder.pdf

Previous: Web intelligence Next: Web resource

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer