Skip to content

Commit

Permalink
Adds Parameters use_enhanced and model to GoogleSpeechAPI docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
HideyoshiNakazone authored Apr 26, 2024
1 parent c845904 commit 8e0fa40
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions speech_recognition/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,10 @@ def recognize_google_cloud(self, audio_data, credentials_json=None, language="en
If ``preferred_phrases`` is an iterable of phrase strings, those given phrases will be more likely to be recognized over similar-sounding alternatives. This is useful for things like keyword/command recognition or adding new phrases that aren't in Google's vocabulary. Note that the API imposes certain `restrictions on the list of phrase strings <https://cloud.google.com/speech/limits#content>`__.
The ``use_enhanced`` is a boolean option that sets a flag with the same name on the Google Cloud Speech API, it will make the API uses the enhanced version of the model. More information can be found in the `Google Cloud Speech API documentation <https://cloud.google.com/speech-to-text/docs/enhanced-models>` __.
Furthermore, you can use the option ``model`` to set your desired model, the Python Google Speech API makes available the following options: 'command_and_search', 'phone_call', 'video', 'default', 'medical_conversation', 'medical_dictation'. More information can be found in the `Google Cloud Speech API documentation <https://cloud.google.com/speech-to-text/docs/transcription-model>` __.
Returns the most likely transcription if ``show_all`` is False (the default). Otherwise, returns the raw API response as a JSON dictionary.
Raises a ``speech_recognition.UnknownValueError`` exception if the speech is unintelligible. Raises a ``speech_recognition.RequestError`` exception if the speech recognition operation failed, if the credentials aren't valid, or if there is no Internet connection.
Expand Down

0 comments on commit 8e0fa40

Please sign in to comment.