Tonic commited on
Commit
cd4bee1
1 Parent(s): 22a3dc8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -164,6 +164,11 @@ def remove_references(text):
164
  cleaned_text = re.sub(pattern, '', text)
165
  return cleaned_text
166
 
 
 
 
 
 
167
  def evaluate_content(user_input):
168
  vectara_response = query_vectara(user_input)
169
  vectara_response_json = json.loads(vectara_response)
 
164
  cleaned_text = re.sub(pattern, '', text)
165
  return cleaned_text
166
 
167
+ def clean_text(text):
168
+ # Remove special characters, keeping only letters, numbers, and spaces
169
+ cleaned_text = re.sub(r'[^a-zA-Z0-9\s]', '', text)
170
+ return cleaned_text
171
+
172
  def evaluate_content(user_input):
173
  vectara_response = query_vectara(user_input)
174
  vectara_response_json = json.loads(vectara_response)