Manjari-99 / Youtube-GPT

Uses openai api to recommend the perfect youtube video title and script based on prompt input. Also focuses on Wikipedia Research.
3 stars 1 forks source link
gpt3 langchain-python openai-api streamlit

Youtube-Title and Script Generator

About

Generative Pre-trained Transformers, commonly known as GPT, are a family of neural network models that uses the transformer architecture and is a key advancement in artificial intelligence (AI) powering generative AI applications such as ChatGPT. GPT models give applications the ability to create human-like text and content (images, music, and more), and answer questions in a conversational manner. Organizations across industries are using GPT models and generative AI for Q&A bots, text summarization, content generation, and search.

Companies like Khan Academy, Duolingo are making their own GPT. Bloomberg has fine-tuned its own GPT model.

So the Question Lies...Why don't we all do it?

Using Langchain Framework - prompts, chains and memory here - and streamlit; I have built an application that Generates the YouTube Title and corresponding video script as per what our user feeds in the prompt.

OpenAI - API

We need to create our own API Key in our OpenAI account and set that value to the variable 'apikey' in apikey.py. This is later imported to our app.py

Methodology

Inside app.py

We set the api key in the os environment dictionary to connect to OpenAI. We use streamlit as our application framework. We then add streamlit title, text_input. We then create an instance of our service with LLMs. We use prompt templates and LLMChains. Prompt takes our topic and plugs in with the query, i.e. formatted. LLM has the temperature set that shows the creative independence of the output. We use LLM Chain to run user prompt. We also use a script chain, and connect it with sequential script chain. We also bring in memory to our application through ConversationBufferMemory. We also add some tools like WikipediaAPIWrapper. So, our prompt template not only takes a title, but also takes in some Wikipedia Research. And... our application is good to go!

Demo Snapshots

The application

The prompt input

The Title and Script output

Memory Buffers

Title and Script History

Wikipedia Research

Conclusion

This project has been made with the fundamental motive of getting familiarised with the concepts of GPT, LLMs, Langchain, etc.