This project demonstrates how to summarize the content of any webpage using OpenAI's GPT-4 model. The summarizer extracts the text from a webpage, removes irrelevant elements (like scripts and styles), and generates a concise summary using GPT-4.
- Web Scraping: Uses
BeautifulSoupto extract and clean webpage content. - OpenAI Integration: Connects to OpenAI's GPT-4 model for summarization.
- Markdown Output: Displays summaries in a clean, markdown format.
- Webpage Extraction: The
Websiteclass fetches and parses the webpage content, removing unnecessary elements like scripts, styles, and images. - Summarization: The
summarizefunction sends the cleaned content to OpenAI's GPT-4 model, which generates a concise summary. - Markdown Display: The
display_summaryfunction renders the summary in markdown format for easy readability.