Interface IQueryProcessor
- Namespace
- AiDotNet.Interfaces
- Assembly
- AiDotNet.dll
Defines the contract for processing and transforming user queries before retrieval.
public interface IQueryProcessor
Remarks
Query processors enhance retrieval quality by transforming the user's input query in various ways such as expansion, reformulation, or keyword extraction.
For Beginners: Query processors improve search results by refining your question.
Think of it like asking a librarian for help:
- You say: "cars"
- Librarian suggests: "Did you mean automobiles, vehicles, or transportation?"
- You get better results with the expanded search
Common query transformations:
- Expansion: Add related terms ("solar" → "solar, photovoltaic, renewable energy")
- Reformulation: Rephrase for clarity ("how r cars made" → "how are cars manufactured")
- Keyword extraction: Focus on important terms ("What is the capital of France?" → "capital France")
Methods
ProcessQuery(string)
Processes and transforms the input query.
string ProcessQuery(string query)
Parameters
querystringThe original user query.
Returns
- string
The processed query string.