Build a Speech Content Safety Detection Tool Using Python | by Ng Wai Foong | Feb, 2022

Add a Native Audio File (Non-obligatory)

python upload_file.py
"upload_url": "https://cdn.assemblyai.com/add/ccbbbfaf-f319-4455-9556-272d48faaf7f"

Make POST Name to Transcript API

knowledge = 
"audio_url": "...",
"content_safety": True,
"content_safety_confidence: 75
python transcribe.py
 "id": "o6x66w9882-8075-4f74-b6c0-b63e9ce8596a"
"language_model": "assemblyai_default",
"acoustic_model": "assemblyai_default",
"language_code": "en_us",
"standing": "queued",
"audio_url": "https://bit.ly/3qDXLG8",
"content_safety": true, ...

Make GET Name to Transcript API

python transcribe_file.py
content_safety_labels": 
"standing": "success",
"outcomes": [

"text": "Yes, that's it. Why does that happen? By calling off the Hunt, your brain can stop persevering on the ugly sister. Giving the correct set of neurons a chance to be activated. Tip of the tongue, especially blocking on a person's name, is totally normal. 25 year olds can experience several tip of the tongues a week, but young people don't sweat them, in part because old age, memory loss and Alzheimer's are nowhere on their radars.",
"labels": [

"label": "health_issues",
"confidence": 0.8165678381919861,
"severity": 0.1607203334569931

],
"timestamp":
"begin": 390066,
"finish": 420714


],
"abstract":
"health_issues": 0.8558240338157502
,
"severity_score_summary":
"health_issues":
"low": 0.5602263590800425,
"medium": 0.4397736409199575,
"excessive": 0


, ...

More Posts