mirror of
https://github.com/jambonz/batch-speech-utils.git
synced 2025-12-19 06:07:43 +00:00
updates in deepgram transcription
This commit is contained in:
3
index.js
3
index.js
@@ -9,6 +9,7 @@ module.exports = (logger) => {
|
||||
|
||||
return {
|
||||
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 timestamps = transcriptResult.results.channels[0].alternatives[0].words;
|
||||
const entities = transcriptResult.results.channels[0].alternatives[0].entities;
|
||||
const confidence = transcriptResult.results.channels[0].alternatives[0].confidence;
|
||||
//redaction
|
||||
const { result:redactionResult } = await client.listen.prerecorded.transcribeFile(fileBuffer, redactionOptions);
|
||||
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 sentiment = sentimentSegment.sentiment;
|
||||
const sentimentScore = sentimentSegment.sentiment_score;
|
||||
const vendor = 'deepgram';
|
||||
return {
|
||||
vendor,
|
||||
transcript,
|
||||
timestamps,
|
||||
redactionTimestamps,
|
||||
redacted,
|
||||
sentiment,
|
||||
sentimentScore,
|
||||
entities
|
||||
entities,
|
||||
confidence
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
const assert = require('assert');
|
||||
const {transcribe:dgTranscribe} = require('./deepgram');
|
||||
|
||||
|
||||
const transcribe = async(logger, credentials, filePath) => {
|
||||
const { vendor } = credentials;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user