Add an option to use Maximal Marginal Relevance (MMR) for diversified search
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 12.5k
- Forks
- 998
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 10
Description
It can be useful to diversify search results. For example, when querying my pelican database for pelicans similar to Beaker, using pure cosine similarity I may end up with 10 pelicans that have similar hobbies (beak painting, beak basketball). I may want to mix this up and include pelicans that are similar on other axes like favorite foods (Tuna Tacos, Crabby Caviar, ...).
One algorithm to do this is Maximal Marginal Relevance (MMR) - this is pretty fast in numpy which is already being used.
Example implementation:
Happy to make a PR lifting this implementation if in scope
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no repository files, tests, or entry points, so first locate the search implementation and its option handling. Review the linked Python MMR implementation and determine how an opt-in mode should diversify results; done means users can request diversified search results without changing the existing default behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- cli, search
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100