ottokart / punctuator2

A bidirectional recurrent neural network model with attention mechanism for restoring missing punctuation in unsegmented text
http://bark.phon.ioc.ee/punctuator
MIT License
657 stars 195 forks source link

Streaming recognition punctuation #84

Open epigraphe opened 1 year ago

epigraphe commented 1 year ago

Hello. Can you please tell me how to use the punctuator to process the text I get from the vosk? Probably for my purposes there is no need to use the file playing_with_model.py every time

Recasepunc currently works like this

if 'result' in res:
        text = " ".join([w['word'] for w in res['result']])
        cased = subprocess.check_output('python3 /home/ubuntu/speech/recasepunc/recasepunc.py predict /home/ubuntu/speech/recasepunc/checkpoint', shell=True, text=True, input=text)

but it's slow enough for my purposes, so I want to try yours. I set everything up and everything works through the playing_with_model.py file, now the question is in streaming recognition.

Thank you