marcelomoreno26 commited on
Commit
5613b0d
1 Parent(s): 03b1205

Update preprocessor.py

Browse files
Files changed (1) hide show
  1. preprocessor.py +1 -0
preprocessor.py CHANGED
@@ -62,6 +62,7 @@ def preprocess_whatsapp_messages(file_path, file_type):
62
  # Additional preprocessing steps:
63
  # Remove URLs and convert text to lowercase
64
  df['text'] = df['text'].apply(lambda x: re.sub(r'https?:\/\/\S+', '', x)) # Remove URLs
 
65
 
66
  # Remove emojis, images, stickers, documents while preserving colons after sender names
67
  df['text'] = df['text'].apply(lambda x: re.sub(r'(?<!\w)(:\s|\s:\s|\s:)', '', x)) # Remove colons that are not part of sender's name
 
62
  # Additional preprocessing steps:
63
  # Remove URLs and convert text to lowercase
64
  df['text'] = df['text'].apply(lambda x: re.sub(r'https?:\/\/\S+', '', x)) # Remove URLs
65
+ df['text'] = df['text'].apply(lambda x: x.lower())
66
 
67
  # Remove emojis, images, stickers, documents while preserving colons after sender names
68
  df['text'] = df['text'].apply(lambda x: re.sub(r'(?<!\w)(:\s|\s:\s|\s:)', '', x)) # Remove colons that are not part of sender's name