Skip to content

SwamiKannan/Langchain---Summarizing-NDTV-top-stories

Repository files navigation

Summarizing NDTV's latest stories using LangChain and OpenAI


The unofficial NDTV news summarizer

Description:

This repo seeks to scrape the latest news from the NDTV website (ndtv.com/latest) and provide summaries for the readers of the latest headlines in those areas. This repo covers:

  1. The main NDTV website
  2. Gadgets 360
  3. NDTV food
  4. Doctor NDTV

Requirements:

  1. You will need Python and pip installed to install the required libraries
  2. You will also need to register an OpenAI account and obtain an API key. If you don't have one, find how to here

Install:

  1. Download the repo
  2. Navigate into the main folder and run:
    pip install -r requirements.txt

Run code:

There are two ways to run the code:

A. Simple Way: Run

python main.py

B. Hands-on Way:

Scrape:

  1. Go to the src folder and run the following commands one after another:
  2. Run the news extraction script using the following code
    python "ndtv_class.py"
    ndtv_content = ndtv_test.run_extraction()
    hl, summ, art, urls = ndtv_content
    

Summarize:

  1. Summarize each article and all the articles by running the following code:
    python summarizer.py
    

Generate web page:

  1. Create the newspaper by running:
    python create_newspaper.py"
    

This should display a webpage that shows the following:

  1. A bulleted summary of all articles
  2. Summary of each article with the corresponding headline and url

This repo has no affiliation whatsoever with NDTV. It is not officially sanctioned, nor is there any collaboration / partnership whatsoever. This is only a personal project

About

Using Langchain to summarize the top stories on the NDTV website

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published