@@ -45,7 +45,6 @@ def recognize_using_websocket(self,
4545 speaker_labels = None ,
4646 http_proxy_host = None ,
4747 http_proxy_port = None ,
48- customization_id = None ,
4948 grammar_name = None ,
5049 redaction = None ,
5150 processing_metrics = None ,
@@ -56,6 +55,7 @@ def recognize_using_websocket(self,
5655 speech_detector_sensitivity = None ,
5756 background_audio_suppression = None ,
5857 low_latency = None ,
58+ character_insertion_bias : float = None ,
5959 ** kwargs ):
6060 """
6161 Sends audio for speech recognition using web sockets.
@@ -190,10 +190,6 @@ def recognize_using_websocket(self,
190190 labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speaker-labels).
191191 :param str http_proxy_host: http proxy host name.
192192 :param str http_proxy_port: http proxy port. If not set, set to 80.
193- :param str customization_id: (optional) **Deprecated.** Use the
194- `language_customization_id` parameter to specify the customization ID
195- (GUID) of a custom language model that is to be used with the recognition
196- request. Do not specify both parameters with a request.
197193 :param str grammar_name: (optional) The name of a grammar that is to be
198194 used with the recognition request. If you specify a grammar, you must also
199195 use the `language_customization_id` parameter to specify the name of the
@@ -287,6 +283,28 @@ def recognize_using_websocket(self,
287283 for next-generation models.
288284 * For more information about the `low_latency` parameter, see [Low
289285 latency](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-interim#low-latency).
286+ :param float character_insertion_bias: (optional) For next-generation
287+ `Multimedia` and `Telephony` models, an indication of whether the service
288+ is biased to recognize shorter or longer strings of characters when
289+ developing transcription hypotheses. By default, the service is optimized
290+ for each individual model to balance its recognition of strings of
291+ different lengths. The model-specific bias is equivalent to 0.0.
292+ The value that you specify represents a change from a model's default bias.
293+ The allowable range of values is -1.0 to 1.0.
294+ * Negative values bias the service to favor hypotheses with shorter strings
295+ of characters.
296+ * Positive values bias the service to favor hypotheses with longer strings
297+ of characters.
298+ As the value approaches -1.0 or 1.0, the impact of the parameter becomes
299+ more pronounced. To determine the most effective value for your scenario,
300+ start by setting the value of the parameter to a small increment, such as
301+ -0.1, -0.05, 0.05, or 0.1, and assess how the value impacts the
302+ transcription results. Then experiment with different values as necessary,
303+ adjusting the value by small increments.
304+ The parameter is not available for previous-generation `Broadband` and
305+ `Narrowband` models.
306+ See [Character insertion
307+ bias](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsing#insertion-bias).
290308 :param dict headers: A `dict` containing the request headers
291309 :return: A `dict` containing the `SpeechRecognitionResults` response.
292310 :rtype: dict
@@ -321,7 +339,6 @@ def recognize_using_websocket(self,
321339
322340 params = {
323341 'model' : model ,
324- 'customization_id' : customization_id ,
325342 'acoustic_customization_id' : acoustic_customization_id ,
326343 'base_model_version' : base_model_version ,
327344 'language_customization_id' : language_customization_id
@@ -353,7 +370,8 @@ def recognize_using_websocket(self,
353370 'split_transcript_at_phrase_end' : split_transcript_at_phrase_end ,
354371 'speech_detector_sensitivity' : speech_detector_sensitivity ,
355372 'background_audio_suppression' : background_audio_suppression ,
356- 'low_latency' : low_latency
373+ 'low_latency' : low_latency ,
374+ 'character_insertion_bias' : character_insertion_bias
357375 }
358376 options = {k : v for k , v in options .items () if v is not None }
359377 request ['options' ] = options
0 commit comments