Skip to content

Commit

Permalink
Merge pull request #85 from deepgram/formatting-features
Browse files Browse the repository at this point in the history
added formatting features to live and pre-recorded transcriptions
  • Loading branch information
briancbarrow authored Nov 15, 2022
2 parents 93be92b + 6e22443 commit 3beafe1
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 5 deletions.
44 changes: 43 additions & 1 deletion src/types/liveTranscriptionOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,20 @@ 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/
*/
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_spaces?: boolean;

/**
* Terms or phrases to search for in the submitted audio. Deepgram searches
* for acoustic patterns in audio rather than text patterns in transcripts
Expand Down Expand Up @@ -182,4 +193,35 @@ 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;

/**
* 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;

/**
* Option to format measurements in the transcript
* */
measurements?: boolean;
};
47 changes: 44 additions & 3 deletions src/types/prerecordedTranscriptionOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,18 @@ export type PrerecordedTranscriptionOptions = {
* 999,999 would be transcribed as 999999.
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/numerals
*/
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_spaces?: boolean;

/**
* Terms or phrases to search for in the submitted audio. Deepgram searches
* for acoustic patterns in audio rather than text patterns in transcripts
Expand Down Expand Up @@ -202,11 +212,42 @@ 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;

/**
* 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;

/**
* Option to format measurements in the transcript
* */
measurements?: boolean;
};
1 change: 1 addition & 0 deletions src/types/usageOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type UsageOptions = {
redact?: boolean;
alternatives?: boolean;
numerals?: boolean;
numbers?: boolean;
translation?: boolean;
detect_entities?: boolean;
detect_topics?: boolean;
Expand Down
3 changes: 2 additions & 1 deletion src/types/usageRequestDetail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export type UsageRequestDetail = {
redact?: boolean;
alternatives?: boolean;
numerals?: boolean;
translation?:boolean;
numbers?: boolean;
translation?: boolean;
};
};
};

0 comments on commit 3beafe1

Please sign in to comment.