Redact PII from Text Using LeMUR
This guide will show you how to use AssemblyAI’s LeMUR framework 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.
For information about LeMUR pricing, see our pricing page.
Step-by-Step Instructions
Install the SDK.
Import the assemblyai
package and set your API key.
Define a function generate_ner
that uses LeMUR to identify named entities (person names, organizations, emails, phone numbers, addresses) in a given text.
Transcribe an audio file using the AssemblyAI Transcriber.
Iterate through each sentence in the transcript, identify named entities using generate_ner
, and replace them with # characters.
Print the redacted transcript.