preprocessedquestionvar = fnpreprocessquestion(question) for…
- User
preprocessed_question_var = fn_preprocess_question(question) for predefined_question_var,predefined_answer_var in dict_predefined_answers.items(): if fn_preprocess_question(predefined_question_var) in preprocessed_question_var: return predefined_answer_var
porter_stemmer =PorterStemmer() #-------------------------------------- def fn_preprocess_question(question): return ' '.join([porter_stemmer.stem(word) for word in question.split()]) dict_predefined_answers ={ "Who are you":"I am the SAMS bot, your Virtual Sales Assistant. I’m here to help you navigate through SAMS databases and provide the information you need.", "Hi":"Hello, Welcome to SAMS Virtual Sales Assistant. I am designed to assist you in retrieving information from various SAMS databases. Please feel free to ask your queries, such as, 'What is the total sellout across India for July 16, 2022? among others.", "What can you do":"I am equipped to offer you comprehensive insights and data from SAMS databases. Whether you need sales figures or specific reports, just ask, and I’ll provide the most accurate information available.Although my training is still going on.", "How can I use this service":"Using this service is simple. Just type in your query about any sales or database-related information, like ‘Show the sales trend for product XYZ during the last month,' and I'll fetch the details for you.", "I'm not sure what to ask.":"No problem at all. You can start with general queries like 'What were the top-selling products last month?'' or 'Update me on the current monthly sales report.' I am here to guide you through accessing the precise information you need.", "Thank you":"You're most welcome! If you have any more questions or need further assistance, I'm here to help. Your success is my priority.", "Goodbye":"Farewell! If you ever require any assistance or have more queries in the future, don't hesitate to reach out. Have a great day ahead!", "Bye":"Farewell! If you ever require any assistance or have more queries in the future, don't hesitate to reach out. Have a great day ahead!", "How are you":"I am good,Please ask anything related to SAMS and I will try to provide you best possible solution.Thanks" }
whenever i give which,highest these kind of values ,the "Hi" key in dict_pedefined_answers is involing,why is that and correct it
- Assistant
- User
what changes here ,in my and your code
- Assistant