Artificial Intelligence and Machine Learning Blogs
Explore AI and ML blogs. Discover use cases, advancements, and the transformative potential of AI for businesses. Stay informed of trends and applications.
cancel
Showing results for 
Search instead for 
Did you mean: 
Sergiu
Contributor
Author: iatco.sergiu

There are a lot of debates about how to trust Artificial Intelligence Large language models. In this blog post, I will further explore the capabilities of OpenAI API by developing an interactive application to build trust.

Open application YouTube Transcript OpenAI Assistant 🤖

Table of content


Does Artificial Intelligence work?
Does Artificial Intelligence work with my data?
How does Artificial Intelligence work?
Conclusions

The previous blog "SAP Machine Learning Embedding in OpenAI" describes collecting and embedding data from various sources. The solution is presented in a Jupyter Notebook which you can run locally or with Binder. This requires technical skills to be convinced of what the code is doing and if it is working. Data in the previous blog were collected from different sources except one - YouTube.


Time is the most valuable commodity of all. Time is scarce, content is abundant, and you want to assimilate it in less time. While the video presents information in the most detailed way, it takes time to watch it. Summarizing it gets us back to the abstraction of it into words, the most time-efficient method of communication.

Does Artificial Intelligence work?


To bring the code to life, I made the decision to create an online app called "YouTube Transcript OpenAI Assistant" 🤖.

I participated in the SAP HANA ML Challenge – Employee Churn 🤖 and I came in second place 🏆.

Two YouTube videos are available from the Challenge, "SAP HANA Cloud Machine Learning Challenge Kick-Off" and "SAP HANA Cloud Machine Learning Challenge Solutions". The corresponding video and the link are displayed by selecting one of them from the drop list. Pressing the "Transcript" button will display the transcript, if it exists, in the text area labelled "Transcript". If an index for embedding already exists, it doesn't cost any tokens to use. You must enter and validate your OpenAI key to embed the content and ask questions. For some videos, YouTube doesn't allow display within the application, but the "Extract Transcript" feature still works and you can open the video from the link. If everything goes correctly, the input text will open and you can ask questions.

Steps to run the YouTube Transcript OpenAI Assistant.

  1. Select a Demo or Try It!

  2. In case the Demo link is completed in case of Try it, you can enter it.

  3. Press Extract Transcript. The transcript text is completed.

  4. Press Download Transcript if you want to save it.

  5. Enter the OpenAI API key and press Validate API key. If the key is valid, the message "OpenAI API key is valid" is displayed, otherwise an error message is displayed. In the app, OpenAI API calls GPT-3.5 models.

  6. Below the Transcript area, you have an estimation of token costs. In the case of Demo, the index is already created. With Try It! costs are billed with the Embed transcript.

  7. After Transcript is embedded the input You: is available and you can start asking questions. Questions (prompts) cost tokens.

  8. Chat can be downloaded with Download chat TEXT or Download chat JSON.

  9. To clear the chat press Clear chat.

  10. Streamlit Sidebar is in the left top corner and the Options are in the right top corner. In Options in case of problems press Rerun.



Note: You don't need OpenAI API key to extract and download transcripts. You can use it as needed.


 



DEMO1 - Challenge Kick-off









DEMO2 - Challenge Solutions












For those interested in learning more about my approach presented in DEMO2, I recommend checking out the blog post "SAP HANA Cloud Machine Learning Challenge “I quit!” – understanding metrics".

 


Does Artificial Intelligence work with my data?


By clicking on the "Try It!" button, you have the option to input a YouTube link. It is important to ensure that the video you select includes a transcript. This will allow you to test the app with your own data and questions.🙂





How does Artificial Intelligence work?


The entire code is on GitHub, including Jupyter Notebooks for a playground. The code is mainly explained in the previous blogs SAP Machine Learning Embedding in OpenAI and “Hello, world!” your crafted chat GPT bot!, and was reorganized to extract the transcript and create an interactive web application with Streamlit.

The main libraries are:
https://pypi.org/project/openai/
https://pypi.org/project/llama-index/
https://pypi.org/project/streamlit/

Conclusions


There are many apps built on top of OpenAI that are evolving rapidly and adding new capabilities. One of these apps powered by recent GPT-4 is MONICA  which is great at summarizing transcripts and increasing the efficiency and productivity of various tasks. Another app you can use is Glasp YouTube Summary,

On the other hand, having control over the code gives you more trust, and enables you to consider large-scale solutions for gathering and analyzing information.

Update December, 2023


Nowadays we have GPts, which allow one to create apps with embedded content and web access. However, YouTube transcript extraction is still not possible.

 

Enjoy! 🎈🎈🎈

 

Blog series


SAP HANA Cloud Machine Learning Challenge “I quit!” – Understanding metrics

Could machine learning build a model for prime numbers?

“Hello, world!” your crafted chat GPT bot!

SAP Machine Learning Embedding in OpenAI

Building Trust in AI: YouTube Transcript OpenAI Assistant

AI Challenge | Web scraping with Generative AI