ECUiVADE commited on
Commit
467c81e
1 Parent(s): c868838

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -91,10 +91,10 @@ class ChatbotAPP:
91
  print(f"Chat log {self.chat_log_name} exist")
92
  return files
93
 
94
- def strip_text(self,text): # Method to strip unwanted text from chat messages
95
-
96
- # Pattern to match text inside parentheses or angle brackets and any text following angle brackets
97
- pattern = r"\(.*?\)|<.*?>.*"
98
 
99
  # Use re.sub() to replace the matched text with an empty string
100
  cleaned_text = re.sub(pattern, "", text)
 
91
  print(f"Chat log {self.chat_log_name} exist")
92
  return files
93
 
94
+ def strip_text(self, text):
95
+ # Pattern to match text inside parentheses or angle brackets, any text following angle brackets,
96
+ # new line characters, and anything after ',', '<', or '|'
97
+ pattern = r"\(.*?\)|<.*?>.*|\n|<.*|\|.*"
98
 
99
  # Use re.sub() to replace the matched text with an empty string
100
  cleaned_text = re.sub(pattern, "", text)