Spaces:
Runtime error
Runtime error
Create nlp.py
Browse files- utils/nlp.py +6 -0
utils/nlp.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
def process_query(query, intents):
|
2 |
+
for intent in intents["intents"]:
|
3 |
+
for pattern in intent["patterns"]:
|
4 |
+
if pattern.lower() in query.lower():
|
5 |
+
return intent["responses"][0]
|
6 |
+
return "I'm sorry, I don't understand your request. Can you rephrase?"
|