espnet3.systems.esp2_st.src.normalization.remove_punctuation
Less than 1 minute
espnet3.systems.esp2_st.src.normalization.remove_punctuation
espnet3.systems.esp2_st.src.normalization.remove_punctuation(text: str) → str
Port of espnet’s utils/remove_punctuation.pl.
Apostrophes survive, and the <space> scoring marker is protected, both via the same placeholder trick the Perl script uses.
Examples
>>> remove_punctuation("Don't stop, now!")
"Don't stop now"
>>> remove_punctuation("a <space> b.")
'a <space> b'