This tutorial will teach you how to create blog posts automatically from videos. If you are a content creator, you may find this very useful to speed up the process of writing new posts using just your own video tutorials.
Automatic blog post is a Python project created to generate automatically blog posts from videos.
The final blog post consists of 5 main components: title, summary, image, text and keywords. The image above represents how this architecture works. As you can see, this is a machine learning project with natural language processing.
First, we need to process the video to extract the audio. Using the DeepGram API we can do the speech to text. Later, we split the text into paragraphs. For that, we are analyzing the pause between the words to find if the sentences belong to the same paragraph or if it’s a new one.
Then, we use some pre-trained machine learning models to create the text keywords and summary. We also get the video thumbnail and name, which will be our blog post image and title, respectively.
The final blog post consists of 5 main components: title, summary, image, text and keywords. The image above represents how this architecture works. As you can see, this is a machine learning project with natural language processing.
First, we need to process the video to extract the audio. Using the DeepGram API we can do the speech to text. Later, we split the text into paragraphs. For that, we are analyzing the pause between the words to find if the sentences belong to the same paragraph or if it’s a new one.
Then, we use some pre-trained machine learning models to create the text keywords and summary. We also get the video thumbnail and name, which will be our blog post image and title, respectively.
Getting Started
The first step to run the project is to create a DeepGram account. After that, you can generate an API key. On this page, just click on the button Create a New API Key. You'll have to choose a name for the key, set permission and set the expiration date.
After you click Create Key button, a new key will be created and it's important that you keep it safe.
To run the code, you’ll need Python installed. My suggestion is to use Anaconda, which is an open-source Python distribution platform.
I also recommend that you create a new environment specifically for this project. Check the official tutorial to learn how to download Conda and set up a virtual environment: Conda Getting Started
To install the Python packages, just clone the project and run the following command:
Fill the markdown template with title, image, summary, keywords and text
Saves the markdown in the output directory
Post-processing
If you need some text post-processing, you can use the edit_blog_post module. This can be useful if your video has some domain-specific words. For example, the abbreviation "ASR" (automatic speech recognition) was captured as "As r". So, in the process_dictionary.json file which you will need to put your key-value pair "As r": "ASR".
The process_dictionary.json looks like this:
{
"As r": "ASR",
"Ai": "AI",
"Apis": "APIs"
}
Then, you can use the following command to automatically replace those words. Don't worry, because it will reuse the previous processing. So, it will not download the audio or try to transcript it again.
python edit_blog_post.py --video <youtube_url>
Well, now your post is ready and saved in the same path!
Conclusion
Now that everything is settled. Let’s test it. For demonstration purposes, we will be using the DeepGram video tutorial on Youtube.
Most automatic speech recognition services or ASR are built on technology that's over fifty years old . The old tech is fine for short call and response audio, but it just doesn't work for conversational audio . We built an end to end deep learning neural network that delivers actually usable transcriptions that get even better over time at lightning speed .
Voice enabled experiences are a big deal in business these days. For a good experience, you need a foundation of real time accurate transcription. But most automatic speech recognition services or ASR are built on technology that's over fifty years old.
Yep, even these guys. The old tech is fine for short call and response audio. Alexa, what's the weather today? But it just doesn't work for conversational audio. I'm having a problem with my super user service. This is what's happening. In order to make real use out of voice data, transcription needs to be accurate, fast, cost effective, scalable. With the old tech, you can maybe get one or two of these requirements. But no matter how hard they try, they just can't adapt it to give you all four. So we reinvented it. Hi, we're Deepgram. We built an end to end deep learning neural network. A what? Sorry, an AI speech platform that delivers actually usable transcriptions that get even better over time at lightning speed. Without how hardware costs or high transcription costs. And because we're better faster and cheaper, guess what. We're also more scalable.
So if you've avoided building that great voice feature because you lack the right APIs. Good news, it's time to get to work. Triple espresso, please, what could you do with accurate real time transcription? Oh, just off the top of our heads, You could create conversational ai. Virtual assistance voice analytics agent enable, compliance improvement better customer experience. Just to name a few. We're here to help you go big. If you don't know where to start, don't worry. In addition to providing the best technology stack, Deepgram makes an excellent partner. We know the world is constantly changing. And your audio and transcription needs will two. Will be with you every step of the way from labeling your data to training custom AI models to deployment on prem or in the cloud. To ensure your transcription foundation is powering the experience that actually delight your customers.
So if you're ready to stop chugging along on less than ideal solutions and start building the great voice product, we're ready to help make it happen Deepgram.
Thank you for reading this. Feel free to leave a comment. I hope it was helpful. Let's share some knowledge! See you in the next post! :)