Jessie A Ellis
Nov 25, 2024 17:52
Uncover the way to transcribe audio recordsdata utilizing Python with AssemblyAI’s Common-1, a mannequin providing near-human accuracy and a number of pricing tiers for various wants.
AssemblyAI has launched its newest speech recognition mannequin, Common-1, setting a brand new benchmark for automated speech recognition (ASR) accuracy. This mannequin is designed to attain near-human transcription accuracy, even in difficult audio environments with accents, background noise, and sophisticated phrases. In accordance with AssemblyAI, the Common-1 mannequin is now accessible through the identical net API as earlier ASR fashions.
New Pricing Tiers for Common-1
Alongside the launch of Common-1, AssemblyAI has unveiled two new pricing tiers: Finest and Nano. The Finest tier is optimized for optimum accuracy, whereas the Nano tier presents an economical resolution supporting transcription in 99 totally different languages. This flexibility permits builders to decide on the fitting steadiness of accuracy and value for his or her particular wants.
Getting Began with the AssemblyAI Python SDK
To facilitate the transcription course of, AssemblyAI gives an official Python SDK. Builders can simply set up the SDK utilizing the command:
pip set up --upgrade assemblyaiAfter putting in, customers want to join an AssemblyAI account to acquire an API key, which is important to authorize API calls in Python scripts.
Transcribing Audio Information with Common-1
As soon as arrange, builders can transcribe audio recordsdata by making a Python script. By default, the SDK makes use of the Finest tier for transcriptions, making certain the best accuracy. The method entails importing the SDK, configuring the API shopper with the API key, and specifying the audio file URL or native path.
import assemblyai as aai
aai.settings.api_key = "YOUR_API_KEY"
transcriber = aai.Transcriber()
audio_file = "https://storage.googleapis.com/aai-web-samples/5_common_sports_injuries.mp3"
transcript = transcriber.transcribe(audio_file)
if transcript.error:
print(transcript.error)
else:
print(transcript.textual content)Working the script will output the transcription leads to the terminal, demonstrating the mannequin’s spectacular capabilities.
Exploring the Nano Tier
For these looking for a extra economical possibility, switching to the Nano tier is easy. Builders can alter the TranscriptionConfig object to make the most of the Nano mannequin by setting the speech_model parameter to “nano”.
config = aai.TranscriptionConfig(speech_model="nano")
transcriber = aai.Transcriber(config=config)
transcript = transcriber.transcribe(audio_file)This flexibility permits for environment friendly use of sources whereas nonetheless benefiting from AssemblyAI’s strong transcription capabilities.
Past Transcription: Extra Options
AssemblyAI’s choices prolong past primary transcription. The platform gives superior options equivalent to entity detection, content material moderation, PII redaction, and the appliance of enormous language fashions (LLMs) to audio information. These capabilities improve the utility of the transcription service, making it appropriate for a variety of functions.
Builders all in favour of leveraging these options can discover AssemblyAI’s documentation and analysis sources for additional insights into constructing superior speech AI options.
Picture supply: Shutterstock


