Dataset generator: queries from categories (facet results)#265
Open
radu-gheorghe wants to merge 4 commits into
Open
Dataset generator: queries from categories (facet results)#265radu-gheorghe wants to merge 4 commits into
radu-gheorghe wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR includes #264, so if we merge it, that one could be closed.
In addition to generating queries (and therefore judgments) from documents, we can now create those from "categories" - i.e., facet values. For example, movie genres or E-commerce product tags.
The category values could be provided manually in the config or derived from facet results (given a query template for the search engine).
Config example
High level implementation notes
fetch_field_valuesper engine, — each matches its existing retrieval-template convention.Each query is tagged with where it came from this run —
user,category,llm, orcached(loaded from a previous run'sdatastore.json).Budget fix. When the total number of queries exceeds
num_queries_needed, the budget used to truncate by raw insertion order, which meant cached queries fromdatastore.json(loaded first) could push fresh user/category/LLM queries out of scoring. The budget now sorts by source priority first (user/category>llm>cached), so fresh queries always win their slot. The same priority is used when deciding whether to call the LLM at all — cached queries don't count toward the "do we still need more?" check.main()phase split.generate_and_add_queriesnow goes likeadd_user_queries/add_category_queries/fetch_and_add_seed_documents/generate_and_add_queries_from_documents.Gotchas
generate_queries_from_documentssemantics changed. WasOptional[bool] = Trueand unread bymain(). Nowbool = Trueand actually gates LLM generation + the seed-fetch decision. A YAMLnullin this field used to be silently equivalent to absent; it now raises a validation error.Validator ordering matters. Path-collision validators run before content-reading validators, so a swapped
values_query_template_file/query_text_template_fileproduces "different concepts" rather than "missing placeholder". Don't reorder.Next steps (sometime 🙂 )
Multi-field category sources.
fields: List[str]is already accepted in the schema; config currently rejects more than one entry with "not yet supported".