Spaces:
Running
Running
Pouya
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -217,31 +217,31 @@ def is_greeting(input_str):
|
|
217 |
return any(greet in input_str.lower() for greet in greetings)
|
218 |
|
219 |
|
220 |
-
def chatbot(input_str):
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
|
233 |
|
234 |
|
235 |
|
236 |
-
|
237 |
|
238 |
-
|
239 |
-
#
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
|
246 |
|
247 |
|
|
|
217 |
return any(greet in input_str.lower() for greet in greetings)
|
218 |
|
219 |
|
220 |
+
# def chatbot(input_str):
|
221 |
+
# # Check if the input is a greeting
|
222 |
+
# if is_greeting(input_str):
|
223 |
+
# # Respond with a greeting message
|
224 |
+
# return "Hello! Ask me your question about Italian Divorce or Inheritance Law?"
|
225 |
+
# else:
|
226 |
+
# # Process the input as a question
|
227 |
+
# response = chatbot1(input_str)
|
228 |
+
# if response == "N/A":
|
229 |
+
# return "I'm sorry, I'm having trouble understanding your question. Could you please rephrase it or provide more context"
|
230 |
+
# else:
|
231 |
+
# return response
|
232 |
|
233 |
|
234 |
|
235 |
|
236 |
+
## If you wanna disable Greeting in the chatbot, use this code:
|
237 |
|
238 |
+
def chatbot(input_str):
|
239 |
+
# Directly process every input as a question
|
240 |
+
response = chatbot1(input_str)
|
241 |
+
if response == "N/A":
|
242 |
+
return "I'm sorry, I'm having trouble understanding your question. Could you please rephrase it or provide more context"
|
243 |
+
else:
|
244 |
+
return response
|
245 |
|
246 |
|
247 |
|