Speech recognition in Python made easy | Python Tutorial

AssemblyAI · Beginner ·🧠 Large Language Models ·3y ago

Key Takeaways

The AssemblyAI Python SDK is used for speech recognition and speech understanding, allowing users to transcribe and analyze audio data with just a few lines of code. The SDK provides features such as transcription, summarization, and word search, and can be configured to suit specific needs.

Full Transcript

hi everyone this is Patrick from assembly Ai and in this video we're going to take a look at our python SDK so I show you how you can transcribe and analyze audio data with just a few lines of code so let's get started so first let's set up the python SDK and you can find this on GitHub by the way and to install this you can simply say pip install assembly Ai and now let's jump to the code and the first thing we want to do is import assembly AI S A Ai and then you want to set your API key and you can do this by calling ai. settings. API key and here set your key you can get one for free on our website the link will be in the description below or as a second way you could also set this as a environment variable that has to be called assembly AI API key for example if I open my terminal I could here export assembly AI API key and set this as key and then you don't need this line but here we want to do it with the first option next let's learn how we can trans transcribe files with the SDK so for this we create a transcriber instance and then we can call transcriber do transcribe and this works with either a URL to a file or we can also simply pass in a local file so here I prepared a local MP3 file and now this will start the transcription and this function will block until the transcription is completed and then finally we can simply call transcript. text to see the transcript text so let's comment this one out and use the local file and let's run this and see if it works and as you can see here we get the transcription now this transcript object is of the class transcriber do transcript and you can do many more things with this for example you could check the audio duration or you can get the single sentences by calling transcript. getet sentences and then we can iterate over them and print the text again and as you can see here we get the single sentences or instead of the sentences you can also call transcript. getet paragraphs and then iterate over them and here we get the single paragraphs you can also do a word search for example you can call transcript. word search and here as a list you can pass in all the words you want to search for and then you get the matches back so we can iterate over them and then for example we can print found match. text and then match. count and then you can also get the timestamps for each word and also the indices so let's run this and see if it works and as you can see it found president two times and here we get the corresponding timestamps and the indices and it also found people one time and here is the corresponding Tim stamp now let's learn how we can transcribe files asynchronous so as I've mentioned the transcriber do transcribe function will block until the result is finished so we can also call transcribe async and now this will return a future object from the async io Library so let's run this and this will immediately return and then we can do some other stuff so as you can see this immediately returns and we can see the state is running and then at a later time for examp example we can check if the future is done and then we can get the transcript by calling future. result and now this is again the same transcript object that we've seen before for example here we can now print transcript. text and by now hopefully the state is already completed so now here we should see the text and as you can see this worked so this is how you can transcribe files asynchronously now let's learn how you can configure transcription param and also trigger different audio intelligence features so for this you can set up a transcription config and here you can set different parameters for example you can set punctuate should be false and formatting should be false and then you pass this config when you set up your transcriber object so this is the first way how you could do it you can also directly call this on the transcribe function now we do it with the global configuration and then again you call transcriber transcribe and now we Sprint the transcription. text and let's run this and wait until this is done and here again it prints the transcript but this time without punctuation and formatting you can also use the transcription config to set up different audio intelligence features for example let's use the summarization feature so when we set up the transcription config here we set summarization equals true and then you could also optionally set the summary model and the summary type and here we set this to informative and then to bullets and then we can so this is the second way how we can use it we can directly call this on the transcribe function and then it will overwrite the global config and then since we said summarization equals true we can then access transcript. summary so let's run this and as you can see now we get a summary with two bu points so this was a short guide how you can get started with the python SDK I recommend to check out the documentation to see what else you can do with it and I hope you enjoyed this video so if so then please leave us a like and consider subscribing to our Channel and then I hope to see you in next time bye

Original Description

Learn how to get started with the AssemblyAI Python SDK for speech recognition and speech understanding. In just 5 minutes you'll learn how you can transcribe and analyze audio data. Get your Free Token for AssemblyAI👇 https://www.assemblyai.com/?utm_source=youtube&utm_medium=referral&utm_campaign=yt_pat_77 Python SDK: https://github.com/AssemblyAI/assemblyai-python-sdk Speech recognition in Python made easy | AssemblyAI Python SDK Tutorial ▬▬▬▬▬▬▬▬▬▬▬▬ CONNECT ▬▬▬▬▬▬▬▬▬▬▬▬ 🖥️ Website: https://www.assemblyai.com 🐦 Twitter: https://twitter.com/AssemblyAI 🦾 Discord: https://discord.gg/Cd8MyVJAXd ▶️ Subscribe: https://www.youtube.com/c/AssemblyAI?sub_confirmation=1 🔥 We're hiring! Check our open roles: https://www.assemblyai.com/careers ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ #python #speechrecognition
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from AssemblyAI · AssemblyAI · 0 of 60

← Previous Next →
1 Python Speech Recognition in 5 Minutes
Python Speech Recognition in 5 Minutes
AssemblyAI
2 Python Click Part 1 of 4
Python Click Part 1 of 4
AssemblyAI
3 Python Click Part 2 of 4
Python Click Part 2 of 4
AssemblyAI
4 Python Click Part 3 of 4
Python Click Part 3 of 4
AssemblyAI
5 Python Click Part 4 of 4
Python Click Part 4 of 4
AssemblyAI
6 Deep learning in 5 minutes | What is deep learning?
Deep learning in 5 minutes | What is deep learning?
AssemblyAI
7 How to make a web app that transcribes YouTube videos with Streamlit | Part 1
How to make a web app that transcribes YouTube videos with Streamlit | Part 1
AssemblyAI
8 How to make a web app that transcribes YouTube videos with Streamlit | Part 2
How to make a web app that transcribes YouTube videos with Streamlit | Part 2
AssemblyAI
9 Batch normalization | What it is and how to implement it
Batch normalization | What it is and how to implement it
AssemblyAI
10 Real-time Speech Recognition in 15 minutes with AssemblyAI
Real-time Speech Recognition in 15 minutes with AssemblyAI
AssemblyAI
11 Regularization in a Neural Network | Dealing with overfitting
Regularization in a Neural Network | Dealing with overfitting
AssemblyAI
12 Add speech recognition to your Streamlit apps in 5 minutes
Add speech recognition to your Streamlit apps in 5 minutes
AssemblyAI
13 Transformers for beginners | What are they and how do they work
Transformers for beginners | What are they and how do they work
AssemblyAI
14 Automatic Chapter Detection With AssemblyAI | Python Tutorial
Automatic Chapter Detection With AssemblyAI | Python Tutorial
AssemblyAI
15 Deep Learning Series Part 1 - What is Deep Learning?
Deep Learning Series Part 1 - What is Deep Learning?
AssemblyAI
16 Deep Learning Series part 2 - Why is it called “Deep Learning”?
Deep Learning Series part 2 - Why is it called “Deep Learning”?
AssemblyAI
17 Activation Functions In Neural Networks Explained | Deep Learning Tutorial
Activation Functions In Neural Networks Explained | Deep Learning Tutorial
AssemblyAI
18 Deep Learning Series part 3 - Deep Learning vs. Machine Learning
Deep Learning Series part 3 - Deep Learning vs. Machine Learning
AssemblyAI
19 Deep Learning Series part 4 - Why is Deep Learning better for NLP?
Deep Learning Series part 4 - Why is Deep Learning better for NLP?
AssemblyAI
20 Intro to Batch Normalization Part 1
Intro to Batch Normalization Part 1
AssemblyAI
21 Intro to Batch Normalization Part 2
Intro to Batch Normalization Part 2
AssemblyAI
22 Intro to Batch Normalization Part 3 - What is Normalization?
Intro to Batch Normalization Part 3 - What is Normalization?
AssemblyAI
23 Intro to Batch Normalization Part 4
Intro to Batch Normalization Part 4
AssemblyAI
24 Intro to Batch Normalization Part 5
Intro to Batch Normalization Part 5
AssemblyAI
25 Sentiment Analysis for Earnings Calls with AssemblyAI
Sentiment Analysis for Earnings Calls with AssemblyAI
AssemblyAI
26 Summarizing my favorite podcasts with Python
Summarizing my favorite podcasts with Python
AssemblyAI
27 Introduction to Regularization
Introduction to Regularization
AssemblyAI
28 How/Why Regularization in Neural Networks?
How/Why Regularization in Neural Networks?
AssemblyAI
29 Getting Started With Torchaudio | PyTorch Tutorial
Getting Started With Torchaudio | PyTorch Tutorial
AssemblyAI
30 Types of Regularization
Types of Regularization
AssemblyAI
31 Tuning Alpha in L1 and L2 Regularization
Tuning Alpha in L1 and L2 Regularization
AssemblyAI
32 Dropout Regularization
Dropout Regularization
AssemblyAI
33 What is GPT-3 and how does it work? | A Quick Review
What is GPT-3 and how does it work? | A Quick Review
AssemblyAI
34 Backpropagation For Neural Networks Explained | Deep Learning Tutorial
Backpropagation For Neural Networks Explained | Deep Learning Tutorial
AssemblyAI
35 Jupyter Notebooks Tutorial | How to use them & tips and tricks!
Jupyter Notebooks Tutorial | How to use them & tips and tricks!
AssemblyAI
36 Best Free Speech-To-Text APIs and Open Source Libraries
Best Free Speech-To-Text APIs and Open Source Libraries
AssemblyAI
37 Regularization - Early stopping
Regularization - Early stopping
AssemblyAI
38 Regularization - Data Augmentation
Regularization - Data Augmentation
AssemblyAI
39 Bias and Variance for Machine Learning | Deep Learning
Bias and Variance for Machine Learning | Deep Learning
AssemblyAI
40 Recurrent Neural Networks (RNNs) Explained - Deep Learning
Recurrent Neural Networks (RNNs) Explained - Deep Learning
AssemblyAI
41 What is BERT and how does it work? | A Quick Review
What is BERT and how does it work? | A Quick Review
AssemblyAI
42 Introduction to Transformers
Introduction to Transformers
AssemblyAI
43 Transformers | What is attention?
Transformers | What is attention?
AssemblyAI
44 Transformers | how attention relates to Transformers
Transformers | how attention relates to Transformers
AssemblyAI
45 Transformers | Basics of Transformers
Transformers | Basics of Transformers
AssemblyAI
46 Supervised Machine Learning Explained For Beginners
Supervised Machine Learning Explained For Beginners
AssemblyAI
47 Transformers | Basics of Transformers Encoders
Transformers | Basics of Transformers Encoders
AssemblyAI
48 Transformers | Basics of Transformers I/O
Transformers | Basics of Transformers I/O
AssemblyAI
49 How to evaluate ML models | Evaluation metrics for machine learning
How to evaluate ML models | Evaluation metrics for machine learning
AssemblyAI
50 Unsupervised Machine Learning Explained For Beginners
Unsupervised Machine Learning Explained For Beginners
AssemblyAI
51 Weight Initialization for Deep Feedforward Neural Networks
Weight Initialization for Deep Feedforward Neural Networks
AssemblyAI
52 Q-Learning Explained - Reinforcement Learning Tutorial
Q-Learning Explained - Reinforcement Learning Tutorial
AssemblyAI
53 Should You Use PyTorch or TensorFlow in 2022?
Should You Use PyTorch or TensorFlow in 2022?
AssemblyAI
54 What is Layer Normalization? | Deep Learning Fundamentals
What is Layer Normalization? | Deep Learning Fundamentals
AssemblyAI
55 I created a Python App to study FASTER
I created a Python App to study FASTER
AssemblyAI
56 How to create your FIRST NEURAL NETWORK with TensorFlow!
How to create your FIRST NEURAL NETWORK with TensorFlow!
AssemblyAI
57 Neural Networks Summary: All hyperparameters
Neural Networks Summary: All hyperparameters
AssemblyAI
58 Getting Started with OpenAI API and GPT-3 | Beginner Python Tutorial
Getting Started with OpenAI API and GPT-3 | Beginner Python Tutorial
AssemblyAI
59 Convert Speech-To-Text In Python in 60 seconds!
Convert Speech-To-Text In Python in 60 seconds!
AssemblyAI
60 Gradient Clipping for Neural Networks | Deep Learning Fundamentals
Gradient Clipping for Neural Networks | Deep Learning Fundamentals
AssemblyAI

This video teaches how to use the AssemblyAI Python SDK for speech recognition and speech understanding, covering topics such as transcription, summarization, and word search. The SDK provides an easy-to-use interface for analyzing audio data, and can be configured to suit specific needs. By following this tutorial, users can learn how to get started with the SDK and start building their own speech recognition applications.

Key Takeaways
  1. Install the AssemblyAI Python SDK using pip
  2. Set up an API key and configure the SDK
  3. Create a transcriber instance and call the transcribe function
  4. Configure transcription parameters using a transcription config
  5. Use the summarization feature to generate a summary of the audio data
  6. Perform a word search on the transcribed text
💡 The AssemblyAI Python SDK provides a simple and easy-to-use interface for speech recognition and speech understanding, allowing users to build powerful applications with just a few lines of code.

Related AI Lessons

I Asked ChatGPT to Fix My Life. It Couldn’t — Until I Changed One Thing
Learn how to effectively use AI like ChatGPT to improve your life by changing your approach
Medium · AI
I Asked ChatGPT to Fix My Life. It Couldn’t — Until I Changed One Thing
Learn how to effectively use ChatGPT to solve personal problems by changing your approach
Medium · ChatGPT
Claude Sonnet 5 Is Here: Why It Might Replace Your Opus Subscription
Learn about Claude Sonnet 5, a new AI model that offers near-flagship performance at a lower price, and its potential to replace Opus subscriptions
Medium · Programming
Claude AI vs ChatGPT: Which One Is Actually Better in 2026?
Compare Claude AI and ChatGPT based on real-world usage and benchmarking to determine which one is better in 2026
Medium · AI
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →