|
1 | 1 | /*
|
2 |
| - * (C) Copyright IBM Corp. 2016, 2022. |
| 2 | + * (C) Copyright IBM Corp. 2022. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
5 | 5 | * the License. You may obtain a copy of the License at
|
|
12 | 12 | */
|
13 | 13 |
|
14 | 14 | /*
|
15 |
| - * IBM OpenAPI SDK Code Generator Version: 3.46.0-a4e29da0-20220224-210428 |
| 15 | + * IBM OpenAPI SDK Code Generator Version: 3.53.0-9710cac3-20220713-193508 |
16 | 16 | */
|
17 | 17 |
|
18 | 18 | package com.ibm.watson.speech_to_text.v1;
|
@@ -329,9 +329,15 @@ public ServiceCall<SpeechModel> getModel(GetModelOptions getModelOptions) {
|
329 | 329 | * accuracy.
|
330 | 330 | *
|
331 | 331 | * <p>You specify a next-generation model by using the `model` query parameter, as you do a
|
332 |
| - * previous-generation model. Many next-generation models also support the `low_latency` |
333 |
| - * parameter, which is not available with previous-generation models. Next-generation models do |
334 |
| - * not support all of the parameters that are available for use with previous-generation models. |
| 332 | + * previous-generation model. Most next-generation models support the `low_latency` parameter, and |
| 333 | + * all next-generation models support the `character_insertion_bias` parameter. These parameters |
| 334 | + * are not available with previous-generation models. |
| 335 | + * |
| 336 | + * <p>Next-generation models do not support all of the speech recognition parameters that are |
| 337 | + * available for use with previous-generation models. Next-generation models do not support the |
| 338 | + * following parameters: * `acoustic_customization_id` * `keywords` and `keywords_threshold` * |
| 339 | + * `max_alternatives` * `processing_metrics` and `processing_metrics_interval` * |
| 340 | + * `word_alternatives_threshold` |
335 | 341 | *
|
336 | 342 | * <p>**Important:** Effective 15 March 2022, previous-generation models for all languages other
|
337 | 343 | * than Arabic and Japanese are deprecated. The deprecated models remain available until 15
|
@@ -429,9 +435,6 @@ public ServiceCall<SpeechRecognitionResults> recognize(RecognizeOptions recogniz
|
429 | 435 | if (recognizeOptions.speakerLabels() != null) {
|
430 | 436 | builder.query("speaker_labels", String.valueOf(recognizeOptions.speakerLabels()));
|
431 | 437 | }
|
432 |
| - if (recognizeOptions.customizationId() != null) { |
433 |
| - builder.query("customization_id", String.valueOf(recognizeOptions.customizationId())); |
434 |
| - } |
435 | 438 | if (recognizeOptions.grammarName() != null) {
|
436 | 439 | builder.query("grammar_name", String.valueOf(recognizeOptions.grammarName()));
|
437 | 440 | }
|
@@ -463,6 +466,10 @@ public ServiceCall<SpeechRecognitionResults> recognize(RecognizeOptions recogniz
|
463 | 466 | if (recognizeOptions.lowLatency() != null) {
|
464 | 467 | builder.query("low_latency", String.valueOf(recognizeOptions.lowLatency()));
|
465 | 468 | }
|
| 469 | + if (recognizeOptions.characterInsertionBias() != null) { |
| 470 | + builder.query( |
| 471 | + "character_insertion_bias", String.valueOf(recognizeOptions.characterInsertionBias())); |
| 472 | + } |
466 | 473 | builder.bodyContent(recognizeOptions.contentType(), null, null, recognizeOptions.audio());
|
467 | 474 | ResponseConverter<SpeechRecognitionResults> responseConverter =
|
468 | 475 | ResponseConverterUtils.getValue(
|
@@ -702,9 +709,15 @@ public ServiceCall<Void> unregisterCallback(UnregisterCallbackOptions unregister
|
702 | 709 | * accuracy.
|
703 | 710 | *
|
704 | 711 | * <p>You specify a next-generation model by using the `model` query parameter, as you do a
|
705 |
| - * previous-generation model. Many next-generation models also support the `low_latency` |
706 |
| - * parameter, which is not available with previous-generation models. Next-generation models do |
707 |
| - * not support all of the parameters that are available for use with previous-generation models. |
| 712 | + * previous-generation model. Most next-generation models support the `low_latency` parameter, and |
| 713 | + * all next-generation models support the `character_insertion_bias` parameter. These parameters |
| 714 | + * are not available with previous-generation models. |
| 715 | + * |
| 716 | + * <p>Next-generation models do not support all of the speech recognition parameters that are |
| 717 | + * available for use with previous-generation models. Next-generation models do not support the |
| 718 | + * following parameters: * `acoustic_customization_id` * `keywords` and `keywords_threshold` * |
| 719 | + * `max_alternatives` * `processing_metrics` and `processing_metrics_interval` * |
| 720 | + * `word_alternatives_threshold` |
708 | 721 | *
|
709 | 722 | * <p>**Important:** Effective 15 March 2022, previous-generation models for all languages other
|
710 | 723 | * than Arabic and Japanese are deprecated. The deprecated models remain available until 15
|
@@ -795,9 +808,6 @@ public ServiceCall<RecognitionJob> createJob(CreateJobOptions createJobOptions)
|
795 | 808 | if (createJobOptions.speakerLabels() != null) {
|
796 | 809 | builder.query("speaker_labels", String.valueOf(createJobOptions.speakerLabels()));
|
797 | 810 | }
|
798 |
| - if (createJobOptions.customizationId() != null) { |
799 |
| - builder.query("customization_id", String.valueOf(createJobOptions.customizationId())); |
800 |
| - } |
801 | 811 | if (createJobOptions.grammarName() != null) {
|
802 | 812 | builder.query("grammar_name", String.valueOf(createJobOptions.grammarName()));
|
803 | 813 | }
|
@@ -837,6 +847,10 @@ public ServiceCall<RecognitionJob> createJob(CreateJobOptions createJobOptions)
|
837 | 847 | if (createJobOptions.lowLatency() != null) {
|
838 | 848 | builder.query("low_latency", String.valueOf(createJobOptions.lowLatency()));
|
839 | 849 | }
|
| 850 | + if (createJobOptions.characterInsertionBias() != null) { |
| 851 | + builder.query( |
| 852 | + "character_insertion_bias", String.valueOf(createJobOptions.characterInsertionBias())); |
| 853 | + } |
840 | 854 | builder.bodyContent(createJobOptions.contentType(), null, null, createJobOptions.audio());
|
841 | 855 | ResponseConverter<RecognitionJob> responseConverter =
|
842 | 856 | ResponseConverterUtils.getValue(
|
@@ -1217,6 +1231,9 @@ public ServiceCall<TrainingResponse> trainLanguageModel(
|
1217 | 1231 | builder.query(
|
1218 | 1232 | "customization_weight", String.valueOf(trainLanguageModelOptions.customizationWeight()));
|
1219 | 1233 | }
|
| 1234 | + if (trainLanguageModelOptions.strict() != null) { |
| 1235 | + builder.query("strict", String.valueOf(trainLanguageModelOptions.strict())); |
| 1236 | + } |
1220 | 1237 | ResponseConverter<TrainingResponse> responseConverter =
|
1221 | 1238 | ResponseConverterUtils.getValue(
|
1222 | 1239 | new com.google.gson.reflect.TypeToken<TrainingResponse>() {}.getType());
|
@@ -1374,7 +1391,7 @@ public ServiceCall<Corpora> listCorpora(ListCorporaOptions listCorporaOptions) {
|
1374 | 1391 | * corpus, you must validate the words resource to ensure that each OOV word's definition is
|
1375 | 1392 | * complete and valid. You can use the [List custom words](#listwords) method to examine the words
|
1376 | 1393 | * resource. You can use other words method to eliminate typos and modify how words are pronounced
|
1377 |
| - * as needed. |
| 1394 | + * and displayed as needed. |
1378 | 1395 | *
|
1379 | 1396 | * <p>To add a corpus file that has the same name as an existing corpus, set the `allow_overwrite`
|
1380 | 1397 | * parameter to `true`; otherwise, the request fails. Overwriting an existing corpus causes the
|
@@ -1520,7 +1537,10 @@ public ServiceCall<Void> deleteCorpus(DeleteCorpusOptions deleteCorpusOptions) {
|
1520 | 1537 | * from the custom model's words resource, only custom words that were added or modified by the
|
1521 | 1538 | * user, or, _for a custom model that is based on a previous-generation model_, only
|
1522 | 1539 | * out-of-vocabulary (OOV) words that were extracted from corpora or are recognized by grammars.
|
1523 |
| - * You can also indicate the order in which the service is to return words; by default, the |
| 1540 | + * _For a custom model that is based on a next-generation model_, you can list all words or only |
| 1541 | + * those words that were added directly by a user, which return the same results. |
| 1542 | + * |
| 1543 | + * <p>You can also indicate the order in which the service is to return words; by default, the |
1524 | 1544 | * service lists words in ascending alphabetical order. You must use credentials for the instance
|
1525 | 1545 | * of the service that owns a model to list information about its words.
|
1526 | 1546 | *
|
@@ -1580,15 +1600,15 @@ public ServiceCall<Words> listWords(ListWordsOptions listWordsOptions) {
|
1580 | 1600 | * for each word. * The `display_as` field provides a different way of spelling the word in a
|
1581 | 1601 | * transcript. Use the parameter when you want the word to appear different from its usual
|
1582 | 1602 | * representation or from its spelling in training data. For example, you might indicate that the
|
1583 |
| - * word `IBM` is to be displayed as `IBM&trade;`. * The `sounds_like` field, _which can be |
1584 |
| - * used only with a custom model that is based on a previous-generation model_, provides an array |
| 1603 | + * word `IBM` is to be displayed as `IBM&trade;`. * The `sounds_like` field provides an array |
1585 | 1604 | * of one or more pronunciations for the word. Use the parameter to specify how the word can be
|
1586 | 1605 | * pronounced by users. Use the parameter for words that are difficult to pronounce, foreign
|
1587 | 1606 | * words, acronyms, and so on. For example, you might specify that the word `IEEE` can sound like
|
1588 |
| - * `i triple e`. You can specify a maximum of five sounds-like pronunciations for a word. If you |
1589 |
| - * omit the `sounds_like` field, the service attempts to set the field to its pronunciation of the |
1590 |
| - * word. It cannot generate a pronunciation for all words, so you must review the word's |
1591 |
| - * definition to ensure that it is complete and valid. |
| 1607 | + * `I triple E`. You can specify a maximum of five sounds-like pronunciations for a word. _For a |
| 1608 | + * custom model that is based on a previous-generation model_, if you omit the `sounds_like` |
| 1609 | + * field, the service attempts to set the field to its pronunciation of the word. It cannot |
| 1610 | + * generate a pronunciation for all words, so you must review the word's definition to ensure that |
| 1611 | + * it is complete and valid. |
1592 | 1612 | *
|
1593 | 1613 | * <p>If you add a custom word that already exists in the words resource for the custom model, the
|
1594 | 1614 | * new definition overwrites the existing data for the word. If the service encounters an error
|
@@ -1671,15 +1691,15 @@ public ServiceCall<Void> addWords(AddWordsOptions addWordsOptions) {
|
1671 | 1691 | * `sounds_like` fields for the word. * The `display_as` field provides a different way of
|
1672 | 1692 | * spelling the word in a transcript. Use the parameter when you want the word to appear different
|
1673 | 1693 | * from its usual representation or from its spelling in training data. For example, you might
|
1674 |
| - * indicate that the word `IBM` is to be displayed as `IBM&trade;`. * The `sounds_like` field, |
1675 |
| - * _which can be used only with a custom model that is based on a previous-generation model_, |
| 1694 | + * indicate that the word `IBM` is to be displayed as `IBM&trade;`. * The `sounds_like` field |
1676 | 1695 | * provides an array of one or more pronunciations for the word. Use the parameter to specify how
|
1677 | 1696 | * the word can be pronounced by users. Use the parameter for words that are difficult to
|
1678 | 1697 | * pronounce, foreign words, acronyms, and so on. For example, you might specify that the word
|
1679 | 1698 | * `IEEE` can sound like `i triple e`. You can specify a maximum of five sounds-like
|
1680 |
| - * pronunciations for a word. If you omit the `sounds_like` field, the service attempts to set the |
1681 |
| - * field to its pronunciation of the word. It cannot generate a pronunciation for all words, so |
1682 |
| - * you must review the word's definition to ensure that it is complete and valid. |
| 1699 | + * pronunciations for a word. _For custom models that are based on previous-generation models_, if |
| 1700 | + * you omit the `sounds_like` field, the service attempts to set the field to its pronunciation of |
| 1701 | + * the word. It cannot generate a pronunciation for all words, so you must review the word's |
| 1702 | + * definition to ensure that it is complete and valid. |
1683 | 1703 | *
|
1684 | 1704 | * <p>If you add a custom word that already exists in the words resource for the custom model, the
|
1685 | 1705 | * new definition overwrites the existing data for the word. If the service encounters an error,
|
@@ -2269,6 +2289,9 @@ public ServiceCall<TrainingResponse> trainAcousticModel(
|
2269 | 2289 | "custom_language_model_id",
|
2270 | 2290 | String.valueOf(trainAcousticModelOptions.customLanguageModelId()));
|
2271 | 2291 | }
|
| 2292 | + if (trainAcousticModelOptions.strict() != null) { |
| 2293 | + builder.query("strict", String.valueOf(trainAcousticModelOptions.strict())); |
| 2294 | + } |
2272 | 2295 | ResponseConverter<TrainingResponse> responseConverter =
|
2273 | 2296 | ResponseConverterUtils.getValue(
|
2274 | 2297 | new com.google.gson.reflect.TypeToken<TrainingResponse>() {}.getType());
|
|
0 commit comments