Skip to content

Commit

Permalink
improve query analysis docs (#18426)
Browse files Browse the repository at this point in the history
  • Loading branch information
hwchase17 committed Mar 3, 2024
1 parent a63cee0 commit 7ce2f32
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/docs/use_cases/query_analysis/how_to/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
position: 2
label: 'How-To Guides'
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 6 additions & 1 deletion docs/docs/use_cases/query_analysis/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down

0 comments on commit 7ce2f32

Please sign in to comment.