tanish78 commited on
Commit
87966e0
·
verified ·
1 Parent(s): 2b4ed80

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -45,18 +45,18 @@ def categorize_question(question):
45
  # words to exclude from End Conversation
46
  exclusion_words = {'is', 'please', 'not resolved', 'unresolved', 'problem', 'help', 'issue', 'webinar', 'office', 'leave', 'approved', 'notice', 'period', 'good morning', 'when', 'where', 'why', 'how', 'which', 'and when'}
47
 
48
- # Single word user query
49
- if len(words) == 1:
50
- single_word = words[0].lower()
51
- # Check if the single word fits into any other category
52
- for category, keywords in categories_keywords.items():
53
- if any(single_word in keyword for keyword in keywords):
54
- return category
55
 
56
- if any(single_word in keyword for keyword in categories_keywords["End of Conversation"]):
57
- return "End of Conversation"
58
- else:
59
- return "Miscellaneous"
60
 
61
  # Categorization of non-ending queries
62
  for category, keywords in categories_keywords.items():
 
45
  # words to exclude from End Conversation
46
  exclusion_words = {'is', 'please', 'not resolved', 'unresolved', 'problem', 'help', 'issue', 'webinar', 'office', 'leave', 'approved', 'notice', 'period', 'good morning', 'when', 'where', 'why', 'how', 'which', 'and when'}
47
 
48
+ # # Single word user query
49
+ # if len(words) == 1:
50
+ # single_word = words[0].lower()
51
+ # # Check if the single word fits into any other category
52
+ # for category, keywords in categories_keywords.items():
53
+ # if any(single_word in keyword for keyword in keywords):
54
+ # return category
55
 
56
+ # if any(single_word in keyword for keyword in categories_keywords["End of Conversation"]):
57
+ # return "End of Conversation"
58
+ # else:
59
+ # return "Miscellaneous"
60
 
61
  # Categorization of non-ending queries
62
  for category, keywords in categories_keywords.items():