Skip to content

Commit

Permalink
Adding sentiment parameters (#84)
Browse files Browse the repository at this point in the history
* Adding sentiment parameters

* Update prerecordedTranscriptionOptions.ts
  • Loading branch information
michaeljolley authored Oct 30, 2022
1 parent b771ac8 commit 93be92b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
37 changes: 24 additions & 13 deletions src/types/prerecordedTranscriptionOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ export type PrerecordedTranscriptionOptions = {
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/language
*/
language?: string;

/**
* Indicates whether to add punctuation and capitalization to the transcript.
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/punctuate
*/
punctuate?: boolean;

/**
* Indicates whether to remove profanity from the transcript.
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/profanity_filter
*/
profanity_filter?: boolean;

/**
* Indicates whether to redact sensitive information, replacing redacted content with asterisks (*).
* @remarks Options include:
Expand Down Expand Up @@ -92,14 +92,14 @@ export type PrerecordedTranscriptionOptions = {
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/multichannel
*/
multichannel?: boolean;

/**
* Maximum number of transcript alternatives to return. Just like a human listener,
* Deepgram can provide multiple possible interpretations of what it hears.
* @default 1
*/
alternatives?: number;

/**
* Indicates whether to convert numbers from written format (e.g., one) to
* numerical format (e.g., 1). Deepgram can format numbers up to 999,999.
Expand All @@ -108,15 +108,15 @@ export type PrerecordedTranscriptionOptions = {
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/numerals
*/
numerals?: boolean;

/**
* Terms or phrases to search for in the submitted audio. Deepgram searches
* for acoustic patterns in audio rather than text patterns in transcripts
* because we have noticed that acoustic pattern matching is more performant.
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/search
*/
search?: Array<string>;

/**
* Callback URL to provide if you would like your submitted audio to be
* processed asynchronously. When passed, Deepgram will immediately respond
Expand All @@ -127,7 +127,7 @@ export type PrerecordedTranscriptionOptions = {
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/callback
*/
callback?: string;

/**
* Keywords to which the model should pay particular attention to boosting
* or suppressing to help it understand context. Just like a human listener,
Expand All @@ -136,7 +136,7 @@ export type PrerecordedTranscriptionOptions = {
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/keywords
*/
keywords?: Array<string>;

/**
* Indicates whether Deepgram will segment speech into meaningful semantic
* units, which allows the model to interact more naturally and effectively
Expand All @@ -152,7 +152,7 @@ export type PrerecordedTranscriptionOptions = {
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/utterances
*/
utterances?: boolean;

/**
* Length of time in seconds of silence between words that Deepgram will
* use when determining where to split utterances. Used when utterances
Expand All @@ -161,7 +161,7 @@ export type PrerecordedTranscriptionOptions = {
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/utt_split
*/
utt_split?: number;

/**
* Detects the language of the recorded audio and passes audio through appropriate model
*
Expand All @@ -186,16 +186,27 @@ export type PrerecordedTranscriptionOptions = {
* Indicates whether Deepgram should provide summarizations of sections of the provided audio.
*/
summarize?: boolean;

/**
* Corresponds to the language code Deepgram will translate the results into
* For example, 'es', 'fr', 'ja'
* If requests translation in the same language as their ASR request, a 400 will be returned.
*/
translation?: Array<string>;
translation?: Array<string>;

/**
* Indicates whether Deepgram will identify and detect topics in the transcript.
*/
detect_topics?: boolean;

/**
* Indicates whether Deepgram will identify sentiment in the transcript.
*/
analyze_sentiment?: boolean

/**
* Indicates the confidence requirement for non-neutral sentiment.
* Setting this variable turns sentiment analysis on.
*/
sent_thresh?: number
};
4 changes: 3 additions & 1 deletion src/types/usageOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ export type UsageOptions = {
redact?: boolean;
alternatives?: boolean;
numerals?: boolean;
translation?:boolean;
translation?: boolean;
detect_entities?: boolean;
detect_topics?: boolean;
summarize?: boolean;
paragraphs?: boolean;
utt_split?: boolean;
analyze_sentiment?: boolean;
sent_thresh?: boolean;
};

0 comments on commit 93be92b

Please sign in to comment.