@@ -256,11 +256,12 @@ public class SpeechToText {
256
256
- parameter audio: The audio to transcribe in the format specified by the `Content-Type` header.
257
257
- parameter contentType: The type of the input.
258
258
- parameter model: The identifier of the model that is to be used for the recognition request.
259
- - parameter customizationID : The customization ID (GUID) of a custom language model that is to be used with the
260
- recognition request. The base model of the specified custom language model must match the model specified with
261
- the `model` parameter. You must make the request with service credentials created for the instance of the service
262
- that owns the custom model. By default, no custom language model is used. See [Custom
259
+ - parameter languageCustomizationID : The customization ID (GUID) of a custom language model that is to be used
260
+ with the recognition request. The base model of the specified custom language model must match the model
261
+ specified with the `model` parameter. You must make the request with service credentials created for the instance
262
+ of the service that owns the custom model. By default, no custom language model is used. See [Custom
263
263
models](https://console.bluemix.net/docs/services/speech-to-text/input.html#custom).
264
+ **Note:** Use this parameter instead of the deprecated `customization_id` parameter.
264
265
- parameter acousticCustomizationID: The customization ID (GUID) of a custom acoustic model that is to be used
265
266
with the recognition request. The base model of the specified custom acoustic model must match the model
266
267
specified with the `model` parameter. You must make the request with service credentials created for the instance
@@ -325,13 +326,17 @@ public class SpeechToText {
325
326
parameter. To determine whether a language model supports speaker labels, use the **Get models** method and check
326
327
that the attribute `speaker_labels` is set to `true`. See [Speaker
327
328
labels](https://console.bluemix.net/docs/services/speech-to-text/output.html#speaker_labels).
329
+ - parameter customizationID: **Deprecated.** Use the `language_customization_id` parameter to specify the
330
+ customization ID (GUID) of a custom language model that is to be used with the recognition request. Do not
331
+ specify both parameters with a request.
328
332
- parameter headers: A dictionary of request headers to be sent with this request.
329
333
- parameter failure: A function executed if an error occurs.
330
334
- parameter success: A function executed with the successful result.
331
335
*/
332
336
public func recognize(
333
337
model: String ? = nil ,
334
338
customizationID: String ? = nil ,
339
+ languageCustomizationID: String ? = nil ,
335
340
acousticCustomizationID: String ? = nil ,
336
341
baseModelVersion: String ? = nil ,
337
342
customizationWeight: Double ? = nil ,
@@ -368,8 +373,8 @@ public class SpeechToText {
368
373
let queryParameter = URLQueryItem ( name: " model " , value: model)
369
374
queryParameters. append ( queryParameter)
370
375
}
371
- if let customizationID = customizationID {
372
- let queryParameter = URLQueryItem ( name: " customization_id " , value: customizationID )
376
+ if let languageCustomizationID = languageCustomizationID {
377
+ let queryParameter = URLQueryItem ( name: " language_customization_id " , value: languageCustomizationID )
373
378
queryParameters. append ( queryParameter)
374
379
}
375
380
if let acousticCustomizationID = acousticCustomizationID {
@@ -424,6 +429,10 @@ public class SpeechToText {
424
429
let queryParameter = URLQueryItem ( name: " speaker_labels " , value: " \( speakerLabels) " )
425
430
queryParameters. append ( queryParameter)
426
431
}
432
+ if let customizationID = customizationID {
433
+ let queryParameter = URLQueryItem ( name: " customization_id " , value: customizationID)
434
+ queryParameters. append ( queryParameter)
435
+ }
427
436
428
437
// construct REST request
429
438
let request = RestRequest (
@@ -662,11 +671,12 @@ public class SpeechToText {
662
671
- parameter resultsTtl: The number of minutes for which the results are to be available after the job has
663
672
finished. If not delivered via a callback, the results must be retrieved within this time. Omit the parameter to
664
673
use a time to live of one week. The parameter is valid with or without a callback URL.
665
- - parameter customizationID : The customization ID (GUID) of a custom language model that is to be used with the
666
- recognition request. The base model of the specified custom language model must match the model specified with
667
- the `model` parameter. You must make the request with service credentials created for the instance of the service
668
- that owns the custom model. By default, no custom language model is used. See [Custom
674
+ - parameter languageCustomizationID : The customization ID (GUID) of a custom language model that is to be used
675
+ with the recognition request. The base model of the specified custom language model must match the model
676
+ specified with the `model` parameter. You must make the request with service credentials created for the instance
677
+ of the service that owns the custom model. By default, no custom language model is used. See [Custom
669
678
models](https://console.bluemix.net/docs/services/speech-to-text/input.html#custom).
679
+ **Note:** Use this parameter instead of the deprecated `customization_id` parameter.
670
680
- parameter acousticCustomizationID: The customization ID (GUID) of a custom acoustic model that is to be used
671
681
with the recognition request. The base model of the specified custom acoustic model must match the model
672
682
specified with the `model` parameter. You must make the request with service credentials created for the instance
@@ -731,6 +741,9 @@ public class SpeechToText {
731
741
parameter. To determine whether a language model supports speaker labels, use the **Get models** method and check
732
742
that the attribute `speaker_labels` is set to `true`. See [Speaker
733
743
labels](https://console.bluemix.net/docs/services/speech-to-text/output.html#speaker_labels).
744
+ - parameter customizationID: **Deprecated.** Use the `language_customization_id` parameter to specify the
745
+ customization ID (GUID) of a custom language model that is to be used with the recognition request. Do not
746
+ specify both parameters with a request.
734
747
- parameter headers: A dictionary of request headers to be sent with this request.
735
748
- parameter failure: A function executed if an error occurs.
736
749
- parameter success: A function executed with the successful result.
@@ -744,6 +757,7 @@ public class SpeechToText {
744
757
userToken: String ? = nil ,
745
758
resultsTtl: Int ? = nil ,
746
759
customizationID: String ? = nil ,
760
+ languageCustomizationID: String ? = nil ,
747
761
acousticCustomizationID: String ? = nil ,
748
762
baseModelVersion: String ? = nil ,
749
763
customizationWeight: Double ? = nil ,
@@ -794,8 +808,8 @@ public class SpeechToText {
794
808
let queryParameter = URLQueryItem ( name: " results_ttl " , value: " \( resultsTtl) " )
795
809
queryParameters. append ( queryParameter)
796
810
}
797
- if let customizationID = customizationID {
798
- let queryParameter = URLQueryItem ( name: " customization_id " , value: customizationID )
811
+ if let languageCustomizationID = languageCustomizationID {
812
+ let queryParameter = URLQueryItem ( name: " language_customization_id " , value: languageCustomizationID )
799
813
queryParameters. append ( queryParameter)
800
814
}
801
815
if let acousticCustomizationID = acousticCustomizationID {
@@ -850,6 +864,10 @@ public class SpeechToText {
850
864
let queryParameter = URLQueryItem ( name: " speaker_labels " , value: " \( speakerLabels) " )
851
865
queryParameters. append ( queryParameter)
852
866
}
867
+ if let customizationID = customizationID {
868
+ let queryParameter = URLQueryItem ( name: " customization_id " , value: customizationID)
869
+ queryParameters. append ( queryParameter)
870
+ }
853
871
854
872
// construct REST request
855
873
let request = RestRequest (
0 commit comments