Last active
April 28, 2024 14:11
-
-
Save patrickloeber/b2f07d03875961ccbb5d262644325329 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import assemblyai as aai | |
| aai.settings.api_key = "API_KEY" | |
| audio_url = "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3" | |
| config = aai.TranscriptionConfig().set_redact_pii( | |
| policies=[ | |
| aai.PIIRedactionPolicy.person_name, | |
| aai.PIIRedactionPolicy.organization, | |
| aai.PIIRedactionPolicy.occupation, | |
| ], | |
| redact_audio=True, | |
| redact_audio_quality=aai.PIIRedactedAudioQuality.wav | |
| ) | |
| transcriber = aai.Transcriber(config=config) | |
| transcript = transcriber.transcribe(audio_url) | |
| print(transcript.get_redacted_audio_url()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment