from sentence_transformers import SentenceTransformer from sentence_transformers.sentence_transformer.evaluation import ( InformationRetrievalEvaluator, ) model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2") queries = { "q1": "How do I reset a forgotten password?", "q2": "How can I export invoices as a CSV file?", } corpus = { "d1": "Reset a lost account password from the profile security page.", "d2": "Export paid invoices from the billing dashboard as a CSV file.", "d3": "Change the color theme for the analytics workspace.", "d4": "Archive an inactive user without deleting historical records.", } relevant_docs = { "q1": {"d1"}, "q2": {"d2"}, }