Skip to content

Commit

Permalink
Update batch jobs API with new speech intelligence features (#32)
Browse files Browse the repository at this point in the history
* Update batch jobs API with new speech intelligence features

- Topic detection
- Auto chapters

Additional formatting to YAML file, and removing examples
  • Loading branch information
mnemitz authored Jan 10, 2024
1 parent 78a1495 commit 8ef8d53
Show file tree
Hide file tree
Showing 21 changed files with 666 additions and 581 deletions.
921 changes: 348 additions & 573 deletions schemas/batch.yml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/types/models/audio-format-raw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export type AudioFormatRawEncodingEnum =
typeof AudioFormatRawEncodingEnum[keyof typeof AudioFormatRawEncodingEnum];
export const AudioFormatRawTypeEnum = {
Raw: 'raw',
File: 'file',
} as const;

export type AudioFormatRawTypeEnum =
Expand Down
2 changes: 1 addition & 1 deletion src/types/models/batch-recognition-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { JobType } from './job-type';
import { OutputConfig } from './output-config';

/**
* Summary information about the output from an ASR job, comprising the job type and configuration parameters used when generating the output
* Summary information about the output from an ASR job, comprising the job type and configuration parameters used when generating the output.
* @export
* @interface BatchRecognitionMetadata
*/
Expand Down
1 change: 1 addition & 0 deletions src/types/models/batch-recognition-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export interface BatchRecognitionResult {
export const BatchRecognitionResultTypeEnum = {
Word: 'word',
Punctuation: 'punctuation',
SpeakerChange: 'speaker_change',
} as const;

export type BatchRecognitionResultTypeEnum =
Expand Down
2 changes: 1 addition & 1 deletion src/types/models/batch-translation-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
export interface BatchTranslationConfig {
/**
* Array of ISO language codes that you would like your audio to be translated into.
*
* @type {Array<string>}
* @memberof BatchTranslationConfig
*/
Expand Down
45 changes: 45 additions & 0 deletions src/types/models/chapter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI Template
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

/**
*
* @export
* @interface Chapter
*/
export interface Chapter {
/**
*
* @type {number}
* @memberof Chapter
*/
end_time?: number;
/**
*
* @type {number}
* @memberof Chapter
*/
start_time?: number;
/**
*
* @type {string}
* @memberof Chapter
*/
summary?: string;
/**
*
* @type {string}
* @memberof Chapter
*/
title?: string;
}
2 changes: 2 additions & 0 deletions src/types/models/error-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const ErrorResponseErrorEnum = {
Forbidden: 'Forbidden',
ResourceLocked: 'Resource Locked',
FormatNotSupported: 'Format Not Supported',
InsufficientCredit: 'Insufficient Credit',
InternalServerError: 'Internal Server Error',
JobError: 'Job error',
JobExpired: 'Job Expired',
Expand All @@ -63,6 +64,7 @@ export const ErrorResponseErrorEnum = {
PermissionDenied: 'Permission Denied',
RequestedProductNotAvailable: 'Requested product not available',
TranscriptionNotReady: 'Transcription not ready',
LatticeNotGenerated: 'Lattice not generated',
LogFileNotAvailable: 'Log file not available',
RequestedEarlyAccessReleaseNotAvailable:
'Requested Early Access Release not available',
Expand Down
7 changes: 7 additions & 0 deletions src/types/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export * from './batch-transcription-config-additional-vocab-inner';
export * from './batch-transcription-config-punctuation-overrides';
export * from './batch-transcription-config-speaker-diarization-config';
export * from './batch-translation-config';
export * from './chapter';
export * from './create-job-response';
export * from './data-fetch-config';
export * from './delete-job-response';
Expand Down Expand Up @@ -61,6 +62,12 @@ export * from './set-recognition-config';
export * from './start-recognition';
export * from './summarization-config';
export * from './summarization-result';
export * from './topic-detection-config';
export * from './topic-detection-result';
export * from './topic-detection-result-topics';
export * from './topic-detection-segment';
export * from './topic-detection-segment-topic';
export * from './topic-detection-summary';
export * from './tracking-data';
export * from './translated-sentence';
export * from './translation-sentence';
Expand Down
17 changes: 16 additions & 1 deletion src/types/models/job-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ import { OutputConfig } from './output-config';
import { SummarizationConfig } from './summarization-config';
// May contain unused imports in some cases
// @ts-ignore
import { TopicDetectionConfig } from './topic-detection-config';
// May contain unused imports in some cases
// @ts-ignore
import { TrackingData } from './tracking-data';

/**
* JSON object that contains various groups of job configuration parameters. Based on the value of `type`, a type-specific object such as `transcription_config` is required to be present to specify all configuration settings or parameters needed to process the job inputs as expected. If the results of the job are to be forwarded on completion, `notification_config` can be provided with a list of callbacks to be made; no assumptions should be made about the order in which they will occur. Customer specific job details or metadata can be supplied in `tracking`, and this information will be available where possible in the job results and in callbacks.
* JSON object that contains various groups of job configuration parameters. Based on the value of `type`, a type-specific object such as `transcription_config` is required to be present to specify all configuration settings or parameters needed to process the job inputs as expected. If the results of the job are to be forwarded on completion, `notification_config` can be provided with a list of callbacks to be made; no assumptions should be made about the order in which they will occur. Customer specific job details or metadata can be supplied in `tracking`, and this information will be available where possible in the job results and in callbacks.
* @export
* @interface JobConfig
*/
Expand All @@ -55,6 +58,12 @@ export interface JobConfig {
* @memberof JobConfig
*/
alignment_config?: AlignmentConfig;
/**
*
* @type {object}
* @memberof JobConfig
*/
auto_chapters_config?: object;
/**
*
* @type {DataFetchConfig}
Expand Down Expand Up @@ -97,6 +106,12 @@ export interface JobConfig {
* @memberof JobConfig
*/
summarization_config?: SummarizationConfig;
/**
*
* @type {TopicDetectionConfig}
* @memberof JobConfig
*/
topic_detection_config?: TopicDetectionConfig;
/**
*
* @type {TrackingData}
Expand Down
4 changes: 2 additions & 2 deletions src/types/models/job-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { JobConfig } from './job-config';
import { JobDetailError } from './job-detail-error';

/**
* Document describing a job, including the status and config used. This model will be returned when you get job details or list all jobs.
* Document describing a job. JobConfig will be present in JobDetails returned for GET jobs/<id> request in SaaS and in Batch Appliance, but it will not be present in JobDetails returned as item in RetrieveJobsResponse in case of Batch Appliance.
* @export
* @interface JobDetails
*/
Expand Down Expand Up @@ -68,7 +68,7 @@ export interface JobDetails {
*/
lang?: string;
/**
* The status of the job. - `running` - The job is actively running - `done` - The job completed successfully. - `rejected` - The job was accepted at first, but later could not be processed by the transcriber. - `deleted` - The user deleted the job. - `expired` - The system deleted the job. Usually because the job was in the `done` state for a very long time.
* The status of the job. * `running` - The job is actively running. * `done` - The job completed successfully. * `rejected` - The job was accepted at first, but later could not be processed by the transcriber. * `deleted` - The user deleted the job. * `expired` - The system deleted the job. Usually because the job was in the `done` state for a very long time.
* @type {string}
* @memberof JobDetails
*/
Expand Down
2 changes: 1 addition & 1 deletion src/types/models/job-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { TrackingData } from './tracking-data';

/**
* Summary information about an ASR job, to support identification and tracking
* Summary information about an ASR job, to support identification and tracking.
* @export
* @interface JobInfo
*/
Expand Down
21 changes: 21 additions & 0 deletions src/types/models/language-identification-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,31 @@
* @interface LanguageIdentificationConfig
*/
export interface LanguageIdentificationConfig {
/**
*
* @type {string}
* @memberof LanguageIdentificationConfig
*/
default_language?: string;
/**
*
* @type {Array<string>}
* @memberof LanguageIdentificationConfig
*/
expected_languages?: Array<string>;
/**
* Action to take if all of the predicted languages are below the confidence threshold
* @type {string}
* @memberof LanguageIdentificationConfig
*/
low_confidence_action?: LanguageIdentificationConfigLowConfidenceActionEnum;
}

export const LanguageIdentificationConfigLowConfidenceActionEnum = {
Allow: 'allow',
Reject: 'reject',
UseDefaultLanguage: 'use_default_language',
} as const;

export type LanguageIdentificationConfigLowConfidenceActionEnum =
typeof LanguageIdentificationConfigLowConfidenceActionEnum[keyof typeof LanguageIdentificationConfigLowConfidenceActionEnum];
1 change: 1 addition & 0 deletions src/types/models/notification-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const NotificationConfigContentsEnum = {
AlignmentOnePerLine: 'alignment.one_per_line',
Data: 'data',
Text: 'text',
Lattice: 'lattice',
} as const;

export type NotificationConfigContentsEnum =
Expand Down
18 changes: 18 additions & 0 deletions src/types/models/retrieve-transcript-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import { BatchRecognitionMetadata } from './batch-recognition-metadata';
import { BatchRecognitionResult } from './batch-recognition-result';
// May contain unused imports in some cases
// @ts-ignore
import { Chapter } from './chapter';
// May contain unused imports in some cases
// @ts-ignore
import { JobInfo } from './job-info';
// May contain unused imports in some cases
// @ts-ignore
Expand All @@ -29,6 +32,9 @@ import { SentimentAnalysisResult } from './sentiment-analysis-result';
import { SummarizationResult } from './summarization-result';
// May contain unused imports in some cases
// @ts-ignore
import { TopicDetectionResult } from './topic-detection-result';
// May contain unused imports in some cases
// @ts-ignore
import { TranslationSentence } from './translation-sentence';

/**
Expand All @@ -37,6 +43,12 @@ import { TranslationSentence } from './translation-sentence';
* @interface RetrieveTranscriptResponse
*/
export interface RetrieveTranscriptResponse {
/**
* An array of objects that represent summarized chapters of the transcript
* @type {Array<Chapter>}
* @memberof RetrieveTranscriptResponse
*/
chapters?: Array<Chapter>;
/**
* Speechmatics JSON transcript format version number.
* @type {string}
Expand Down Expand Up @@ -73,6 +85,12 @@ export interface RetrieveTranscriptResponse {
* @memberof RetrieveTranscriptResponse
*/
summary?: SummarizationResult;
/**
*
* @type {TopicDetectionResult}
* @memberof RetrieveTranscriptResponse
*/
topics?: TopicDetectionResult;
/**
* Translations of the transcript into other languages. It is a map of ISO language codes to arrays of translated sentences. Configured using `translation_config`.
* @type {{ [key: string]: Array<TranslationSentence>; }}
Expand Down
2 changes: 1 addition & 1 deletion src/types/models/sentiment-analysis-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { SentimentAnalysisResultSentimentAnalysis } from './sentiment-analysis-result-sentiment-analysis';

/**
* Analysis of the sentiment of the transcript, configured using `sentiment_analysis_config`.
* The main object that holds sentiment analysis data.
* @export
* @interface SentimentAnalysisResult
*/
Expand Down
27 changes: 27 additions & 0 deletions src/types/models/topic-detection-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI Template
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

/**
*
* @export
* @interface TopicDetectionConfig
*/
export interface TopicDetectionConfig {
/**
*
* @type {Array<string>}
* @memberof TopicDetectionConfig
*/
topics?: Array<string>;
}
40 changes: 40 additions & 0 deletions src/types/models/topic-detection-result-topics.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI Template
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

// May contain unused imports in some cases
// @ts-ignore
import { TopicDetectionSegment } from './topic-detection-segment';
// May contain unused imports in some cases
// @ts-ignore
import { TopicDetectionSummary } from './topic-detection-summary';

/**
* Holds the detailed topic detection results.
* @export
* @interface TopicDetectionResultTopics
*/
export interface TopicDetectionResultTopics {
/**
* An array of objects that represent a segment of text and its associated topic information.
* @type {Array<TopicDetectionSegment>}
* @memberof TopicDetectionResultTopics
*/
segments?: Array<TopicDetectionSegment>;
/**
*
* @type {TopicDetectionSummary}
* @memberof TopicDetectionResultTopics
*/
summary?: TopicDetectionSummary;
}
31 changes: 31 additions & 0 deletions src/types/models/topic-detection-result.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI Template
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

// May contain unused imports in some cases
// @ts-ignore
import { TopicDetectionResultTopics } from './topic-detection-result-topics';

/**
* Main object that holds topic detection results.
* @export
* @interface TopicDetectionResult
*/
export interface TopicDetectionResult {
/**
*
* @type {TopicDetectionResultTopics}
* @memberof TopicDetectionResult
*/
topics?: TopicDetectionResultTopics;
}
Loading

0 comments on commit 8ef8d53

Please sign in to comment.