Anne31415 commited on
Commit
6c0a950
·
1 Parent(s): 782ff3c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -22
app.py CHANGED
@@ -95,30 +95,27 @@ def display_chat_history(chat_history):
95
 
96
  def handle_no_answer(response):
97
  no_answer_phrases = [
98
- # German phrases
99
- "Ich weiß es nicht",
100
- "Ich weiß nicht",
101
- "Ich bin mir nicht sicher",
102
- "es wird nicht erwähnt",
103
- "keine Information",
104
- "das ist unklar",
105
- "da habe ich keine Antwort",
106
- "das kann ich nicht beantworten",
107
- # English phrases
108
- "I don't know",
109
- "I am not sure",
110
- "It is not mentioned",
111
- "no information",
112
- "that is unclear",
113
- "I have no answer",
114
- "I cannot answer that",
115
- "unable to provide an answer",
116
- "not enough context",
117
- # Add more phrases as needed
118
  ]
119
 
120
- # Check if response matches any phrase in no_answer_phrases
121
- if any(phrase in response.lower() for phrase in no_answer_phrases):
122
  return "Hmm, das ist eine knifflige Frage. Ich habe vielleicht nicht auf alles eine Antwort, aber lass uns das gemeinsam erkunden. Kannst du mir mehr Details geben oder eine andere Frage stellen?"
123
  return response
124
 
 
95
 
96
  def handle_no_answer(response):
97
  no_answer_phrases = [
98
+ "ich weiß es nicht",
99
+ "ich weiß nicht",
100
+ "ich bin mir nicht sicher",
101
+ "es wird nicht erwähnt",
102
+ "keine information",
103
+ "das ist unklar",
104
+ "da habe ich keine antwort",
105
+ "das kann ich nicht beantworten",
106
+ "i don't know",
107
+ "i am not sure",
108
+ "it is not mentioned",
109
+ "no information",
110
+ "that is unclear",
111
+ "i have no answer",
112
+ "i cannot answer that",
113
+ "unable to provide an answer",
114
+ "not enough context",
 
 
 
115
  ]
116
 
117
+ response_lower = response.lower()
118
+ if any(phrase in response_lower for phrase in no_answer_phrases):
119
  return "Hmm, das ist eine knifflige Frage. Ich habe vielleicht nicht auf alles eine Antwort, aber lass uns das gemeinsam erkunden. Kannst du mir mehr Details geben oder eine andere Frage stellen?"
120
  return response
121