Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,20 +45,8 @@ 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
|
| 62 |
for category, keywords in categories_keywords.items():
|
| 63 |
if any(keyword.lower() in question.lower() for keyword in keywords):
|
| 64 |
return category
|
|
|
|
| 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 |
|
| 49 |
+
# Categorization
|
| 50 |
for category, keywords in categories_keywords.items():
|
| 51 |
if any(keyword.lower() in question.lower() for keyword in keywords):
|
| 52 |
return category
|