From 2d61d2c86014b758aa9a6e7c24edd1b817256e48 Mon Sep 17 00:00:00 2001 From: Brian Barrow Date: Mon, 31 Oct 2022 14:42:34 -0600 Subject: [PATCH 1/4] added formatting features to live and pre-recorded transcriptions --- src/types/liveTranscriptionOptions.ts | 50 +++++++++++++++++- src/types/prerecordedTranscriptionOptions.ts | 53 ++++++++++++++++++-- src/types/usageOptions.ts | 2 +- src/types/usageRequestDetail.ts | 4 +- 4 files changed, 100 insertions(+), 9 deletions(-) diff --git a/src/types/liveTranscriptionOptions.ts b/src/types/liveTranscriptionOptions.ts index 39bffdf9..ea8f0a0e 100644 --- a/src/types/liveTranscriptionOptions.ts +++ b/src/types/liveTranscriptionOptions.ts @@ -100,9 +100,15 @@ export type LiveTranscriptionOptions = { * numerical format (e.g., 1). Deepgram can format numbers up to 999,999. * @remarks Converted numbers do not include punctuation. For example, * 999,999 would be transcribed as 999999. - * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/numerals + * @see https://developers.deepgram.com/documentation/features/numerals/ */ - numerals?: boolean; + numbers?: boolean; + + /** + * adds spaces between numbers in the transcript + */ + numbers_space?: boolean; + /** * Terms or phrases to search for in the submitted audio. Deepgram searches * for acoustic patterns in audio rather than text patterns in transcripts @@ -182,4 +188,44 @@ export type LiveTranscriptionOptions = { * diarize, or multichannel to true. */ paragraphs?: boolean; + + /** + * Indicates whether to convert dates from written format (e.g., january first) to + * numerical format (e.g., 01-01). + */ + dates?: boolean; + + /** + * Indicates the format the dates will be converted to. Requires dates to be turned on. + * Format string is specified using chrono strftime notation https://docs.rs/chrono/latest/chrono/format/strftime/index.html * + * @example %Y-%m-%d + */ + date_format?: string; + + /** + * Indicates whether to convert times from written format (e.g., three oclock) to + * numerical format (e.g., 3:00). + * */ + times: boolean; + + /** + * Combines dates and times into one formatting option format + */ + datetime?: boolean; + + /** + * Indicates the format the dates will be converted to. Requires dates to be turned on. + * Format string is specified using chrono strftime notation https://docs.rs/chrono/latest/chrono/format/strftime/index.html * + */ + datetime_format?: number; + + /** + * Option to indicate to show dictation in the transcript + */ + dictation?: boolean; + + /** + * Option to format measurements in the transcript + * */ + measurements?: boolean; }; diff --git a/src/types/prerecordedTranscriptionOptions.ts b/src/types/prerecordedTranscriptionOptions.ts index 006fc0f5..a27a9d2b 100644 --- a/src/types/prerecordedTranscriptionOptions.ts +++ b/src/types/prerecordedTranscriptionOptions.ts @@ -107,7 +107,12 @@ export type PrerecordedTranscriptionOptions = { * 999,999 would be transcribed as 999999. * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/numerals */ - numerals?: boolean; + numbers?: boolean; + + /** + * adds spaces between numbers in the transcript + */ + numbers_space?: boolean; /** * Terms or phrases to search for in the submitted audio. Deepgram searches @@ -202,11 +207,51 @@ export type PrerecordedTranscriptionOptions = { /** * Indicates whether Deepgram will identify sentiment in the transcript. */ - analyze_sentiment?: boolean + analyze_sentiment?: boolean; /** - * Indicates the confidence requirement for non-neutral sentiment. + * Indicates the confidence requirement for non-neutral sentiment. * Setting this variable turns sentiment analysis on. */ - sent_thresh?: number + sent_thresh?: number; + + /** + * Indicates whether to convert dates from written format (e.g., january first) to + * numerical format (e.g., 01-01). + */ + dates?: boolean; + + /** + * Indicates the format the dates will be converted to. Requires dates to be turned on. + * Format string is specified using chrono strftime notation https://docs.rs/chrono/latest/chrono/format/strftime/index.html * + * @example %Y-%m-%d + */ + date_format?: string; + + /** + * Indicates whether to convert times from written format (e.g., three oclock) to + * numerical format (e.g., 3:00). + * */ + times: boolean; + + /** + * Combines dates and times into one formatting option format + */ + datetime?: boolean; + + /** + * Indicates the format the dates will be converted to. Requires dates to be turned on. + * Format string is specified using chrono strftime notation https://docs.rs/chrono/latest/chrono/format/strftime/index.html * + */ + datetime_format?: number; + + /** + * Option to indicate to show dictation in the transcript + */ + dictation?: boolean; + + /** + * Option to format measurements in the transcript + * */ + measurements?: boolean; }; diff --git a/src/types/usageOptions.ts b/src/types/usageOptions.ts index cb7bfeb5..6d022f2b 100644 --- a/src/types/usageOptions.ts +++ b/src/types/usageOptions.ts @@ -19,7 +19,7 @@ export type UsageOptions = { search?: boolean; redact?: boolean; alternatives?: boolean; - numerals?: boolean; + numbers?: boolean; translation?: boolean; detect_entities?: boolean; detect_topics?: boolean; diff --git a/src/types/usageRequestDetail.ts b/src/types/usageRequestDetail.ts index 41aa24b0..c5b7ef7c 100644 --- a/src/types/usageRequestDetail.ts +++ b/src/types/usageRequestDetail.ts @@ -24,8 +24,8 @@ export type UsageRequestDetail = { search?: boolean; redact?: boolean; alternatives?: boolean; - numerals?: boolean; - translation?:boolean; + numbers?: boolean; + translation?: boolean; }; }; }; From 2c7d8827d65b721a48cc931424ac7ffe8ae87f65 Mon Sep 17 00:00:00 2001 From: Brian Barrow Date: Tue, 1 Nov 2022 10:37:59 -0600 Subject: [PATCH 2/4] Added numerals back in, removed datetime for now --- src/types/liveTranscriptionOptions.ts | 18 ++++++------------ src/types/prerecordedTranscriptionOptions.ts | 18 ++++++------------ 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/src/types/liveTranscriptionOptions.ts b/src/types/liveTranscriptionOptions.ts index ea8f0a0e..7b8733bf 100644 --- a/src/types/liveTranscriptionOptions.ts +++ b/src/types/liveTranscriptionOptions.ts @@ -104,10 +104,15 @@ export type LiveTranscriptionOptions = { */ numbers?: boolean; + /** + * Same as numbers. Is the old name for the option. Will eventually be deprecated + */ + numerals?: boolean; + /** * adds spaces between numbers in the transcript */ - numbers_space?: boolean; + numbers_spaces?: boolean; /** * Terms or phrases to search for in the submitted audio. Deepgram searches @@ -208,17 +213,6 @@ export type LiveTranscriptionOptions = { * */ times: boolean; - /** - * Combines dates and times into one formatting option format - */ - datetime?: boolean; - - /** - * Indicates the format the dates will be converted to. Requires dates to be turned on. - * Format string is specified using chrono strftime notation https://docs.rs/chrono/latest/chrono/format/strftime/index.html * - */ - datetime_format?: number; - /** * Option to indicate to show dictation in the transcript */ diff --git a/src/types/prerecordedTranscriptionOptions.ts b/src/types/prerecordedTranscriptionOptions.ts index a27a9d2b..c9b67dfa 100644 --- a/src/types/prerecordedTranscriptionOptions.ts +++ b/src/types/prerecordedTranscriptionOptions.ts @@ -109,10 +109,15 @@ export type PrerecordedTranscriptionOptions = { */ numbers?: boolean; + /** + * Same as numbers. Is the old name for the option. Will eventually be deprecated + */ + numerals?: boolean; + /** * adds spaces between numbers in the transcript */ - numbers_space?: boolean; + numbers_spaces?: boolean; /** * Terms or phrases to search for in the submitted audio. Deepgram searches @@ -234,17 +239,6 @@ export type PrerecordedTranscriptionOptions = { * */ times: boolean; - /** - * Combines dates and times into one formatting option format - */ - datetime?: boolean; - - /** - * Indicates the format the dates will be converted to. Requires dates to be turned on. - * Format string is specified using chrono strftime notation https://docs.rs/chrono/latest/chrono/format/strftime/index.html * - */ - datetime_format?: number; - /** * Option to indicate to show dictation in the transcript */ From 393b5fa5b1f30cb6362063b17501fc8670563ec9 Mon Sep 17 00:00:00 2001 From: Brian Barrow Date: Tue, 1 Nov 2022 14:09:13 -0600 Subject: [PATCH 3/4] updated dictation command --- src/types/liveTranscriptionOptions.ts | 4 +++- src/types/prerecordedTranscriptionOptions.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/types/liveTranscriptionOptions.ts b/src/types/liveTranscriptionOptions.ts index 7b8733bf..a37e3c85 100644 --- a/src/types/liveTranscriptionOptions.ts +++ b/src/types/liveTranscriptionOptions.ts @@ -214,7 +214,9 @@ export type LiveTranscriptionOptions = { times: boolean; /** - * Option to indicate to show dictation in the transcript + * Option to format punctuated commands + * Before - “i went to the store period new paragraph then i went home” + * After - “i went to the store. <\n> then i went home” */ dictation?: boolean; diff --git a/src/types/prerecordedTranscriptionOptions.ts b/src/types/prerecordedTranscriptionOptions.ts index c9b67dfa..37a10310 100644 --- a/src/types/prerecordedTranscriptionOptions.ts +++ b/src/types/prerecordedTranscriptionOptions.ts @@ -240,7 +240,9 @@ export type PrerecordedTranscriptionOptions = { times: boolean; /** - * Option to indicate to show dictation in the transcript + * Option to format punctuated commands + * Before - “i went to the store period new paragraph then i went home” + * After - “i went to the store. <\n> then i went home” */ dictation?: boolean; From 6e224431b0e7e03d629f9c3b028df0d3cfdb4b52 Mon Sep 17 00:00:00 2001 From: Brian Barrow Date: Tue, 15 Nov 2022 11:05:59 -0700 Subject: [PATCH 4/4] added numerals back in --- src/types/usageOptions.ts | 1 + src/types/usageRequestDetail.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/types/usageOptions.ts b/src/types/usageOptions.ts index 6d022f2b..f14c9055 100644 --- a/src/types/usageOptions.ts +++ b/src/types/usageOptions.ts @@ -19,6 +19,7 @@ export type UsageOptions = { search?: boolean; redact?: boolean; alternatives?: boolean; + numerals?: boolean; numbers?: boolean; translation?: boolean; detect_entities?: boolean; diff --git a/src/types/usageRequestDetail.ts b/src/types/usageRequestDetail.ts index c5b7ef7c..d8ebb8e9 100644 --- a/src/types/usageRequestDetail.ts +++ b/src/types/usageRequestDetail.ts @@ -24,6 +24,7 @@ export type UsageRequestDetail = { search?: boolean; redact?: boolean; alternatives?: boolean; + numerals?: boolean; numbers?: boolean; translation?: boolean; };