-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Adds Parameter use_enhanced and model to GoogleCloudSpeech (Fix #734) #735
Adds Parameter use_enhanced and model to GoogleCloudSpeech (Fix #734) #735
Conversation
Adds the parameters use_enhanced and model to the recognize_google_cloud method for more customizable options for the user and better results in specific cases
Hello @ftnext, is there any interest in this feature? It doesn't break any of GoogleCloudSpeech python api, only extends it. I'm currently already using this implementation in the company i work in, but would love to have this feature merged. |
Looks good overall, but would it be possible to document these parameters in the docs for that function? If so, happy to merge this! |
052dec3
to
8e0fa40
Compare
@Uberi, thanks a lot! I added the parameters to the Docstring of the method |
@HideyoshiNakazone Thank you very much for this pull request! I'm very sorry to respond too late. In my opinion, it seems to be better to introduce keyword arguments (a.k.a. Certainly, adding I think it would be preferable for Cloud Speech API-specific arguments to be specified as variant keyword arguments. def recognize_google_cloud(self, audio_data, credentials_json=None, language="en-US", preferred_phrases=None, show_all=False, **api_params):
"""
If ``preferred_phrases`` is an iterable of phrase strings, ...
api_params: Cloud Speech API-specific parameters as dict (optional)
The ``use_enhanced`` is a boolean option ...
Furthermore, you can use the option ``model`` to set your desired model,
Returns the most likely transcription if ``show_all`` is False (the default).
"""
config = {
'encoding': speech.RecognitionConfig.AudioEncoding.FLAC,
'sample_rate_hertz': audio_data.sample_rate,
'language_code': language,
**api_params,
} (It seems that |
fc26183
to
e82fd4d
Compare
This implementation is needed for the configuration of Cloud Speech API-specific parameters. This implementation only validates and creates assertions for the two most used params: use_enhanced and model.
e82fd4d
to
4be8026
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
May I make a simple correction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Adds the parameters use_enhanced and model to the recognize_google_cloud method for more customizable options for the user and better results in specific cases