Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 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():
|