Skip to content

AWS Transcribe

rdh edited this page Mar 29, 2024 · 8 revisions

Reference

Background

Code

Config

How To

Use Diarization

Config

Something like this in config/ai/asr.yml:

aws: &aws
  adapter: aws
  access_key_id: <%= ENV.fetch('AWS_ACCESS_KEY_ID') %>
  secret_access_key: <%= ENV.fetch('AWS_SECRET_ACCESS_KEY') %>
  region: <%= ENV.fetch('AWS_REGION') %>
  bucket: <%= ENV.fetch('AWS_TRANSCRIBE_BUCKET') %>
  folder: <%= ENV.fetch('AWS_TRANSCRIBE_FOLDER') %>
  language_code: en-US

aws_diarization: &aws_diarization
  <<: *aws
  settings:
    show_speaker_labels: true
    max_speaker_labels: 10

Code

path = 'spec/data/audio/podcast/06_roger_penrose.mp3'
adapter = ActiveIntelligence::ASR::Config.new.adapter(:aws_diarization)
transcript = adapter.diarize(path, raw: true)
Clone this wiki locally