Spaces:
Sleeping
Sleeping
| import re | |
| def remove_html_tags(text): | |
| """Remove HTML tags from text""" | |
| clean = re.compile('<.*?>') | |
| return re.sub(clean, '', text) | |
| def remove_url(text): | |
| """Remove URLs from text""" | |
| return re.sub(r'http\S+|www.\S+', '', text) | |
| def remove_digits(text): | |
| """Remove digits from text""" | |
| return re.sub(r'\d+', '', text) | |
| def remove_punc(text): | |
| """Remove punctuation from text""" | |
| return re.sub(r'[^\w\s]', '', text) | |
| def lower(text): | |
| return str.lower(text) |