Skip to content

Instantly share code, notes, and snippets.

import re
from operator import itemgetter
from collections import Counter
def clean_data(txt):
txt = txt.lower()
txt = txt.replace('mr.','mr').replace('mrs.','mrs').replace('ms.','ms')
sentences = re.findall(r"[^!\.\?]+[!\.\?]",txt.lower())
sentences = [s.replace('\n',' ').replace('\r',' ') for s in sentences]
sentences = [re.sub(r'[^a-z ]','',x) for x in sentences]
@nikolajbaer
nikolajbaer / .gitignore
Last active April 24, 2024 13:43
STL from python server to Three.js viewer example
bin
.Python
lib
include
pip-selfcheck.json