summvis / utils.py
cbensimon's picture
cbensimon HF staff
Initial commit
6124176 unverified
raw
history blame contribute delete
153 Bytes
import re
def preprocess_text(text):
split_punct = re.escape(r'()')
return ' '.join(re.findall(rf"[^\s{split_punct}]+|[{split_punct}]", text))