File size: 273 Bytes
531b9c5
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
'Fine-tune the tiny acoustic model on English dictation recordings.'

import re


REPLACEMENTS = str.maketrans({"’": "'", "‘": "'", "ʼ": "'", "é": "e"})

def normalize(text):
    return " ".join(re.sub(r"[^a-z' ]", " ", text.lower().translate(REPLACEMENTS)).split())