Skip to main content

Python based interface for interacting with Google Cloud's Speech-to-Text API and Cloud Storage API.

Project description

TranscribeInterviews

Python interface for interacting with the Google Speech-to-Text API and Google Cloud Storage API for the purposes of automatic audio transcription. Usage requires a google cloud account with a credential's file issued from it with permissions for both APIs.

Installation

pip install InterviewTranscriber

Example End-to-End Workflow

# 1) Upload audio file(s) to Google Coud Coldline Storage bucket.
from Transcriber.Google.Storage import Storage
from Transcriber.Google.Transcriber import TranscriberBeta

storage_connection = Storage(project_id='<project_id>',
                             credential_path='<path_to_credential_file')
storage_connection.upload_file(bucket_name='<cloud_bucket_name>',
                               source_file_path='<path_to_source_file>')

# 2) Get URI list of files in bucket
file_list = storage_connection.get_uris(bucket_name='<cloud_bucket_name>')

# 3) Send API call to transcribe audio
transcriber = TranscriberBeta(output_directory='<path_to_output_directory>',
                              credential_path='<path_to_credential_file>',
                              contexts_path='<path_to_contexts_file.txt>',
                              speaker_count=2,
                              diarization=True)

transcriber.get_transcriptions(uris=file_list) 

# 4) Export as a Praat TextGrid
transcriber.export_textgrids()                    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

InterviewTranscriber-0.0.2.tar.gz (6.6 kB view hashes)

Uploaded Source

Built Distribution

InterviewTranscriber-0.0.2-py3-none-any.whl (7.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page