1313 */
1414package com .ibm .watson .developer_cloud .speech_to_text .v1 ;
1515
16+ import java .util .List ;
17+
18+ import com .google .gson .annotations .SerializedName ;
1619import com .ibm .watson .developer_cloud .speech_to_text .v1 .model .SpeechSession ;
1720
1821
2225 */
2326public class RecognizeOptions {
2427
28+ @ SerializedName ("content-type" )
29+ private String contentType ;
2530 private Boolean continuous ;
2631 private Integer inactivityTimeout ;
32+
33+ @ SerializedName ("interim_results" )
34+ private Boolean interimResults ;
35+ private List <String > keywords ;
36+
37+ @ SerializedName ("keywords_threshold" )
38+ private Double keywordsThreshold ;
2739 private Integer maxAlternatives ;
2840 private String model ;
2941 private String sessionId ;
30-
3142 private Boolean timestamps ;
32- private Boolean wordConfidence ;
3343
44+ @ SerializedName ("word_alternatives_threshold" )
45+ private Double wordAlternativesThreshold ;
46+
47+ @ SerializedName ("word_confidence" )
48+ private Boolean wordConfidence ;
3449
3550 /**
3651 * If true, multiple final results that represent multiple consecutive phrases separated by pauses
@@ -44,6 +59,15 @@ public RecognizeOptions continuous(Boolean continuous) {
4459 return this ;
4560 }
4661
62+ /**
63+ * Gets the content type.
64+ *
65+ * @return the contentType
66+ */
67+ public String getContentType () {
68+ return contentType ;
69+ }
70+
4771 /**
4872 * Gets the continuous.
4973 *
@@ -62,6 +86,33 @@ public Integer getInactivityTimeout() {
6286 return inactivityTimeout ;
6387 }
6488
89+ /**
90+ * Gets the interim results.
91+ *
92+ * @return the interimResults
93+ */
94+ public Boolean getInterimResults () {
95+ return interimResults ;
96+ }
97+
98+ /**
99+ * Gets the keywords.
100+ *
101+ * @return the keywords
102+ */
103+ public List <String > getKeywords () {
104+ return keywords ;
105+ }
106+
107+ /**
108+ * Gets the keywords threshold.
109+ *
110+ * @return the keywordsThreshold
111+ */
112+ public Double getKeywordsThreshold () {
113+ return keywordsThreshold ;
114+ }
115+
65116 /**
66117 * Gets the max alternatives.
67118 *
@@ -98,7 +149,14 @@ public Boolean getTimestamps() {
98149 return timestamps ;
99150 }
100151
101-
152+ /**
153+ * Gets the word alternatives threshold.
154+ *
155+ * @return the wordAlternativesThreshold
156+ */
157+ public Double getWordAlternativesThreshold () {
158+ return wordAlternativesThreshold ;
159+ }
102160
103161 /**
104162 * Gets the word confidence.
@@ -121,7 +179,50 @@ public RecognizeOptions inactivityTimeout(Integer inactivityTimeout) {
121179 }
122180
123181 /**
124- * Maximum number of alternative transcripts returned
182+ * If true, the service sends interim results for the transcription. Otherwise, the recognition
183+ * ends after first "end of speech" is detected. The default is false..
184+ *
185+ * @param interimResults the interim results
186+ * @return the recognize options
187+ */
188+ public RecognizeOptions interimResults (Boolean interimResults ) {
189+ this .interimResults = interimResults ;
190+ return this ;
191+ }
192+
193+ /**
194+ * Specifies an array of keyword strings to be matched in the input audio. By default, the service
195+ * does no keyword spotting.
196+ *
197+ *
198+ * @param keywords the keywords
199+ * @return the recognize options
200+ */
201+ public RecognizeOptions keywords (List <String > keywords ) {
202+ this .keywords = keywords ;
203+ return this ;
204+ }
205+
206+
207+
208+ /**
209+ * Specifies a minimum level of confidence that the service must have to report a matching keyword
210+ * in the input audio. Specify a probability value between 0 and 1 inclusive. A match must have at
211+ * least the specified confidence to be returned. Omit the parameter or specify a value of null
212+ * (the default) to spot no keywords. If you specify a valid threshold, you must also specify at
213+ * least one keyword.
214+ *
215+ *
216+ * @param keywordsThreshold the keywords threshold
217+ * @return the recognize options
218+ */
219+ public RecognizeOptions keywordsThreshold (Double keywordsThreshold ) {
220+ this .keywordsThreshold = keywordsThreshold ;
221+ return this ;
222+ }
223+
224+ /**
225+ * Maximum number of alternative transcripts returned.
125226 *
126227 * @param maxAlternatives the max alternatives
127228 * @return the recognize options
@@ -132,7 +233,7 @@ public RecognizeOptions maxAlternatives(Integer maxAlternatives) {
132233 }
133234
134235 /**
135- * Sets the model name used for the recognition
236+ * Sets the model name used for the recognition.
136237 *
137238 * @param model the model
138239 * @return the recognize options
@@ -142,6 +243,17 @@ public RecognizeOptions model(String model) {
142243 return this ;
143244 }
144245
246+ /**
247+ * Sets the session id.
248+ *
249+ * @param session the {@link SpeechSession}
250+ * @return the recognize options
251+ */
252+ public RecognizeOptions session (SpeechSession session ) {
253+ this .sessionId = session .getSessionId ();
254+ return this ;
255+ }
256+
145257 /**
146258 * Sets session id.
147259 *
@@ -154,29 +266,46 @@ public RecognizeOptions sessionId(String sessionId) {
154266 }
155267
156268 /**
157- * Sets the session id .
269+ * If true, time alignment for each word is returned .
158270 *
159- * @param session the {@link SpeechSession}
271+ * @param timestamps the timestamps
160272 * @return the recognize options
161273 */
162- public RecognizeOptions session ( SpeechSession session ) {
163- this .sessionId = session . getSessionId () ;
274+ public RecognizeOptions timestamps ( Boolean timestamps ) {
275+ this .timestamps = timestamps ;
164276 return this ;
165277 }
166278
167279 /**
168- * If true, time alignment for each word is returned
280+ * Specifies a minimum level of confidence that the service must have to report a hypothesis for a
281+ * word from the input audio. Specify a probability value between 0 and 1 inclusive. A hypothesis
282+ * must have at least the specified confidence to be returned as a word alternative. Omit the
283+ * parameter or specify a value of null (the default) to return no word alternatives.
169284 *
170- * @param timestamps the timestamps
285+ *
286+ *
287+ * @param wordAlternativesThreshold the wordAalternatives threshold
171288 * @return the recognize options
172289 */
173- public RecognizeOptions timestamps ( Boolean timestamps ) {
174- this .timestamps = timestamps ;
290+ public RecognizeOptions wordAlternativesThreshold ( Double wordAlternativesThreshold ) {
291+ this .wordAlternativesThreshold = wordAlternativesThreshold ;
175292 return this ;
176293 }
177294
178295 /**
179- * If true, confidence measure per word is returned if available
296+ * Content type.
297+ *
298+ * @param contentType the content type
299+ * @return the recognize options
300+ */
301+ public RecognizeOptions contentType (String contentType ) {
302+ this .contentType = contentType ;
303+ return this ;
304+ }
305+
306+
307+ /**
308+ * If true, confidence measure per word is returned if available.
180309 *
181310 * @param wordConfidence the word confidence
182311 * @return the recognize options
0 commit comments