feat: add recalculate_representative_docs() method with configurable count [stacks on #2514]#2516
Draft
pidefrem wants to merge 3 commits into
Draft
feat: add recalculate_representative_docs() method with configurable count [stacks on #2514]#2516pidefrem wants to merge 3 commits into
recalculate_representative_docs() method with configurable count [stacks on #2514]#2516pidefrem wants to merge 3 commits into
Conversation
5 tasks
recalculate_representative_docs() method with configurable countrecalculate_representative_docs() method with configurable count [stacks on #2514]
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.
What does this PR do?
feat: add
recalculate_representative_docs()method with configurable count_save_representative_docshardcodesnr_samples=500andnr_repr_docs=3. Users cannot control how many representative documents are stored per topic.This is frequently requested: #552, #848, #1767. In #1767, @MaartenGr indicated he prefers a standalone recalculation function (not a constructor parameter). PR #2130 attempted a constructor-only approach but stalled.
Changes:
recalculate_representative_docs(nr_repr_docs=3, nr_samples=500)— recalculates and replacesrepresentative_docs_after training. Users can call it with different counts without re-fitting.nr_repr_docs(default 3) andnr_repr_docs_nr_samples(default 500) — used duringfit_transform().Backward compatible: defaults reproduce the current behavior exactly.
Fixes #2500
Note: Pairs well with #2496 (dedup fix for
_extract_representative_docs) but works standalone.Before submitting