Skip to content

Commit dbbc35f

Browse files
committed
feat(stt): add and remove method parameters
Remove parameter `customizationId` from `createJob` and `recognize`. Add parameter `characterInsertionBias` to `createJob` and `recognize`. Add parameter `strict` to `trainAcousticModel` and `trainLanguageModel`. Add new stt models
1 parent e7d0b01 commit dbbc35f

File tree

7 files changed

+244
-108
lines changed

7 files changed

+244
-108
lines changed

src/IBM.Watson.SpeechToText.v1/ISpeechToTextService.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2016, 2021.
2+
* (C) Copyright IBM Corp. 2022.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,18 +25,18 @@ public partial interface ISpeechToTextService
2525
{
2626
DetailedResponse<SpeechModels> ListModels();
2727
DetailedResponse<SpeechModel> GetModel(string modelId);
28-
DetailedResponse<SpeechRecognitionResults> Recognize(System.IO.MemoryStream audio, string contentType = null, string model = null, string languageCustomizationId = null, string acousticCustomizationId = null, string baseModelVersion = null, double? customizationWeight = null, long? inactivityTimeout = null, List<string> keywords = null, float? keywordsThreshold = null, long? maxAlternatives = null, float? wordAlternativesThreshold = null, bool? wordConfidence = null, bool? timestamps = null, bool? profanityFilter = null, bool? smartFormatting = null, bool? speakerLabels = null, string customizationId = null, string grammarName = null, bool? redaction = null, bool? audioMetrics = null, double? endOfPhraseSilenceTime = null, bool? splitTranscriptAtPhraseEnd = null, float? speechDetectorSensitivity = null, float? backgroundAudioSuppression = null, bool? lowLatency = null);
28+
DetailedResponse<SpeechRecognitionResults> Recognize(System.IO.MemoryStream audio, string contentType = null, string model = null, string languageCustomizationId = null, string acousticCustomizationId = null, string baseModelVersion = null, double? customizationWeight = null, long? inactivityTimeout = null, List<string> keywords = null, float? keywordsThreshold = null, long? maxAlternatives = null, float? wordAlternativesThreshold = null, bool? wordConfidence = null, bool? timestamps = null, bool? profanityFilter = null, bool? smartFormatting = null, bool? speakerLabels = null, string grammarName = null, bool? redaction = null, bool? audioMetrics = null, double? endOfPhraseSilenceTime = null, bool? splitTranscriptAtPhraseEnd = null, float? speechDetectorSensitivity = null, float? backgroundAudioSuppression = null, bool? lowLatency = null, float? characterInsertionBias = null);
2929
DetailedResponse<RegisterStatus> RegisterCallback(string callbackUrl, string userSecret = null);
3030
DetailedResponse<object> UnregisterCallback(string callbackUrl);
31-
DetailedResponse<RecognitionJob> CreateJob(System.IO.MemoryStream audio, string contentType = null, string model = null, string callbackUrl = null, string events = null, string userToken = null, long? resultsTtl = null, string languageCustomizationId = null, string acousticCustomizationId = null, string baseModelVersion = null, double? customizationWeight = null, long? inactivityTimeout = null, List<string> keywords = null, float? keywordsThreshold = null, long? maxAlternatives = null, float? wordAlternativesThreshold = null, bool? wordConfidence = null, bool? timestamps = null, bool? profanityFilter = null, bool? smartFormatting = null, bool? speakerLabels = null, string customizationId = null, string grammarName = null, bool? redaction = null, bool? processingMetrics = null, float? processingMetricsInterval = null, bool? audioMetrics = null, double? endOfPhraseSilenceTime = null, bool? splitTranscriptAtPhraseEnd = null, float? speechDetectorSensitivity = null, float? backgroundAudioSuppression = null, bool? lowLatency = null);
31+
DetailedResponse<RecognitionJob> CreateJob(System.IO.MemoryStream audio, string contentType = null, string model = null, string callbackUrl = null, string events = null, string userToken = null, long? resultsTtl = null, string languageCustomizationId = null, string acousticCustomizationId = null, string baseModelVersion = null, double? customizationWeight = null, long? inactivityTimeout = null, List<string> keywords = null, float? keywordsThreshold = null, long? maxAlternatives = null, float? wordAlternativesThreshold = null, bool? wordConfidence = null, bool? timestamps = null, bool? profanityFilter = null, bool? smartFormatting = null, bool? speakerLabels = null, string grammarName = null, bool? redaction = null, bool? processingMetrics = null, float? processingMetricsInterval = null, bool? audioMetrics = null, double? endOfPhraseSilenceTime = null, bool? splitTranscriptAtPhraseEnd = null, float? speechDetectorSensitivity = null, float? backgroundAudioSuppression = null, bool? lowLatency = null, float? characterInsertionBias = null);
3232
DetailedResponse<RecognitionJobs> CheckJobs();
3333
DetailedResponse<RecognitionJob> CheckJob(string id);
3434
DetailedResponse<object> DeleteJob(string id);
3535
DetailedResponse<LanguageModel> CreateLanguageModel(string name, string baseModelName, string dialect = null, string description = null);
3636
DetailedResponse<LanguageModels> ListLanguageModels(string language = null);
3737
DetailedResponse<LanguageModel> GetLanguageModel(string customizationId);
3838
DetailedResponse<object> DeleteLanguageModel(string customizationId);
39-
DetailedResponse<TrainingResponse> TrainLanguageModel(string customizationId, string wordTypeToAdd = null, double? customizationWeight = null);
39+
DetailedResponse<TrainingResponse> TrainLanguageModel(string customizationId, string wordTypeToAdd = null, double? customizationWeight = null, bool? strict = null);
4040
DetailedResponse<object> ResetLanguageModel(string customizationId);
4141
DetailedResponse<object> UpgradeLanguageModel(string customizationId);
4242
DetailedResponse<Corpora> ListCorpora(string customizationId);
@@ -56,7 +56,7 @@ public partial interface ISpeechToTextService
5656
DetailedResponse<AcousticModels> ListAcousticModels(string language = null);
5757
DetailedResponse<AcousticModel> GetAcousticModel(string customizationId);
5858
DetailedResponse<object> DeleteAcousticModel(string customizationId);
59-
DetailedResponse<TrainingResponse> TrainAcousticModel(string customizationId, string customLanguageModelId = null);
59+
DetailedResponse<TrainingResponse> TrainAcousticModel(string customizationId, string customLanguageModelId = null, bool? strict = null);
6060
DetailedResponse<object> ResetAcousticModel(string customizationId);
6161
DetailedResponse<object> UpgradeAcousticModel(string customizationId, string customLanguageModelId = null, bool? force = null);
6262
DetailedResponse<AudioResources> ListAudio(string customizationId);

src/IBM.Watson.SpeechToText.v1/Model/CustomWord.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2018, 2021.
2+
* (C) Copyright IBM Corp. 2022.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -35,27 +35,27 @@ public class CustomWord
3535
[JsonProperty("word", NullValueHandling = NullValueHandling.Ignore)]
3636
public string Word { get; set; }
3737
/// <summary>
38-
/// _For a custom model that is based on a previous-generation model_, an array of sounds-like pronunciations
39-
/// for the custom word. Specify how words that are difficult to pronounce, foreign words, acronyms, and so on
40-
/// can be pronounced by users.
41-
/// * For a word that is not in the service's base vocabulary, omit the parameter to have the service
42-
/// automatically generate a sounds-like pronunciation for the word.
38+
/// As array of sounds-like pronunciations for the custom word. Specify how words that are difficult to
39+
/// pronounce, foreign words, acronyms, and so on can be pronounced by users.
40+
/// * _For custom models that are based on previous-generation models_, for a word that is not in the service's
41+
/// base vocabulary, omit the parameter to have the service automatically generate a sounds-like pronunciation
42+
/// for the word.
4343
/// * For a word that is in the service's base vocabulary, use the parameter to specify additional
4444
/// pronunciations for the word. You cannot override the default pronunciation of a word; pronunciations you add
4545
/// augment the pronunciation from the base vocabulary.
4646
///
4747
/// A word can have at most five sounds-like pronunciations. A pronunciation can include at most 40 characters
4848
/// not including spaces.
49-
///
50-
/// _For a custom model that is based on a next-generation model_, omit this field. Custom models based on
51-
/// next-generation models do not support the `sounds_like` field. The service ignores the field.
5249
/// </summary>
5350
[JsonProperty("sounds_like", NullValueHandling = NullValueHandling.Ignore)]
5451
public List<string> SoundsLike { get; set; }
5552
/// <summary>
5653
/// An alternative spelling for the custom word when it appears in a transcript. Use the parameter when you want
5754
/// the word to have a spelling that is different from its usual representation or from its spelling in corpora
5855
/// training data.
56+
///
57+
/// _For custom models that are based on next-generation models_, the service uses the spelling of the word as
58+
/// the display-as value if you omit the field.
5959
/// </summary>
6060
[JsonProperty("display_as", NullValueHandling = NullValueHandling.Ignore)]
6161
public string DisplayAs { get; set; }

src/IBM.Watson.SpeechToText.v1/Model/RecognitionJob.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2018, 2021.
2+
* (C) Copyright IBM Corp. 2022.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -112,7 +112,9 @@ public class StatusEnumValue
112112
/// An array of warning messages about invalid parameters included with the request. Each warning includes a
113113
/// descriptive message and a list of invalid argument strings, for example, `"unexpected query parameter
114114
/// 'user_token', query parameter 'callback_url' was not specified"`. The request succeeds despite the warnings.
115-
/// This field can be returned only by the [Create a job](#createjob) method.
115+
/// This field can be returned only by the [Create a job](#createjob) method. (If you use the
116+
/// `character_insertion_bias` parameter with a previous-generation model, the warning message refers to the
117+
/// parameter as `lambdaBias`.).
116118
/// </summary>
117119
[JsonProperty("warnings", NullValueHandling = NullValueHandling.Ignore)]
118120
public List<string> Warnings { get; set; }

src/IBM.Watson.SpeechToText.v1/Model/SpeechRecognitionResults.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2018, 2022.
2+
* (C) Copyright IBM Corp. 2022.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -70,7 +70,8 @@ public class SpeechRecognitionResults
7070
/// An array of warning messages associated with the request:
7171
/// * Warnings for invalid parameters or fields can include a descriptive message and a list of invalid argument
7272
/// strings, for example, `"Unknown arguments:"` or `"Unknown url query arguments:"` followed by a list of the
73-
/// form `"{invalid_arg_1}, {invalid_arg_2}."`
73+
/// form `"{invalid_arg_1}, {invalid_arg_2}."` (If you use the `character_insertion_bias` parameter with a
74+
/// previous-generation model, the warning message refers to the parameter as `lambdaBias`.)
7475
/// * The following warning is returned if the request passes a custom model that is based on an older version
7576
/// of a base model for which an updated version is available: `"Using previous version of base model, because
7677
/// your custom model has been built with it. Please note that this version will be supported only for a limited

src/IBM.Watson.SpeechToText.v1/Model/Word.cs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2017, 2021.
2+
* (C) Copyright IBM Corp. 2022.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,20 +31,22 @@ public class Word
3131
[JsonProperty("word", NullValueHandling = NullValueHandling.Ignore)]
3232
public string _Word { get; set; }
3333
/// <summary>
34-
/// _For a custom model that is based on a previous-generation model_, an array of as many as five
35-
/// pronunciations for the word. The array can include the sounds-like pronunciation that is automatically
36-
/// generated by the service if none is provided when the word is added to the custom model; the service adds
37-
/// this pronunciation when it finishes processing the word.
38-
///
39-
/// _For a custom model that is based on a next-generation model_, this field does not apply. Custom models
40-
/// based on next-generation models do not support the `sounds_like` field, which is ignored.
34+
/// An array of as many as five pronunciations for the word.
35+
/// * _For a custom model that is based on a previous-generation model_, in addition to sounds-like
36+
/// pronunciations that were added by a user, the array can include a sounds-like pronunciation that is
37+
/// automatically generated by the service if none is provided when the word is added to the custom model.
38+
/// * _For a custom model that is based on a next-generation model_, the array can include only sounds-like
39+
/// pronunciations that were added by a user.
4140
/// </summary>
4241
[JsonProperty("sounds_like", NullValueHandling = NullValueHandling.Ignore)]
4342
public List<string> SoundsLike { get; set; }
4443
/// <summary>
45-
/// The spelling of the word that the service uses to display the word in a transcript. The field contains an
46-
/// empty string if no display-as value is provided for the word, in which case the word is displayed as it is
47-
/// spelled.
44+
/// The spelling of the word that the service uses to display the word in a transcript.
45+
/// * _For a custom model that is based on a previous-generation model_, the field can contain an empty string
46+
/// if no display-as value is provided for a word that exists in the service's base vocabulary. In this case,
47+
/// the word is displayed as it is spelled.
48+
/// * _For a custom model that is based on a next-generation model_, the service uses the spelling of the word
49+
/// as the value of the display-as field when the word is added to the model.
4850
/// </summary>
4951
[JsonProperty("display_as", NullValueHandling = NullValueHandling.Ignore)]
5052
public string DisplayAs { get; set; }

0 commit comments

Comments
 (0)