Skip to content

Instantly share code, notes, and snippets.

@gmyrianthous
Created January 30, 2022 17:31
Show Gist options
  • Select an option

  • Save gmyrianthous/f9da9681e702bea96ea863b0c8e71cd5 to your computer and use it in GitHub Desktop.

Select an option

Save gmyrianthous/f9da9681e702bea96ea863b0c8e71cd5 to your computer and use it in GitHub Desktop.
Speech-to-Text and PII removal - Part 3
TRANSCRIPT_ENDPOINT = 'https://api.assemblyai.com/v2/transcript'
res_transcript = requests.post(
TRANSCRIPT_ENDPOINT,
headers=headers,
json={
'audio_url': upload_url,
'redact_pii': True,
'redact_pii_sub': 'entity_name',
},
)
res_transcript_json = res_transcript.json()
"""
Example response from transcript endpoint
print(res_transcript_json)
{
'id': 'w9w13r544-8459-4b06-8d7a-1e9accee4b61',
'language_model': 'assemblyai_default',
'acoustic_model': 'assemblyai_default',
'language_code': 'en_us',
'status': 'queued',
'audio_url': 'https://cdn.assemblyai.com/upload/4eb47686-249d-4d48-9b79-62aea715d735',
'text': None,
'words': None,
'utterances': None,
'confidence': None,
'audio_duration': None,
'punctuate': True,
'format_text': True,
'dual_channel': None,
'webhook_url': None,
'webhook_status_code': None,
'speed_boost': False,
'auto_highlights_result': None,
'auto_highlights': False,
'audio_start_from': None,
'audio_end_at': None,
'word_boost': [],
'boost_param': None,
'filter_profanity': False,
'redact_pii': True,
'redact_pii_audio': False,
'redact_pii_audio_quality': None,
'redact_pii_policies': None,
'redact_pii_sub': 'entity_name',
'speaker_labels': False,
'content_safety': False,
'iab_categories': False,
'content_safety_labels': {},
'iab_categories_result': {}
}
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment