Text normalization in speech recognition tasks

When solving tasks related to speech recognition (Speech-To-Text) and generation (Text-To-Speech) of speech, it is important that the transcript matches what the speaker said - that is, real spoken language. This means that before written speech becomes our transcript, it needs to be normalized .


In other words, the text needs to be done through several steps:


  • Replacing the number in words: 1984 -> one thousand nine hundred and eighty-fourth year ;
  • Explanation of abbreviations: 2 . -> two minutes of hatred ;
  • Latin transcription: Orwell-> etc.

Normalization


In this article, I will briefly talk about how normalization developed in the dataset of the Russian language Open_STT , what tools were used and about our approach to the task.


Like a cherry on a cake, we decided to put our normalizer based on seq2seq in the public domain: a link to github . It is as simple as possible to use and is called by one method:


norm = Normalizer()
result = norm.norm_text(' 9  11   whiskas')

>>> '      '

More about the task


, , ? , . , .


, , :


  • 2 β€” (), . 2 β€” ;
  • 2 β€” , 2 β€” ;
  • 2 β€” , 2 β€” ;
  • = 2/5 β€” , . 2/5 β€” β€” .

: - ( β€” ) ( β€” ?). , , . .



. - . , , ~20% , ~80% .


Open_STT : β€” . STT , - 2020 , .


. 2020 . "" β€” .


Sequence to Sequence


- , sequence-to-sequence (seq2seq) . , seq2seq , "" , :


  • β€” ;
  • β€” ;
  • , β€” ;

Attention


attention "5 ". , "" "5", "".

seq2seq PyTorch . β€” . + + + , β€” + .


β€” , . ( , ) .


, :



TorchScript


, , Torchscript.


TorchScript β€” PyTorch, Python C++.


, PyTorch :


  1. , TorchScript , ;
  2. torch.jit.script ( torch.jit.trace), .

, , , , . , : , .. .



, . , .


  • norm.norm_string(" β€” β€” 27 38 %.")

' β€” β€” .'


  • norm.norm_string(" 22 1939 ")

' '


  • norm.norm_string(" Β«The Crying GameΒ»")

' Β« Β»'


  • norm.norm_string(" XVIII ")

' '


  • norm.norm_string(" 2012 6,6 ")

All Articles