|
1 | 1 | /* |
2 | | - * (C) Copyright IBM Corp. 2016, 2023. |
| 2 | + * (C) Copyright IBM Corp. 2024. |
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.64.1-cee95189-20230124-211647 |
| 15 | + * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 |
16 | 16 | */ |
17 | 17 |
|
18 | 18 | package com.ibm.watson.speech_to_text.v1; |
@@ -482,6 +482,10 @@ public ServiceCall<SpeechRecognitionResults> recognize(RecognizeOptions recogniz |
482 | 482 | if (recognizeOptions.smartFormatting() != null) { |
483 | 483 | builder.query("smart_formatting", String.valueOf(recognizeOptions.smartFormatting())); |
484 | 484 | } |
| 485 | + if (recognizeOptions.smartFormattingVersion() != null) { |
| 486 | + builder.query( |
| 487 | + "smart_formatting_version", String.valueOf(recognizeOptions.smartFormattingVersion())); |
| 488 | + } |
485 | 489 | if (recognizeOptions.speakerLabels() != null) { |
486 | 490 | builder.query("speaker_labels", String.valueOf(recognizeOptions.speakerLabels())); |
487 | 491 | } |
@@ -798,6 +802,10 @@ public ServiceCall<RecognitionJob> createJob(CreateJobOptions createJobOptions) |
798 | 802 | if (createJobOptions.smartFormatting() != null) { |
799 | 803 | builder.query("smart_formatting", String.valueOf(createJobOptions.smartFormatting())); |
800 | 804 | } |
| 805 | + if (createJobOptions.smartFormattingVersion() != null) { |
| 806 | + builder.query( |
| 807 | + "smart_formatting_version", String.valueOf(createJobOptions.smartFormattingVersion())); |
| 808 | + } |
801 | 809 | if (createJobOptions.speakerLabels() != null) { |
802 | 810 | builder.query("speaker_labels", String.valueOf(createJobOptions.speakerLabels())); |
803 | 811 | } |
@@ -1184,10 +1192,16 @@ public ServiceCall<Void> deleteLanguageModel( |
1184 | 1192 | * cannot accept subsequent training requests or requests to add new resources until the existing |
1185 | 1193 | * request completes. |
1186 | 1194 | * |
1187 | | - * <p>**See also:** * [Train the custom language |
| 1195 | + * <p>For custom models that are based on improved base language models, training also performs an |
| 1196 | + * automatic upgrade to a newer version of the base model. You do not need to use the [Upgrade a |
| 1197 | + * custom language model](#upgradelanguagemodel) method to perform the upgrade. |
| 1198 | + * |
| 1199 | + * <p>**See also:** * [Language support for |
| 1200 | + * customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-support) * |
| 1201 | + * [Train the custom language |
1188 | 1202 | * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreate#trainModel-language) |
1189 | | - * * [Language support for |
1190 | | - * customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-support) |
| 1203 | + * * [Upgrading custom language models that are based on improved next-generation |
| 1204 | + * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-upgrade#custom-upgrade-language-ng) |
1191 | 1205 | * |
1192 | 1206 | * <p>### Training failures |
1193 | 1207 | * |
@@ -1229,6 +1243,9 @@ public ServiceCall<TrainingResponse> trainLanguageModel( |
1229 | 1243 | if (trainLanguageModelOptions.strict() != null) { |
1230 | 1244 | builder.query("strict", String.valueOf(trainLanguageModelOptions.strict())); |
1231 | 1245 | } |
| 1246 | + if (trainLanguageModelOptions.force() != null) { |
| 1247 | + builder.query("force", String.valueOf(trainLanguageModelOptions.force())); |
| 1248 | + } |
1232 | 1249 | ResponseConverter<TrainingResponse> responseConverter = |
1233 | 1250 | ResponseConverterUtils.getValue( |
1234 | 1251 | new com.google.gson.reflect.TypeToken<TrainingResponse>() {}.getType()); |
@@ -1291,10 +1308,16 @@ public ServiceCall<Void> resetLanguageModel(ResetLanguageModelOptions resetLangu |
1291 | 1308 | * complete, the model resumes the status that it had prior to upgrade. The service cannot accept |
1292 | 1309 | * subsequent requests for the model until the upgrade completes. |
1293 | 1310 | * |
1294 | | - * <p>**See also:** * [Upgrading a custom language |
| 1311 | + * <p>For custom models that are based on improved base language models, the [Train a custom |
| 1312 | + * language model](#trainlanguagemodel) method also performs an automatic upgrade to a newer |
| 1313 | + * version of the base model. You do not need to use the upgrade method. |
| 1314 | + * |
| 1315 | + * <p>**See also:** * [Language support for |
| 1316 | + * customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-support) * |
| 1317 | + * [Upgrading a custom language |
1295 | 1318 | * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-upgrade#custom-upgrade-language) |
1296 | | - * * [Language support for |
1297 | | - * customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-support). |
| 1319 | + * * [Upgrading custom language models that are based on improved next-generation |
| 1320 | + * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-upgrade#custom-upgrade-language-ng). |
1298 | 1321 | * |
1299 | 1322 | * @param upgradeLanguageModelOptions the {@link UpgradeLanguageModelOptions} containing the |
1300 | 1323 | * options for the call |
@@ -1436,10 +1459,10 @@ public ServiceCall<Void> addCorpus(AddCorpusOptions addCorpusOptions) { |
1436 | 1459 | if (addCorpusOptions.allowOverwrite() != null) { |
1437 | 1460 | builder.query("allow_overwrite", String.valueOf(addCorpusOptions.allowOverwrite())); |
1438 | 1461 | } |
1439 | | - |
| 1462 | + |
1440 | 1463 | // hand edit replacement for corpus file serialization |
1441 | 1464 | builder.body(RequestUtils.inputStreamBody(addCorpusOptions.corpusFile(), "text/plain")); |
1442 | | - |
| 1465 | + |
1443 | 1466 | ResponseConverter<Void> responseConverter = ResponseConverterUtils.getVoid(); |
1444 | 1467 | return createServiceCall(builder.build(), responseConverter); |
1445 | 1468 | } |
@@ -1601,7 +1624,13 @@ public ServiceCall<Words> listWords(ListWordsOptions listWordsOptions) { |
1601 | 1624 | * custom model that is based on a previous-generation model_, if you omit the `sounds_like` |
1602 | 1625 | * field, the service attempts to set the field to its pronunciation of the word. It cannot |
1603 | 1626 | * generate a pronunciation for all words, so you must review the word's definition to ensure that |
1604 | | - * it is complete and valid. |
| 1627 | + * it is complete and valid. * The `mapping_only` field provides parameter for custom words. You |
| 1628 | + * can use the 'mapping_only' key in custom words as a form of post processing. This key parameter |
| 1629 | + * has a boolean value to determine whether 'sounds_like' (for non-Japanese models) or word (for |
| 1630 | + * Japanese) is not used for the model fine-tuning, but for the replacement for 'display_as'. This |
| 1631 | + * feature helps you when you use custom words exclusively to map 'sounds_like' (or word) to |
| 1632 | + * 'display_as' value. When you use custom words solely for post-processing purposes that does not |
| 1633 | + * need fine-tuning. |
1605 | 1634 | * |
1606 | 1635 | * <p>If you add a custom word that already exists in the words resource for the custom model, the |
1607 | 1636 | * new definition overwrites the existing data for the word. If the service encounters an error |
@@ -1733,6 +1762,12 @@ public ServiceCall<Void> addWord(AddWordOptions addWordOptions) { |
1733 | 1762 | if (addWordOptions.word() != null) { |
1734 | 1763 | contentJson.addProperty("word", addWordOptions.word()); |
1735 | 1764 | } |
| 1765 | + if (addWordOptions.mappingOnly() != null) { |
| 1766 | + contentJson.add( |
| 1767 | + "mapping_only", |
| 1768 | + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() |
| 1769 | + .toJsonTree(addWordOptions.mappingOnly())); |
| 1770 | + } |
1736 | 1771 | if (addWordOptions.soundsLike() != null) { |
1737 | 1772 | contentJson.add( |
1738 | 1773 | "sounds_like", |
|
0 commit comments