Python Tutorial For Call Center Analysis With AI Using Speech-To-Text

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

Key Takeaways

This video demonstrates how to build a Python application using AssemblyAI's speech-to-text API and Lemur framework to analyze customer calls, providing sentiment analysis and action items. The application is coded in Google Colab and can be downloaded from GitHub.

Full Transcript

hello everyone in this video we're going to be building a very simple python application which makes use of machine learning to analyze customer calls to do this we're going to be making use of assembly ai's powerful speech to text API as well as their llm framework lemur to start off let's take a look at what our end result will look like here is a customer call about a missing package according to the FedEx tracking your parcel was delivered on Monday and left at your front porch That's Impossible my apartment doesn't even have a front porch also I was home all day on Monday and no one attempted to deliver a parcel and side by side you can see our application making use of lemur to retrieve action items from the call and this is an excellent real world use case which is used by a ton of different companies to start off we are going to be coding the logic of this application in Google collab so it's much more easier to run and understand and before we do that to make use of assembly ai's API be sure to go ahead and create a free API key which we'll be using in the application and the link to the API will be in the description box below let's take a look at our application and analyze the core logic behind it the first thing we're doing is selecting an audio for analysis what this does is it allows us to upload an audio file to assembly AI speech to text API which then transcripts that audio file for further analysis and that is exactly what our first function here sent to API is going to do the second thing that we're looking at is sentiment analysis and that is what our second function over here analyze sentiment is going to do the third thing that we're going to be doing is generating action items by making use of the Lemur framework and that is what the third method over here is going to be handling so get action items is going to be generating action items from assembly ai's lemur framework to start off the first thing we're going to do is install assembly ai's python Library into Google collab and we can do that easily by running pip install assembly AI once we've done that we're going to get started on our first function send to API the first thing we're doing in the center API function is defining our API key and this right here is where you should be writing your own API key which you can get from your assembly AI account foreign [Music] so this first function sent to API is complete and what we have essentially written is we have created a transcriber object which will help to transcribe our audio file and once we've done that we've created a transcript variable where we'll be storing our actual transcript that we get from assembly eyes API once we have gotten that transcript what we're going to do is we're going to pass it into our two other functions which is analyzing sentiment and get action items and these are going to be giving us sentiment values and retrieving action items by making use of the Lemur framework once we've done that we're going to return a Json object which includes both the sentiment that we get and also the action items and essentially this Json object is going to make it really easy for us to pass this data into our application UI later on foreign [Music] so this is the analyze sentiment function and this is how it works so assembly AI speech to text API returns a sentiment value for every single sentence which was spoken in the audio file that we sent it and what this function does is it counts all the positive instances and negative instances so whichever is higher that's a sentiment that we're assigning to the entire call and this is the basic logic of this function and we can hit Run next up finally we have the get action items function please [Music] so this is the final function which retrieves the action items from lemur and how it works is we pass our transcript to lemur by calling transcript dot lemur dot action items to specifically retrieve action items because that's what we're looking for besides generating action items lemur can also do summarization as well as question and answering so that can be something interesting to try out as well so when we're passing a query to lemur it's best to provide some sort of context on what your transcript is about so that is why I have included this context that this is a transcript of a call between a customer and a call center agent and also I've given it an answer format in which I expect an answer to be returned so a topic header and followed by relevant action items once we've done that we're going to create a return statement and hit Run next we're going to run the cell by actually calling the send to API function and this time we are going to be passing in our audio file as input for you to analyze and generate all the things that we need like sentiment analysis as well as the action items once that cell runs we're going to print out the response from the API so as you can see the sentiment for this call was mostly negative and lemur has also helped us to generate a lot of important action items which can be used as follow-up so now that we have completed the three main functions that we require for the logic of our application so we simply need to copy these three functions for it to run to download this project file all you have to do is click on the GitHub Link in the description box and you should be able to download the entire project file and what we're going to be doing first is once you open that project file in vs code click on the terminal and what we're first going to be doing is creating a virtual environment and downloading all the required python libraries for this UI application first if we're going to be creating a virtual environment and I'm going to be writing down this command to create a virtual environment once we have done that type in this command to activate the virtual environment that we have just created and once that is activated you should see you should see the name of your virtual environment right here at the beginning of your command line and then what we're going to do is we're going to download all the required python libraries which is actually in the requirements.txt file so just do pip install requirements.txt and this will essentially just download all the python libraries that we need to run our application once that is done let's head over to our application file and click on AI bot dot pi and this contains all the code for our application so as of now I have copied the exact same code that we have written in the Google collab into our project file the only differences that I've done is I've added self to each function to the beginning of each function as a parameter and also self over here as well and once you have done that it is ready to go you can hit run on the application to actually test this out and here's our main application you can go ahead and click select audio fire analysis and I'm going to be selecting an audio file and click open and here we have the final results so we have the overall sentiment analysis as negative since we have given a negative audio file and also with the help of Lima we have managed to generate 18 different action items for customer service the delivery process for call monitoring and Drop Shipping and this was incredibly easy to code with the help of limer's framework and the API let us know what you thought about this video in the comment section below and if you want to see more use cases for lemur you can check out the documentation page which I'll be linking in the description box as well thank you guys for watching And subscribe for more amazing AI content

Original Description

AssemblyAI API: https://www.assemblyai.com/?utm_source=youtube&utm_medium=referral&utm_campaign=yt_smi_7 Google colab: https://colab.research.google.com/drive/1H7m1i2ZDL2mFin5UbopBhUBjqbMnnpY8?usp=sharing Project Github: https://github.com/smithakolan/LeMUR-Call-Analysis-App Step into the future with this tutorial where we leverage the power of AI for call center analysis using Python. This video guides you through the process of building an application that transforms spoken data into actionable insights. In this tutorial, we explore LeMUR (Language Model Understanding and Retrieval), a framework that allows developers to construct applications capable of understanding, analyzing, and even generating text from spoken data. Alongside a robust Speech-to-Text API, you'll be empowered to decode lengthy customer calls in record time. In this video, we: 1. Introduce LeMUR and the Speech-to-Text API. 2 Guide you in setting up your Python environment and necessary dependencies. 3. Demonstrate how to create and configure an application to process call center data. 4. Show the application in action, analyzing a real customer call. By the end of this tutorial, you'll have a solid understanding of how to wield AI for speech analysis. Whether you're an experienced developer diving into AI or a beginner intrigued by the idea of using AI for speech data analysis, this video offers an insightful starting point. #LeMUR #Python #AI #SpeechToText #CallAnalysis #CustomerService #ArtificialIntelligence" ▬▬▬▬▬▬▬▬▬▬▬▬ CONNECT ▬▬▬▬▬▬▬▬▬▬▬▬ 🖥️ Website: https://www.assemblyai.com/?utm_source=youtube&utm_medium=referral&utm_campaign=yt_smi_7 🐦 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 ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ #MachineLearning #DeepLearning
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 build a Python application to analyze customer calls using AssemblyAI's speech-to-text API and Lemur framework, providing sentiment analysis and action items. The application is coded in Google Colab and can be downloaded from GitHub. By following this tutorial, viewers can learn how to use machine learning to improve call center analysis.

Key Takeaways
  1. Install AssemblyAI's Python library
  2. Create a transcriber object to transcribe audio files
  3. Define a function to analyze sentiment
  4. Define a function to generate action items using Lemur
  5. Create a virtual environment and download required Python libraries
  6. Run the application and test it with an audio file
💡 The Lemur framework can be used to generate action items from transcripts, and the AssemblyAI speech-to-text API can be used to transcribe audio files, providing a powerful tool for call center analysis.

Related AI Lessons

Sub-10ms AI Workflows: Accelerating sim.ai with On-Device Semantic Search using Moss
Learn how to accelerate AI workflows with on-device semantic search using Moss, achieving sub-10ms response times and improving user experience
Medium · Machine Learning
Stop Guessing: Guaranteed Structured Output from LLMs in Node.js
Learn to guarantee structured output from LLMs in Node.js and stop parsing JSON manually
Dev.to · Hardik Mehta
Spring AI Tutorial — Your First REST Endpoint with OpenAI (2026)
Build a REST endpoint with Spring Boot 3 and OpenAI to create an LLM-powered API, leveraging the power of AI in your applications
Dev.to AI
Notes: Memory, Context, and Large Language Models (LLMs)
Learn how memory and context work in Large Language Models (LLMs) and potential improvements
Dev.to · Vladimir Panov
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →