Skip to content

Commit

Permalink
feat(stt): add and remove method parameters
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kevinkowa committed Aug 9, 2022
1 parent e7d0b01 commit dbbc35f
Show file tree
Hide file tree
Showing 7 changed files with 244 additions and 108 deletions.
10 changes: 5 additions & 5 deletions src/IBM.Watson.SpeechToText.v1/ISpeechToTextService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2016, 2021.
* (C) Copyright IBM Corp. 2022.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,18 +25,18 @@ public partial interface ISpeechToTextService
{
DetailedResponse<SpeechModels> ListModels();
DetailedResponse<SpeechModel> GetModel(string modelId);
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);
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);
DetailedResponse<RegisterStatus> RegisterCallback(string callbackUrl, string userSecret = null);
DetailedResponse<object> UnregisterCallback(string callbackUrl);
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);
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);
DetailedResponse<RecognitionJobs> CheckJobs();
DetailedResponse<RecognitionJob> CheckJob(string id);
DetailedResponse<object> DeleteJob(string id);
DetailedResponse<LanguageModel> CreateLanguageModel(string name, string baseModelName, string dialect = null, string description = null);
DetailedResponse<LanguageModels> ListLanguageModels(string language = null);
DetailedResponse<LanguageModel> GetLanguageModel(string customizationId);
DetailedResponse<object> DeleteLanguageModel(string customizationId);
DetailedResponse<TrainingResponse> TrainLanguageModel(string customizationId, string wordTypeToAdd = null, double? customizationWeight = null);
DetailedResponse<TrainingResponse> TrainLanguageModel(string customizationId, string wordTypeToAdd = null, double? customizationWeight = null, bool? strict = null);
DetailedResponse<object> ResetLanguageModel(string customizationId);
DetailedResponse<object> UpgradeLanguageModel(string customizationId);
DetailedResponse<Corpora> ListCorpora(string customizationId);
Expand All @@ -56,7 +56,7 @@ public partial interface ISpeechToTextService
DetailedResponse<AcousticModels> ListAcousticModels(string language = null);
DetailedResponse<AcousticModel> GetAcousticModel(string customizationId);
DetailedResponse<object> DeleteAcousticModel(string customizationId);
DetailedResponse<TrainingResponse> TrainAcousticModel(string customizationId, string customLanguageModelId = null);
DetailedResponse<TrainingResponse> TrainAcousticModel(string customizationId, string customLanguageModelId = null, bool? strict = null);
DetailedResponse<object> ResetAcousticModel(string customizationId);
DetailedResponse<object> UpgradeAcousticModel(string customizationId, string customLanguageModelId = null, bool? force = null);
DetailedResponse<AudioResources> ListAudio(string customizationId);
Expand Down
18 changes: 9 additions & 9 deletions src/IBM.Watson.SpeechToText.v1/Model/CustomWord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2018, 2021.
* (C) Copyright IBM Corp. 2022.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -35,27 +35,27 @@ public class CustomWord
[JsonProperty("word", NullValueHandling = NullValueHandling.Ignore)]
public string Word { get; set; }
/// <summary>
/// _For a custom model that is based on a previous-generation model_, an array of sounds-like pronunciations
/// for the custom word. Specify how words that are difficult to pronounce, foreign words, acronyms, and so on
/// can be pronounced by users.
/// * For a word that is not in the service's base vocabulary, omit the parameter to have the service
/// automatically generate a sounds-like pronunciation for the word.
/// As array of sounds-like pronunciations for the custom word. Specify how words that are difficult to
/// pronounce, foreign words, acronyms, and so on can be pronounced by users.
/// * _For custom models that are based on previous-generation models_, for a word that is not in the service's
/// base vocabulary, omit the parameter to have the service automatically generate a sounds-like pronunciation
/// for the word.
/// * For a word that is in the service's base vocabulary, use the parameter to specify additional
/// pronunciations for the word. You cannot override the default pronunciation of a word; pronunciations you add
/// augment the pronunciation from the base vocabulary.
///
/// A word can have at most five sounds-like pronunciations. A pronunciation can include at most 40 characters
/// not including spaces.
///
/// _For a custom model that is based on a next-generation model_, omit this field. Custom models based on
/// next-generation models do not support the `sounds_like` field. The service ignores the field.
/// </summary>
[JsonProperty("sounds_like", NullValueHandling = NullValueHandling.Ignore)]
public List<string> SoundsLike { get; set; }
/// <summary>
/// An alternative spelling for the custom word when it appears in a transcript. Use the parameter when you want
/// the word to have a spelling that is different from its usual representation or from its spelling in corpora
/// training data.
///
/// _For custom models that are based on next-generation models_, the service uses the spelling of the word as
/// the display-as value if you omit the field.
/// </summary>
[JsonProperty("display_as", NullValueHandling = NullValueHandling.Ignore)]
public string DisplayAs { get; set; }
Expand Down
6 changes: 4 additions & 2 deletions src/IBM.Watson.SpeechToText.v1/Model/RecognitionJob.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2018, 2021.
* (C) Copyright IBM Corp. 2022.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -112,7 +112,9 @@ public class StatusEnumValue
/// An array of warning messages about invalid parameters included with the request. Each warning includes a
/// descriptive message and a list of invalid argument strings, for example, `"unexpected query parameter
/// 'user_token', query parameter 'callback_url' was not specified"`. The request succeeds despite the warnings.
/// This field can be returned only by the [Create a job](#createjob) method.
/// This field can be returned only by the [Create a job](#createjob) method. (If you use the
/// `character_insertion_bias` parameter with a previous-generation model, the warning message refers to the
/// parameter as `lambdaBias`.).
/// </summary>
[JsonProperty("warnings", NullValueHandling = NullValueHandling.Ignore)]
public List<string> Warnings { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2018, 2022.
* (C) Copyright IBM Corp. 2022.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -70,7 +70,8 @@ public class SpeechRecognitionResults
/// An array of warning messages associated with the request:
/// * Warnings for invalid parameters or fields can include a descriptive message and a list of invalid argument
/// strings, for example, `"Unknown arguments:"` or `"Unknown url query arguments:"` followed by a list of the
/// form `"{invalid_arg_1}, {invalid_arg_2}."`
/// form `"{invalid_arg_1}, {invalid_arg_2}."` (If you use the `character_insertion_bias` parameter with a
/// previous-generation model, the warning message refers to the parameter as `lambdaBias`.)
/// * The following warning is returned if the request passes a custom model that is based on an older version
/// of a base model for which an updated version is available: `"Using previous version of base model, because
/// your custom model has been built with it. Please note that this version will be supported only for a limited
Expand Down
24 changes: 13 additions & 11 deletions src/IBM.Watson.SpeechToText.v1/Model/Word.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2017, 2021.
* (C) Copyright IBM Corp. 2022.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,20 +31,22 @@ public class Word
[JsonProperty("word", NullValueHandling = NullValueHandling.Ignore)]
public string _Word { get; set; }
/// <summary>
/// _For a custom model that is based on a previous-generation model_, an array of as many as five
/// pronunciations for the word. The array can include the sounds-like pronunciation that is automatically
/// generated by the service if none is provided when the word is added to the custom model; the service adds
/// this pronunciation when it finishes processing the word.
///
/// _For a custom model that is based on a next-generation model_, this field does not apply. Custom models
/// based on next-generation models do not support the `sounds_like` field, which is ignored.
/// An array of as many as five pronunciations for the word.
/// * _For a custom model that is based on a previous-generation model_, in addition to sounds-like
/// pronunciations that were added by a user, the array can include a sounds-like pronunciation that is
/// automatically generated by the service if none is provided when the word is added to the custom model.
/// * _For a custom model that is based on a next-generation model_, the array can include only sounds-like
/// pronunciations that were added by a user.
/// </summary>
[JsonProperty("sounds_like", NullValueHandling = NullValueHandling.Ignore)]
public List<string> SoundsLike { get; set; }
/// <summary>
/// The spelling of the word that the service uses to display the word in a transcript. The field contains an
/// empty string if no display-as value is provided for the word, in which case the word is displayed as it is
/// spelled.
/// The spelling of the word that the service uses to display the word in a transcript.
/// * _For a custom model that is based on a previous-generation model_, the field can contain an empty string
/// if no display-as value is provided for a word that exists in the service's base vocabulary. In this case,
/// the word is displayed as it is spelled.
/// * _For a custom model that is based on a next-generation model_, the service uses the spelling of the word
/// as the value of the display-as field when the word is added to the model.
/// </summary>
[JsonProperty("display_as", NullValueHandling = NullValueHandling.Ignore)]
public string DisplayAs { get; set; }
Expand Down
Loading

0 comments on commit dbbc35f

Please sign in to comment.