A newer version of the Streamlit SDK is available:
1.55.0
license: mit
title: LangChain-VideoWeb-Summarizer
sdk: streamlit
emoji: 👀
colorFrom: yellow
colorTo: blue
sdk_version: 1.45.1
AI Content Summarizer
This Streamlit application leverages AI to summarize web articles and YouTube videos. Users can input a URL, and the app will provide a concise summary of the content.
It summarizes YouTube videos or any website content using LangChain, Google's Gemini API, and LangChain's document loaders.
It uses LangChain and ChatGoogleGenerativeAI with gemini-1.5-flash model.
Features
- Web Article Summarization: Enter the URL of any online article to get a summary.
- YouTube Video Summarization: Provide a YouTube video URL to receive a transcript summary.
- Secure API Key Handling: Uses Streamlit's sidebar for API key input, ensuring it's not exposed in the main interface.
- User-Friendly Interface: Simple and intuitive design for ease of use.
Technologies Used
- Streamlit: For creating the web application interface.
- Langchain: To handle the summarization chain and document processing.
- Langchain: To handle the summarization chain and document processing.
- LangChain Google GenAI – for LLM integration.
- Validators: To ensure the validity of input URLs.
- youtube_transcript_api: For fetching transcripts from YouTube videos.
- pytube: To extract video information from YouTube.
- Unstructured: For parsing and extracting content from HTML (web articles).
Setup and Installation
Clone the repository:
git clone https://github.com/your-username/ai-content-summarizer.git cd ai-content-summarizerCreate a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`Install the required dependencies:
pip install -r requirements.txtSet your Google API Key:
- Obtain an API key from Google AI Studio.
- You can set it as an environment variable:
export GOOGLE_API_KEY='your_google_api_key_here' - Alternatively, you can enter it directly in the application's sidebar when prompted.
How to Run
- Ensure your virtual environment is activated and dependencies are installed.
- Run the Streamlit application:
streamlit run app.py - Open your web browser and navigate to the local URL provided by Streamlit (usually
http://localhost:8501). - Enter your Google API Key in the sidebar.
- Paste the URL of a web article or YouTube video into the input field and click "Summarize".
Example Usage
- Find an interesting article online or a YouTube video.
- Copy its URL.
- Paste the URL into the app's input field.
- Click "Summarize" and wait for the AI to generate the summary.
Contributing
Contributions are welcome! If you have suggestions for improvements or new features, please feel free to:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/your-feature-name). - Open a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details (if you add one).
Notes
- You must have a valid Google API Key to use this app.
- The quality of the summary depends on the clarity and structure of the source content.