File size: 161 Bytes
45fe8b6
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import re


def clean_text(text):

    text = text.lower()

    text = re.sub(r"\n+", " ", text)

    text = re.sub(r"\s+", " ", text)

    return text.strip()