Skip to content

Commit

Permalink
Добавил модуль перевода числительных в цифры
Browse files Browse the repository at this point in the history
  • Loading branch information
sxdxfan committed Oct 20, 2021
1 parent bb4a1bf commit aeef248
Show file tree
Hide file tree
Showing 4 changed files with 882 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ services:
image: sova-asr:master
volumes:
- .:/sova-asr
command: bash -c "python3 Train.py"
command: bash -c "python3 train.py"
3 changes: 3 additions & 0 deletions file_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
import uuid
from speech_recognizer import SpeechRecognizer
from punctuator import Punctuator
from number_utils.text2numbers import TextToNumbers


speech_recognizer = SpeechRecognizer()
punctuator = Punctuator(model_path="data/punctuator")
text2numbers = TextToNumbers()


class FileHandler:
Expand Down Expand Up @@ -55,6 +57,7 @@ def get_models_result(converted_record_path, delimiter='<br>'):
start = time.time()
decoder_result = speech_recognizer.recognize(converted_record_path)
text = punctuator.predict(decoder_result.text)
text = text2numbers.convert(text)
end = time.time()
results.append(
{
Expand Down
Loading

0 comments on commit aeef248

Please sign in to comment.