vosk-api icon indicating copy to clipboard operation
vosk-api copied to clipboard

Text punctuation support

Open marlon-br opened this issue 4 years ago • 21 comments

Hello, Do you know if the solution supports text punctuation or how to add this functionality?

marlon-br avatar Jun 23 '20 10:06 marlon-br

You can use external tools like https://github.com/ottokart/punctuator2 or https://github.com/kaituoxu/X-Punctuator

nshmyrev avatar Jun 23 '20 22:06 nshmyrev

thanks, so Vosk itself does not support punctuation?

marlon-br avatar Jun 24 '20 16:06 marlon-br

No, not yet.

nshmyrev avatar Jun 24 '20 16:06 nshmyrev

ok. i see. thanks

marlon-br avatar Jun 24 '20 16:06 marlon-br

Latest recommendation is https://github.com/benob/recasepunc

We don't plan to have it immediately, maybe, some time in the future.

nshmyrev avatar Nov 15 '21 16:11 nshmyrev

Btw, we have released some punctuation models, links are in https://alphacephei.com/vosk/models

nshmyrev avatar Jan 04 '22 12:01 nshmyrev

Latest recommendation is https://github.com/benob/recasepunc

We don't plan to have it immediately, maybe, some time in the future.

Good Afternoon Dear @nshmyrev, I see you developed 2 customized models for Russian and German languages using https://github.com/benob/recasepunc Could you tell me short hints how may I add text punctuation support of my language in recasepunc? Thank you in advance!

P.S. The solution is here https://github.com/benob/recasepunc/issues/6

ican24 avatar Mar 28 '22 08:03 ican24

Btw, we have released some punctuation models, links are in https://alphacephei.com/vosk/models

This is so great! I was curious...are there plans / is it even possible to release a small model version with punctuation?

szeidner avatar May 09 '22 12:05 szeidner

@szeidner

This is so great! I was curious...are there plans / is it even possible to release a small model version with punctuation?

Thats actually a big research question. BERT and alike models are accurate, but they are not easy to compress to a small size. Things like distillbert are much less accurate for practical applications. Another approach to punctuation prediction is required. Distillation somewhat works, but not easy.

nshmyrev avatar May 09 '22 12:05 nshmyrev

@nshmyrev could you give an example on how to use the punctuation model? Might be doing something completely wrong but I get an error while passing this model instead of the en-us model - Folder 'model' does not contain model files. Make sure you specified the model path properly in Model constructor. If you are not sure about relative path, use absolute path specification.

base21 avatar May 23 '22 06:05 base21

@nshmyrev could you give an example on how to use the punctuation model? Might be doing something completely wrong but I get an error while passing this model instead of the en-us model - Folder 'model' does not contain model files. Make sure you specified the model path properly in Model constructor. If you are not sure about relative path, use absolute path specification.

I see the same thing here - that link looks like a self contained recasepunc model, was that the intention? It isn't a drop in replacement for other vosk models right? It would be pretty great if that could work!

bvasoff avatar May 30 '22 18:05 bvasoff

@nshmyrev could you give an example on how to use the punctuation model? Might be doing something completely wrong but I get an error while passing this model instead of the en-us model - Folder 'model' does not contain model files. Make sure you specified the model path properly in Model constructor. If you are not sure about relative path, use absolute path specification.

@nshmyrev I have the same question. Could you please give the steps/example?

AnkS4 avatar Jun 24 '22 15:06 AnkS4

It looks like those punctuation models are for use with recasepunc (not Vosk), so you would have to use it as the checkpoint file. Something like:

python recasepunc.py predict checkpoint/path_to_checkpoint_model < input.txt > output.txt

szeidner avatar Jun 24 '22 15:06 szeidner

Hello, is the generation of a model with Italian punctuation planned? The Italian model available at the link works very well, but all transcriptions are lowercase and without punctuation.

CoffeePerry avatar Sep 07 '22 19:09 CoffeePerry

Hello, is the generation of a model with Italian punctuation planned?

You can easily train it yourself probably with recasepunc

nshmyrev avatar Sep 07 '22 19:09 nshmyrev

I proceeded to train an Italian model of recasepunc. Is there a way to train an Italian model of Vosk (for example this) on the basis of that of recasepunc?

CoffeePerry avatar Sep 15 '22 20:09 CoffeePerry

I don't understand "train on the basis"

nshmyrev avatar Sep 16 '22 07:09 nshmyrev

Sorry, I meant to understand how I could combine a Vosk model with the recasepunc model (as I think you have been done with this).

CoffeePerry avatar Sep 16 '22 07:09 CoffeePerry

You just feed recognized text into punctuation model and get punctuated text.

nshmyrev avatar Sep 16 '22 07:09 nshmyrev

I apologize again. For a moment I assumed that models like this were a Vosk model (like this) which also recognized punctuation (without dependencies on recasepunc), but after downloading it (vosk-recasepunc-en-0.22.zip) and consulting the content, I realized that it is just as you tell me: the text is simply transcribed with the Vosk model then punctuation is added with the recasepunc model. Thanks for your patience.

CoffeePerry avatar Sep 16 '22 08:09 CoffeePerry

Latest recommendation is https://github.com/benob/recasepunc

@nshmyrev just curiosity, do you have more recommendations? (especially in C/C++)

(the last update in this repo was 2y ago 😕)

silvioprog avatar Mar 13 '24 22:03 silvioprog