Skip to content

Commit c11e928

Browse files
committed
feat(speech-to-text-v1): supportedFeatures: customAcousticModel property added & update comments
1 parent 34fd074 commit c11e928

File tree

9 files changed

+274
-186
lines changed

9 files changed

+274
-186
lines changed

Scripts/Services/SpeechToText/V1/Model/AcousticModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2019, 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.
@@ -107,7 +107,7 @@ public class StatusValue
107107
/// <summary>
108108
/// A list of the available versions of the custom acoustic model. Each element of the array indicates a version
109109
/// of the base model with which the custom model can be used. Multiple versions exist only if the custom model
110-
/// has been upgraded; otherwise, only a single version is shown.
110+
/// has been upgraded to a new version of its base model. Otherwise, only a single version is shown.
111111
/// </summary>
112112
[JsonProperty("versions", NullValueHandling = NullValueHandling.Ignore)]
113113
public List<string> Versions { get; set; }

Scripts/Services/SpeechToText/V1/Model/Grammar.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
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.
@@ -68,7 +68,11 @@ public class StatusValue
6868
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
6969
public string Name { get; set; }
7070
/// <summary>
71-
/// The number of OOV words in the grammar. The value is `0` while the grammar is being processed.
71+
/// _For custom models that are based on previous-generation models_, the number of OOV words extracted from the
72+
/// grammar. The value is `0` while the grammar is being processed.
73+
///
74+
/// _For custom models that are based on next-generation models_, no OOV words are extracted from grammars, so
75+
/// the value is always `0`.
7276
/// </summary>
7377
[JsonProperty("out_of_vocabulary_words", NullValueHandling = NullValueHandling.Ignore)]
7478
public long? OutOfVocabularyWords { get; set; }

Scripts/Services/SpeechToText/V1/Model/LanguageModel.cs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2019, 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.
@@ -100,14 +100,18 @@ public class StatusValue
100100
[JsonProperty("updated", NullValueHandling = NullValueHandling.Ignore)]
101101
public string Updated { get; set; }
102102
/// <summary>
103-
/// The language identifier of the custom language model (for example, `en-US`).
103+
/// The language identifier of the custom language model (for example, `en-US`). The value matches the
104+
/// five-character language identifier from the name of the base model for the custom model. This value might be
105+
/// different from the value of the `dialect` field.
104106
/// </summary>
105107
[JsonProperty("language", NullValueHandling = NullValueHandling.Ignore)]
106108
public string Language { get; set; }
107109
/// <summary>
108-
/// The dialect of the language for the custom language model. For non-Spanish models, the field matches the
109-
/// language of the base model; for example, `en-US` for either of the US English language models. For Spanish
110-
/// models, the field indicates the dialect for which the model was created:
110+
/// The dialect of the language for the custom language model. _For custom models that are based on non-Spanish
111+
/// previous-generation models and on next-generation models,_ the field matches the language of the base model;
112+
/// for example, `en-US` for one of the US English models. _For custom models that are based on Spanish
113+
/// previous-generation models,_ the field indicates the dialect with which the model was created. The value can
114+
/// match the name of the base model or, if it was specified by the user, can be one of the following:
111115
/// * `es-ES` for Castilian Spanish (`es-ES` models)
112116
/// * `es-LA` for Latin American Spanish (`es-AR`, `es-CL`, `es-CO`, and `es-PE` models)
113117
/// * `es-US` for Mexican (North American) Spanish (`es-MX` models)
@@ -117,14 +121,9 @@ public class StatusValue
117121
[JsonProperty("dialect", NullValueHandling = NullValueHandling.Ignore)]
118122
public string Dialect { get; set; }
119123
/// <summary>
120-
/// _For custom models that are based on previous-generation models_, a list of the available versions of the
121-
/// custom language model. Each element of the array indicates a version of the base model with which the custom
122-
/// model can be used. Multiple versions exist only if the custom model has been upgraded; otherwise, only a
123-
/// single version is shown.
124-
///
125-
/// _For custom models that are based on next-generation models_, a single version of the custom model. Only one
126-
/// version of a custom model that is based on a next-generation model is ever available, and upgrading does not
127-
/// apply.
124+
/// A list of the available versions of the custom language model. Each element of the array indicates a version
125+
/// of the base model with which the custom model can be used. Multiple versions exist only if the custom model
126+
/// has been upgraded to a new version of its base model. Otherwise, only a single version is shown.
128127
/// </summary>
129128
[JsonProperty("versions", NullValueHandling = NullValueHandling.Ignore)]
130129
public List<string> Versions { get; set; }

Scripts/Services/SpeechToText/V1/Model/SpeechModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
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.
@@ -46,7 +46,7 @@ public class SpeechModel
4646
[JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)]
4747
public string Url { get; set; }
4848
/// <summary>
49-
/// Additional service features that are supported with the model.
49+
/// Indicates whether select service features are supported with the model.
5050
/// </summary>
5151
[JsonProperty("supported_features", NullValueHandling = NullValueHandling.Ignore)]
5252
public SupportedFeatures SupportedFeatures { get; set; }

Scripts/Services/SpeechToText/V1/Model/SpeechRecognitionAlternative.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2019, 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.
@@ -46,7 +46,7 @@ public class SpeechRecognitionAlternative
4646
/// <summary>
4747
/// A confidence score for each word of the transcript as a list of lists. Each inner list consists of two
4848
/// elements: the word and its confidence score in the range of 0.0 to 1.0, for example:
49-
/// `[["hello",0.95],["world",0.866]]`. Confidence scores are returned only for the best alternative and only
49+
/// `[["hello",0.95],["world",0.86]]`. Confidence scores are returned only for the best alternative and only
5050
/// with results marked as final.
5151
/// </summary>
5252
[JsonProperty("word_confidence", NullValueHandling = NullValueHandling.Ignore)]

Scripts/Services/SpeechToText/V1/Model/SpeechRecognitionResult.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2018, 2020.
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.
@@ -68,9 +68,13 @@ public class EndOfUtteranceValue
6868
[JsonProperty("end_of_utterance", NullValueHandling = NullValueHandling.Ignore)]
6969
public string EndOfUtterance { get; set; }
7070
/// <summary>
71-
/// An indication of whether the transcription results are final. If `true`, the results for this utterance are
72-
/// not updated further; no additional results are sent for a `result_index` once its results are indicated as
73-
/// final.
71+
/// An indication of whether the transcription results are final:
72+
/// * If `true`, the results for this utterance are final. They are guaranteed not to be updated further.
73+
/// * If `false`, the results are interim. They can be updated with further interim results until final results
74+
/// are eventually sent.
75+
///
76+
/// **Note:** Because `final` is a reserved word in Java and Swift, the field is renamed `xFinal` in Java and is
77+
/// escaped with back quotes in Swift.
7478
/// </summary>
7579
[JsonProperty("final", NullValueHandling = NullValueHandling.Ignore)]
7680
public bool? Final { get; set; }

Scripts/Services/SpeechToText/V1/Model/SpeechRecognitionResults.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2019, 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.
@@ -28,15 +28,22 @@ public class SpeechRecognitionResults
2828
/// <summary>
2929
/// An array of `SpeechRecognitionResult` objects that can include interim and final results (interim results
3030
/// are returned only if supported by the method). Final results are guaranteed not to change; interim results
31-
/// might be replaced by further interim results and final results. The service periodically sends updates to
32-
/// the results list; the `result_index` is set to the lowest index in the array that has changed; it is
33-
/// incremented for new results.
31+
/// might be replaced by further interim results and eventually final results.
32+
///
33+
/// For the HTTP interfaces, all results arrive at the same time. For the WebSocket interface, results can be
34+
/// sent as multiple separate responses. The service periodically sends updates to the results list. The
35+
/// `result_index` is incremented to the lowest index in the array that has changed for new results.
36+
///
37+
/// For more information, see [Understanding speech recognition
38+
/// results](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-basic-response).
3439
/// </summary>
3540
[JsonProperty("results", NullValueHandling = NullValueHandling.Ignore)]
3641
public List<SpeechRecognitionResult> Results { get; set; }
3742
/// <summary>
38-
/// An index that indicates a change point in the `results` array. The service increments the index only for
39-
/// additional results that it sends for new audio for the same request.
43+
/// An index that indicates a change point in the `results` array. The service increments the index for
44+
/// additional results that it sends for new audio for the same request. All results with the same index are
45+
/// delivered at the same time. The same index can include multiple final results that are delivered with the
46+
/// same response.
4047
/// </summary>
4148
[JsonProperty("result_index", NullValueHandling = NullValueHandling.Ignore)]
4249
public long? ResultIndex { get; set; }

Scripts/Services/SpeechToText/V1/Model/SupportedFeatures.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2019, 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.
@@ -20,7 +20,7 @@
2020
namespace IBM.Watson.SpeechToText.V1.Model
2121
{
2222
/// <summary>
23-
/// Additional service features that are supported with the model.
23+
/// Indicates whether select service features are supported with the model.
2424
/// </summary>
2525
public class SupportedFeatures
2626
{
@@ -31,17 +31,23 @@ public class SupportedFeatures
3131
[JsonProperty("custom_language_model", NullValueHandling = NullValueHandling.Ignore)]
3232
public bool? CustomLanguageModel { get; set; }
3333
/// <summary>
34+
/// Indicates whether the customization interface can be used to create a custom acoustic model based on the
35+
/// language model.
36+
/// </summary>
37+
[JsonProperty("custom_acoustic_model", NullValueHandling = NullValueHandling.Ignore)]
38+
public bool? CustomAcousticModel { get; set; }
39+
/// <summary>
3440
/// Indicates whether the `speaker_labels` parameter can be used with the language model.
3541
///
36-
/// **Note:** The field returns `true` for all models. However, speaker labels are supported as beta
37-
/// functionality only for the following languages and models:
38-
/// * For previous-generation models, the parameter can be used for Australian English, US English, German,
42+
/// **Note:** The field returns `true` for all models. However, speaker labels are supported for use only with
43+
/// the following languages and models:
44+
/// * _For previous-generation models,_ the parameter can be used with Australian English, US English, German,
3945
/// Japanese, Korean, and Spanish (both broadband and narrowband models) and UK English (narrowband model)
4046
/// transcription only.
41-
/// * For next-generation models, the parameter can be used for English (Australian, Indian, UK, and US),
42-
/// German, Japanese, Korean, and Spanish transcription only.
47+
/// * _For next-generation models,_ the parameter can be used with Czech, English (Australian, Indian, UK, and
48+
/// US), German, Japanese, Korean, and Spanish transcription only.
4349
///
44-
/// Speaker labels are not supported for any other models.
50+
/// Speaker labels are not supported for use with any other languages or models.
4551
/// </summary>
4652
[JsonProperty("speaker_labels", NullValueHandling = NullValueHandling.Ignore)]
4753
public bool? SpeakerLabels { get; set; }

0 commit comments

Comments
 (0)