Skip to content

Notebook to try out MMR on a fashion data set #470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 8, 2025

Conversation

peter-strsr
Copy link
Contributor

Copy link

gitnotebooks bot commented Jun 27, 2025

Found 2 changed notebooks. Review the changes at https://app.gitnotebooks.com/elastic/elasticsearch-labs/pull/470

@peter-strsr peter-strsr force-pushed the result-diversification branch from 03c91a5 to 927ed96 Compare June 27, 2025 13:33
@peter-strsr peter-strsr force-pushed the result-diversification branch from 927ed96 to bcf8c97 Compare June 27, 2025 13:53
@peter-strsr peter-strsr force-pushed the result-diversification branch from 43b995f to a0204a0 Compare July 7, 2025 12:53
Copy link

@ioanatia ioanatia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the code examples make sense to me - just had some suggestions on how we can render the preview more nicely

"3. Search items with a broad search term\n",
"4. Apply result diversification with the MMR algorithm to the results.\n",
"\n",
"Check out our blog post on this topic to learn more about "
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we will update this later with the actual link? once the blog post is available?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am adding the link as it will be, that way we don't forget 👍

"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: anyio==4.9.0 in ./venv/lib/python3.12/site-packages (from -r requirements.txt (line 1)) (4.9.0)\n",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove these outputs? we can just modify the file and remove these strings from the list.
they don't render nicely in the preview:

Screenshot 2025-07-08 at 14 23 35

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed them 👍

"cell_type": "markdown",
"metadata": {},
"source": [
"## 9. Reranking with Maximum Marginal Relevance (MMR)\\n\\nMMR is a diversity-promoting algorithm that balances:\\n- **Relevance**: How well items match the query\\n- **Diversity**: How different items are from each other\\n\\nThe algorithm iteratively selects items that are relevant to the query but different from already selected items."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not render that well in the preview:

Screenshot 2025-07-08 at 14 23 35

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed.

@peter-strsr peter-strsr force-pushed the result-diversification branch from 1bcba61 to 1603a80 Compare July 8, 2025 13:54
@SharonRosencwaig1 SharonRosencwaig1 merged commit bc0098b into elastic:main Jul 8, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants