Transformer des podcasts en format lisible avec Power Automate et Chat GPT
Table of Contents
- Introduction
- Motivation behind Podcast conversion
- Prerequisites
- Step-by-step guide on creating the flow
- Importance of respecting intellectual property rights
- Setting up your Power Automate account
- Obtaining the podcast transcript
- Creating the flow
- Initializing variables
- Separating the text into chunks
- Removing new lines from the text
- Making the HTTP request to Chat GPT API
- Appending the chunks to final text
- Creating the HTML file
- Converting the HTML file to PDF
- Conclusion
Introduction
In this video, I will demonstrate how to convert a podcast into a readable format using Power Automate and Chat GPT. I will discuss the motivation behind this automation, the prerequisites required, and provide a step-by-step guide on creating the flow.
Motivation behind podcast conversion
Many people prefer reading information rather than listening to it, as it makes it easier to take notes and absorb the material more effectively. However, not all podcasts provide transcripts of their episodes. This led me to develop a solution to convert podcasts into readable formats.
Prerequisites
Before getting started, there are a few prerequisites You need to meet. You will need to have an active Power Automate account with sufficient credits available. Additionally, you will need to Create a OneDrive folder to generate and share the document. Make sure you have the appropriate licenses for Power Automate, as we will be using a premium connector called HTML Connector.
Step-by-step guide on creating the flow
- Obtain the podcast transcript from YouTube or other sources.
- Set up your Power Automate account and ensure you have sufficient credits available.
- Create a OneDrive folder for generating and sharing the document.
- Initialize the necessary variables for the flow, such as the number of characters in each text chunk and the prompt.
- Separate the text into manageable chunks to accommodate token limitations.
- Remove new lines from the text using the Compose action in Power Automate.
- Make an HTTP request to the Chat GPT API, using the model and prompt specified.
- Append the text chunks to the final text variable to create the complete transcript.
- Create an HTML file using the Chat GPT response.
- Convert the HTML file to a PDF or other desired format, using the OneDrive connector.
- Save and test the flow to ensure it works correctly.
Importance of respecting intellectual property rights
It is crucial to acknowledge and respect the original authors and their works when using the solutions or any other materials created by others. Obtain proper permissions before using someone else's materials, particularly for commercial or public use, to avoid legal complications and harm to the original Creators. Always recognize and respect the intellectual property rights of others.
Setting up your Power Automate account
If you don't already have a Power Automate account, follow the steps in my separate video guide on setting up your account. The link to this video will be provided in the description.
Obtaining the podcast transcript
To convert a podcast into a readable format, you will need the podcast transcript. If the podcast has a YouTube Channel, you can find the transcript by navigating to the video, clicking on the three dots, selecting “Show transcripts,” and copying and pasting the text from the transcript window. If the podcast is not available on YouTube, there are tools available that allow you to download the podcast as an MP3 file and obtain the transcript from the same file.
Creating the flow
Now let's create our flow step by step. First, navigate to make.powerapps.com and click on Phillips and Flow. Our trigger will be an Instant cloud flow, which means we will manually trigger it. Add the input for your flow, which will be the podcast transcript text. Next, initialize the necessary variables, such as the chunk variable to store the text chunks and the prompt variable for the API request.
Initializing variables
Initialize the variables needed for the flow, such as the chunk variable and the prompt variable. The chunk variable will store the individual text chunks, and the prompt variable will contain the request for the API. Make sure to adjust the number of characters for the chunk size Based on your specific needs.
Separating the text into chunks
As podcasts can be lengthy, it's important to separate the text into chunks to accommodate token limitations. Use the Compose action in Power Automate to split the text into manageable chunks. The size of each chunk should Align with the token limitations of the Child GPT API. Experiment with different chunk sizes to find the optimal balance.
Removing new lines from the text
To ensure the text is clean and readable, remove any new lines that may have been added during the process. Use the Compose action with the replace expression to remove the new lines from each chunk of text. This will improve the layout and readability of the final transcript.
Making the HTTP request to Chat GPT API
Now, make the HTTP request to the Chat GPT API. Use the HTTP action in Power Automate, specifying the URL and body based on the OpenAI documentation. The model parameter determines which model of Chat GPT to use, and the prompt parameter should contain your request to the API.
Appending the chunks to final text
To create the complete transcript, append each text chunk to the final text variable. Use the Append to STRING Variable action in Power Automate, specifying the final text variable as the value. This will ensure that all the chunks are included in the final transcript, regardless of their size.
Creating the HTML file
Now, create the HTML file using the Chat GPT response. Save the response in the final text variable, which contains the complete transcript. As we requested the text to be formatted as HTML, the file will include appropriate formatting, such as paragraphs and line breaks for better readability.
Converting the HTML file to PDF
To make the transcript more portable and easier to share, convert the HTML file to a PDF. Use the OneDrive connector in Power Automate to create a PDF file from the HTML file. Specify the location and name of the PDF file in the OneDrive folder, and use the content of the HTML file as the body of the PDF document.
Conclusion
By following these steps, you have successfully converted a podcast into a readable format using Power Automate and Chat GPT. This automation not only makes it easier for you to absorb the information but also allows you to take notes and refer back to the content whenever needed. Remember to respect intellectual property rights and obtain proper permissions before using someone else's materials. Thank you for watching, and if you found this video helpful, please don't forget to like and subscribe for more exciting content and tutorials. If you have any questions or suggestions, feel free to leave a comment below. Your feedback is always appreciated as I strive to improve my content.