improve query analysis docs (#18426)

pull/18466/head
Harrison Chase 7 months ago committed by GitHub
parent a63cee04ac
commit 7ce2f32c64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
position: 2
label: 'How-To Guides'

@ -15,7 +15,7 @@
"id": "f2195672-0cab-4967-ba8a-c6544635547d",
"metadata": {},
"source": [
"# High Cardinality\n",
"# Deal with High Cardinality Categoricals\n",
"\n",
"You may want to do query analysis to create a filter on a categorical column. One of the difficulties here is that you usually need to specify the EXACT categorical value. The issue is you need to make sure the LLM generates that categorical value exactly. This can be done relatively easy with prompting when there are only a few values that are valid. When there are a high number of valid values then it becomes more difficult, as those values may not fit in the LLM context, or (if they do) there may be too many for the LLM to properly attend to.\n",
"\n",

@ -52,7 +52,12 @@
"\n",
"## How to\n",
"\n",
"* [Add examples to prompt](/docs/use_cases/query_analysis/few_shot): As our query analysis becomes more complex, adding examples to the prompt can meaningfully improve performance."
"* [Add examples to prompt](/docs/use_cases/query_analysis/few_shot): As our query analysis becomes more complex, adding examples to the prompt can meaningfully improve performance.\n",
"* [Deal with High Cardinality Categoricals](/docs/use_cases/query_analysis/high_cardinality): Many structured queries you will create will involve categorical variables. When there are a lot of potential values there, it can be difficult to do this correctly.\n",
"* [Construct Filters](/docs/use_cases/query_analysis/constructing-filters): This guide covers how to go from a Pydantic model to a filters in the query language specific to the vectorstore you are working with\n",
"* [Handle Multiple Queries](/docs/use_cases/query_analysis/multiple_queries): Some query analysis techniques generate multiple queries. This guide handles how to pass them all to the retriever.\n",
"* [Handle No Queries](/docs/use_cases/query_analysis/no_queries): Some query analysis techniques may not generate a query at all. This guide handles how to gracefully handle those situations\n",
"* [Handle Multiple Retrievers](/docs/use_cases/query_analysis/multiple_retrievers): Some query analysis techniques involve routing between multiple retrievers. This guide covers how to handle that gracefully"
]
},
{

Loading…
Cancel
Save