Skip to main content
This guide will show you how to use AssemblyAI’s LLM Gateway to redact personally identifiable information (PII) from text.

Quickstart

Get Started

Before we begin, make sure you have an AssemblyAI account and an API key. You can sign up for an account and get your API key from your dashboard.

Step-by-Step Instructions

Install dependencies

Install the required packages:
Import the required packages and set up your API client:
Define a function generate_ner that uses LLM Gateway to identify named entities (person names, organizations, emails, phone numbers, addresses) in a given text.
Transcribe an audio file using the AssemblyAI API:
Split the transcript into sentences, identify named entities using generate_ner, and replace them with # characters:
Print the fully redacted transcript: