statmike / vertex-ai-mlops

Google Cloud Platform Vertex AI end-to-end workflows for machine learning operations
Apache License 2.0
494 stars 221 forks source link

Could you utilize MMR for UmpireBot - MLB Rules For Baseball #49

Open abishpius opened 1 year ago

abishpius commented 1 year ago

Would it be possible to update the document search to utilize MMR (Max marginal relevance) instead of this? relevant_context = search_elements(question, k = 1 + 3int(10(1-closest_match)))

I want to say it will be better at grabbing more context for more ambiguous questions, but will leave final decision to you.

Relevant notebook: https://github.com/statmike/vertex-ai-mlops/blob/main/Applied%20GenAI/Vertex%20AI%20GenAI%20For%20Document%20Q%26A%20v2%20-%20MLB%20Rules%20For%20Baseball.ipynb

Details on MMR (https://python.langchain.com/docs/modules/model_io/prompts/example_selectors/mmr)