Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get JSON output? #3

Closed
Ajayrajpurohit opened this issue Oct 21, 2021 · 2 comments
Closed

How to get JSON output? #3

Ajayrajpurohit opened this issue Oct 21, 2021 · 2 comments

Comments

@Ajayrajpurohit
Copy link

The transcript right now only sends out a long string. But on the same model I have tested manually with the --json flag and it gave time-slots word by word. Is it possible to do it in this REST API??

@zelo
Copy link
Owner

zelo commented Oct 25, 2021

I'm not sure right now what --json flags triggers in deepspeech cli client but I would start by replacing invocation of stt method with sttWithMetadata here

result = self.model.stt(audio_buffer=audio)
. This may also require casting resulting Metadata objects to json.
More details here: https://deepspeech.readthedocs.io/en/latest/Python-API.html#native_client.python.Model.sttWithMetadata

@Ajayrajpurohit
Copy link
Author

Thanks, Dude (@zelo)!!

I have created a pull request after implementing some functional changes (Pull 4). Please do a review and if you can help me get the JSON Object as a response it'll be great. Have a Nice Day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants