mirror of
https://github.com/jambonz/batch-speech-utils.git
synced 2026-07-24 13:12:21 +00:00
updates in deepgram transcription
This commit is contained in:
@@ -9,6 +9,7 @@ module.exports = (logger) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
transcribe: require('./lib/transcribe').bind(null, logger),
|
transcribe: require('./lib/transcribe').bind(null, logger),
|
||||||
redact: require('./lib/redact').bind(null, logger)
|
redact: require('./lib/redact').bind(null, logger),
|
||||||
|
transcript_json : require('./lib/schema/transciption-template')
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ const transcribe = async(logger, apiKey, filePath) => {
|
|||||||
const transcript = transcriptResult.results.channels[0].alternatives[0].transcript;
|
const transcript = transcriptResult.results.channels[0].alternatives[0].transcript;
|
||||||
const timestamps = transcriptResult.results.channels[0].alternatives[0].words;
|
const timestamps = transcriptResult.results.channels[0].alternatives[0].words;
|
||||||
const entities = transcriptResult.results.channels[0].alternatives[0].entities;
|
const entities = transcriptResult.results.channels[0].alternatives[0].entities;
|
||||||
|
const confidence = transcriptResult.results.channels[0].alternatives[0].confidence;
|
||||||
//redaction
|
//redaction
|
||||||
const { result:redactionResult } = await client.listen.prerecorded.transcribeFile(fileBuffer, redactionOptions);
|
const { result:redactionResult } = await client.listen.prerecorded.transcribeFile(fileBuffer, redactionOptions);
|
||||||
const redactionTimestamps = redactionResult.results.channels[0].alternatives[0].words;
|
const redactionTimestamps = redactionResult.results.channels[0].alternatives[0].words;
|
||||||
@@ -22,14 +23,17 @@ const transcribe = async(logger, apiKey, filePath) => {
|
|||||||
const sentimentSegment = analysisResult.results.sentiments.segments[0];
|
const sentimentSegment = analysisResult.results.sentiments.segments[0];
|
||||||
const sentiment = sentimentSegment.sentiment;
|
const sentiment = sentimentSegment.sentiment;
|
||||||
const sentimentScore = sentimentSegment.sentiment_score;
|
const sentimentScore = sentimentSegment.sentiment_score;
|
||||||
|
const vendor = 'deepgram';
|
||||||
return {
|
return {
|
||||||
|
vendor,
|
||||||
transcript,
|
transcript,
|
||||||
timestamps,
|
timestamps,
|
||||||
redactionTimestamps,
|
redactionTimestamps,
|
||||||
redacted,
|
redacted,
|
||||||
sentiment,
|
sentiment,
|
||||||
sentimentScore,
|
sentimentScore,
|
||||||
entities
|
entities,
|
||||||
|
confidence
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const {transcribe:dgTranscribe} = require('./deepgram');
|
const {transcribe:dgTranscribe} = require('./deepgram');
|
||||||
|
|
||||||
|
|
||||||
const transcribe = async(logger, credentials, filePath) => {
|
const transcribe = async(logger, credentials, filePath) => {
|
||||||
const { vendor } = credentials;
|
const { vendor } = credentials;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user