-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRevAiJobOptions.java
608 lines (532 loc) · 16.8 KB
/
RevAiJobOptions.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
package ai.rev.speechtotext.models.asynchronous;
import ai.rev.speechtotext.models.CustomerUrlData;
import ai.rev.speechtotext.models.vocabulary.CustomVocabulary;
import com.google.gson.annotations.SerializedName;
import java.util.List;
import java.util.Map;
/**
* A RevAiJobOptions object represents parameters that are submitted along a new job.
*
* @see <a
* href="https://docs.rev.ai/api/asynchronous/reference/#operation/SubmitTranscriptionJob">https://docs.rev.ai/api/asynchronous/reference/#operation/SubmitTranscriptionJob</a>
*/
public class RevAiJobOptions {
/** The media url where the file can be downloaded.
* @deprecated Use source_config instead
*/
@SerializedName("media_url")
@Deprecated
private String mediaUrl;
/** Object containing source media file information. */
@SerializedName("source_config")
private CustomerUrlData sourceConfig;
/** The callback url that Rev AI will send a POST to when the job has finished.
* @deprecated Use notification_config instead
*/
@SerializedName("callback_url")
@Deprecated
private String callbackUrl;
/** Object containing information on the callback url that Rev AI will send a POST to when the job has finished. */
@SerializedName("notification_config")
private CustomerUrlData notificationConfig;
/** Optional parameter for the speech engine to skip diarization. */
@SerializedName("skip_diarization")
private Boolean skipDiarization;
/** Optional parameter for the speech engine to skip punctuation. */
@SerializedName("skip_punctuation")
private Boolean skipPunctuation;
/** Optional parameter for the speech engine to skip all postprocessing */
@SerializedName("skip_postprocessing")
private Boolean skipPostprocessing;
/**
* Optional parameter to process each audio channel separately. Account will be charged the file
* duration multiplied by the number of specified channels.
*/
@SerializedName("speaker_channels_count")
private Integer speakerChannelsCount;
/** Optional parameter for the id of a pre-computed custom vocabulary to be used */
@SerializedName("custom_vocabulary_id")
private String customVocabularyId;
/** Optional array of {@link CustomVocabulary} objects. */
@SerializedName("custom_vocabularies")
private List<CustomVocabulary> customVocabularies;
/**
* Optional information that can be provided.
*/
@SerializedName("metadata")
private String metadata;
/**
* Optional parameter to filter profanity in the transcript
*/
@SerializedName("filter_profanity")
private Boolean filterProfanity;
/**
* Optional parameter to remove disfluencies (ums, ahs) in the transcript
*/
@SerializedName("remove_disfluencies")
private Boolean removeDisfluencies;
/**
* Optional number of seconds after job completion when job is auto-deleted
*/
@SerializedName("delete_after_seconds")
private Integer deleteAfterSeconds;
/**
* Optional language parameter using a supported ISO 639-1 2-letter or ISO 639-3 (3-letter) language code
* as defined in the API reference
*/
@SerializedName("language")
private String language;
/**
* Specifies the type of transcriber to use to transcribe the media file
*/
@SerializedName("transcriber")
private String transcriber;
/**
* Optional and only available with transcriber "human".
* Whether transcriber will transcribe every syllable.
*/
@SerializedName("verbatim")
private Boolean verbatim;
/**
* Optional and only available with transcriber "human".
* Whether job is given higher priority by human transcriber for higher price.
*/
@SerializedName("rush")
private Boolean rush;
/**
* Optional and only available with transcriber "human".
* Whether job is mocked and no real transcription actually happens.
*/
@SerializedName("test_mode")
private Boolean testMode;
/**
* Optional and only available with transcriber "human".
* Sections of the transcript that should be transcribed instead of the whole file.
*/
@SerializedName("segments_to_transcribe")
private List<SegmentToTranscribe> segmentsToTranscribe;
/**
* Optional and only available with transcriber "human".
* Specifies a list of names for the speakers in an audio file.
*/
@SerializedName("speaker_names")
private List<SpeakerName> speakerNames;
@SerializedName("summarization_config")
private SummarizationOptions summarizationOptions;
@SerializedName("translation_config")
private TranslationOptions translationOptions;
/**
* Returns the media url.
*
* @return The media url.
* @deprecated Set sourceConfig and use getSourceConfig instead
*/
@Deprecated
public String getMediaUrl() {
return mediaUrl;
}
/**
* Specifies the url where the media can be downloaded.
*
* @param mediaUrl The direct download url to the file.
* @deprecated Use setSourceConfig instead
*/
@Deprecated
public void setMediaUrl(String mediaUrl) {
this.mediaUrl = mediaUrl;
}
/**
* Returns the source config object.
*
* @return the source config.
*/
public CustomerUrlData getSourceConfig()
{
return this.sourceConfig;
}
/**
* Specifies the url and any optional auth headers to access the source media download url.
*
* @param sourceMediaUrl The direct download url to the file.
* @param sourceAuth The auth headers to the source media download url.
*/
public void setSourceConfig(String sourceMediaUrl, Map<String, String> sourceAuth) {
this.sourceConfig = new CustomerUrlData(sourceMediaUrl, sourceAuth);
}
/**
* Specifies the source media download url.
*
* @param sourceMediaUrl The direct download url to the file.
*/
public void setSourceConfig(String sourceMediaUrl) {
this.sourceConfig = new CustomerUrlData(sourceMediaUrl, null);
}
/**
* Returns the callback url.
*
* @return the callback url.
* @deprecated Use notificationConfig and getNotificationConfig instead
*/
@Deprecated
public String getCallbackUrl() {
return callbackUrl;
}
/**
* Specifies the callback url that Rev AI will POST to when job processing is complete. This
* property is optional.
*
* @param callbackUrl The url to POST to when job processing is complete.
* @deprecated Use setNotificationConfig instead
*/
@Deprecated
public void setCallbackUrl(String callbackUrl) {
this.callbackUrl = callbackUrl;
}
/**
* Returns the notification config object.
*
* @return the notification config.
*/
public CustomerUrlData getNotificationConfig() {
return notificationConfig;
}
/**
* Optional property to specify the callback url that Rev AI will POST to when job processing is complete
*
* @param callbackUrl The url to POST to when job processing is complete.
* @param authHeaders Optional parameter to authenticate access to the callback url
*/
public void setNotificationConfig(String callbackUrl, Map<String, String> authHeaders) {
this.notificationConfig = new CustomerUrlData(callbackUrl, authHeaders);
}
/**
* Optional property to specify the callback url that Rev AI will POST to when job processing is complete
*
* @param callbackUrl The url to POST to when job processing is complete.
*/
public void setNotificationConfig(String callbackUrl) {
setNotificationConfig(callbackUrl, null);
}
/**
* Returns the value of the skip diarization Boolean.
*
* @return The skip diarization value.
*/
public Boolean getSkipDiarization() {
return skipDiarization;
}
/**
* Specifies if speaker diarization will be skipped by the speech engine. This property is
* optional and defaults to false.
*
* @param skipDiarization The value of the Boolean.
*/
public void setSkipDiarization(Boolean skipDiarization) {
this.skipDiarization = skipDiarization;
}
/**
* Returns the value of the skip punctuation Boolean.
*
* @return The skip punctuation value.
*/
public Boolean getSkipPunctuation() {
return skipPunctuation;
}
/**
* Specifies if the "punct" elements will be skipped by the speech engine. This property is
* optional and defaults to false.
*
* @param skipPunctuation The value of the Boolean.
*/
public void setSkipPunctuation(Boolean skipPunctuation) {
this.skipPunctuation = skipPunctuation;
}
/**
* Returns the value of the skip postprocessing Boolean.
*
* @return The skip postprocessing value.
*/
public Boolean getSkipPostprocessing() {
return skipPostprocessing;
}
/**
* Specifies if all postprocessing (capitalization, punctuation, ITN) will be skipped by the speech engine. This property is
* optional and defaults to false.
*
* @param skipPostprocessing The value of the Boolean.
*/
public void setSkipPostprocessing(Boolean skipPostprocessing) {
this.skipPostprocessing = skipPostprocessing;
}
/**
* Returns the speaker channel count.
*
* @return The speaker channel count.
*/
public Integer getSpeakerChannelsCount() {
return speakerChannelsCount;
}
/**
* Specifies the number of speaker channels in the audio. Each speaker channel is processed
* separately. When set the account will be charged the file * duration multiplied by the number
* of specified channels. This property is optional and defaults to null.
*
* @param speakerChannelsCount The number of separate speaker channels in the audio.
*/
public void setSpeakerChannelsCount(Integer speakerChannelsCount) {
this.speakerChannelsCount = speakerChannelsCount;
}
/**
* Returns the custom vocabulary ID.
*
* @return The custom vocabulary ID.
*/
public String getCustomVocabularyId() {
return customVocabularyId;
}
/**
* Specifies the ID of the custom vocabulary the speech engine should use while processing audio
* samples. Custom vocabularies are submitted prior to usage in the stream and assigned an Id.
*
* @param customVocabularyId The ID of the custom vocabulary.
*/
public void setCustomVocabularyId(String customVocabularyId) {
this.customVocabularyId = customVocabularyId;
}
/**
* Returns a list of {@link CustomVocabulary} objects.
*
* @return A list of {@link CustomVocabulary} objects.
* @see CustomVocabulary
*/
public List<CustomVocabulary> getCustomVocabularies() {
return customVocabularies;
}
/**
* Provides the custom vocabularies to be used by the speech engine when processing the
* transcript. List size is limited to 50 items. Providing custom vocabularies is optional.
*
* @param customVocabularies A list of custom vocabularies.
* @see CustomVocabulary
*/
public void setCustomVocabularies(List<CustomVocabulary> customVocabularies) {
this.customVocabularies = customVocabularies;
}
/**
* Returns the metadata.
*
* @return A String that contains the metadata.
*/
public String getMetadata() {
return metadata;
}
/**
* Optional metadata that is provided during job submission limited to 512 characters.
*
* @param metadata A String to set as the metadata.
*/
public void setMetadata(String metadata) {
this.metadata = metadata;
}
/**
* Returns the value of the filterProfanity Boolean
*
* @return The filter profanity value.
*/
public Boolean getFilterProfanity() {
return filterProfanity;
}
/**
* Specifies whether or not the speech engine should filter profanity in the output. Setting the
* profanity filter is optional.
*
* @param filterProfanity The option to filter profanity.
*/
public void setFilterProfanity(Boolean filterProfanity) {
this.filterProfanity = filterProfanity;
}
/**
* Returns the value of the removeDisfluencies Boolean
*
* @return The removeDisfluencies value.
*/
public Boolean getRemoveDisfluencies() {
return removeDisfluencies;
}
/**
* Specifies whether or not the speech engine should remove disfluencies in the output. Setting
* the option to remove disfluencies is optional.
*
* @param removeDisfluencies The option to remove disfluencies.
*/
public void setRemoveDisfluencies(Boolean removeDisfluencies) {
this.removeDisfluencies = removeDisfluencies;
}
/**
* Returns the value of deleteAfterSeconds.
*
* @return The deleteAfterSeconds value.
*/
public Integer getDeleteAfterSeconds() {
return deleteAfterSeconds;
}
/**
* Specifies the number of seconds to be waited until the job is auto-deleted after its
* completion.
*
* @param deleteAfterSeconds The number of seconds after job completion when job is auto-deleted.
*/
public void setDeleteAfterSeconds(Integer deleteAfterSeconds) {
this.deleteAfterSeconds = deleteAfterSeconds;
}
/**
* Returns the value of language.
*
* @return the language value.
*/
public String getLanguage() {
return language;
}
/**
* Specifies language for ASR system using ISO 639-1 2-letter language code.
*
* @param language ISO 639-1 2-letter language code of desired ASR language.
*/
public void setLanguage(String language) { this.language = language; }
/**
* Specifies the type of transcriber to use to transcribe the media file
*
* @return the name of the transcriber type
*/
public String getTranscriber() {
return transcriber;
}
/**
* Specifies the type of transcriber to use to transcribe the media file
*
* @param transcriber the name of the transcriber type
*/
public void setTranscriber(String transcriber) {
this.transcriber = transcriber;
}
/**
* Returns the value of verbatim
*
* @return Whether verbatim is true or false
*/
public Boolean getVerbatim() {
return verbatim;
}
/**
* Sets whether transcriber will transcribe every syllable including disfluencies. This
* property is optional but can only be used with "human" transcriber.
* Defaults to false.
*
* @param verbatim Whether to transcribe every syllable
*/
public void setVerbatim(Boolean verbatim) {
this.verbatim = verbatim;
}
/**
* Returns the value of rush
*
* @return Whether rush is true or false
*/
public Boolean getRush() {
return rush;
}
/**
* Sets whether job is given higher priority by human transcriber to be worked on sooner in
* exchange for a higher price. This property is optional but can only be used with "human" transcriber.
* Defaults to false.
*
* @param rush Whether to give higher priority to the job
*/
public void setRush(Boolean rush) {
this.rush = rush;
}
/**
* Returns the value of testMode
*
* @return Whether testMode is true or false
*/
public Boolean getTestMode() {
return testMode;
}
/**
* Sets whether job is a mocked job which will return a mock transcript.
* This property is optional but can only be used with "human" transcriber.
* Defaults to false.
*
* @param testMode Whether to set job to be test mode
*/
public void setTestMode(Boolean testMode) {
this.testMode = testMode;
}
/**
* Returns the segments in media to transcribe
*
* @return Segments to transcribe for the job
*/
public List<SegmentToTranscribe> getSegmentsToTranscribe() {
return segmentsToTranscribe;
}
/**
* Specifies specific segments of the media to transcribe.
* This property is optional but can only be used with "human" transcriber.
*
* @param segmentsToTranscribe List of segments to transcribe
*/
public void setSegmentsToTranscribe(List<SegmentToTranscribe> segmentsToTranscribe) {
this.segmentsToTranscribe = segmentsToTranscribe;
}
/**
* Returns the list of speaker names
*
* @return List of speaker names
*/
public List<SpeakerName> getSpeakerNames() {
return speakerNames;
}
/**
* Specifies the list of speaker names in an audio file
* This property is optional but can only be used with "human" transcriber.
*
* @param speakerNames List of speaker names
*/
public void setSpeakerNames(List<SpeakerName> speakerNames) {
this.speakerNames = speakerNames;
}
/**
* Returns summarization options
*
* @return Summarization options
*/
public SummarizationOptions getSummarizationOptions() {
return summarizationOptions;
}
/**
* Specifies summarization options.
*
* @param summarizationOptions Summarization options
*/
public void setSummarizationOptions(SummarizationOptions summarizationOptions) {
this.summarizationOptions = summarizationOptions;
}
/**
* Returns translation options.
*
* @return Translation options
*/
public TranslationOptions getTranslationOptions() {
return translationOptions;
}
/**
* Specifies translation options.
*
* @param translationOptions Translation options
*/
public void setTranslationOptions(TranslationOptions translationOptions) {
this.translationOptions = translationOptions;
}
}