Giter Site home page Giter Site logo

tuhin-snapd / news-extractor-summarizer Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 3.0 5.91 MB

The Python-based web app extracts and summarizes news using NewsAPI, newspaper3k, spacy, Pegasus and T5 from Hugging Face. It categorizes news articles and uses a graph-based summary feature to summarize multiple documents. The app works with news in any language supported by NewsAPI.

Python 79.31% HTML 3.13% JavaScript 9.67% CSS 7.89%
graph-algorithms graph-based pegasus summarisation topic-modeling mrm8488 news-extractor news-summarization nlp-project

news-extractor-summarizer's Introduction

News Extractor and Summarizer

News Extractor and Summarizer is a Python-based web application that extracts and summarizes news articles. The application uses several Python libraries including NewsAPI, newspaper3k, spacy, requests, Pegasus from Hugging Face, and a T5 model from Hugging Face's model hub mrm8488 to classify news articles into different categories (e.g. business, health, science, entertainment). It also includes a graph-based summary feature that uses similarity to summarize multiple documents from topic clusters of CSV. The app is designed to work with news articles in any language supported by NewsAPI.

Installation

To use this application, you will need to follow the installation steps below:

Clone the repository to your local machine by running

git clone https://github.com/Tuhin-SnapD/News-Extractor-Summarizer.git
cd News-Extractor-Summarizer
pip install -r requirements.txt 

Or

conda create --name env_name --file requirements.txt

Setup

To use this project, there are two cache directories with the following structure in the 'News-Extractor-Summarizer' folder:

cache_dir/
├── transformers/
│   ├── google/
│   │   └── xsum/
│   └── mrm8488/
│       └── t5-base-finetuned-news-title-classification/

These directories will be used by the Hugging Face Transformers library to cache the pre-trained models and tokenizers.

To complete the setup, please follow these steps:

  - Go to https://huggingface.co/google/pegasus-xsum and download the file 'pytorch_model.bin'.
  - Move the downloaded file 'pytorch_model.bin' into the 'xsum' directory.
  - Next, go to https://huggingface.co/mrm8488/t5-base-finetuned-news-titles-classification and download the file 'pytorch_model.bin'.
  - Move the downloaded file 'pytorch_model.bin' into the 't5-base-finetuned-news-title-classification' directory.

Rename the file env.template to .env as well as app/config.template.js to app/config.js and replace the placeholder values with your own NewsAPI Key and Google API Key and Search Engine ID

Usage

Now run the following command

python -u main.py 

This will run a series of different python scripts available in the directory in order to create various datatsets in a newly made dataset directory.

After datasets have been created run the app/index.html, to view the results in the browser and to google search the final outputs and read more about it.

Algorithm

Algo

Contributing

Contributions to this repository are welcome! If you have an idea for a new summarization model or an improvement to an existing one, feel free to create a pull request.

Acknowledgements

This repository was created by Tuhin and Anant as part of Academic Capstone Project. We would like to thank Prof. Durgesh Kumar and Multiple learned faculties of Vellore Institute of technology.

news-extractor-summarizer's People

Contributors

anant-tiwarii avatar tuhin-snapd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

news-extractor-summarizer's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.