GithubHelp home page GithubHelp logo

mparje / summarize. Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fastforwardlabs/summarize.

0.0 0.0 0.0 87.07 MB

Summarize. is a Streamlit application that performs automatic text summarization using both extractive and abstractive models.

License: Apache License 2.0

Python 100.00%

summarize.'s Introduction

Summarize.

The primary output of this repository is the Summarize. application, a prototype user interface for automatic text summarization. It includes the ability to apply both abstractive and extractive summarization models on various types of documents, from excerpts of Wikipedia to news articles. Users can also input their own text to summarize.

Summarize. interface

Instructions are given both for general use (on a laptop, say), and for Cloudera CML and CDSW. We'll first describe what's here, then go through how to run everything.

Structure

.
├── apps        # Small Streamlit application.
├── cml         # This folder contains scripts that facilitate the project launch on CML.
├── data        # This folder contains starter data.
├── models      # This folder contains a serialized neural extractive summarization model.
└── summa       # A small library of useful functions.

There are also images and tests directories that can be ignored. Let's examine each of the important folders in turn.

apps

The application accompanying this project comes with a launcher script to assist launching an Application with CDSW/CML. To launch the application in another environment, see instructions below. This directory also includes st_model_wrapper.py, a file that provides functionality expressly to streamline the usage of four different summarization models in the Summarize. application.

cml

This script facilitates the automated project setup on CML and is triggered by the declarative pipeline as defined in the .project-metadata.yaml file found in the project's root directory.

summa

summa
├── models
│   ├── classic_extractive.py
│   ├── neural_abstractive.py
│   └── neural_extractive.py
├── highlighting.py
└── utils.py

This small library includes functionality to support the Summarize. application. The bulk of the library is in the models subdirectory, wherein we support four types of summarization models. The details on these models can be found in this related blog post. The classic_extractive.py file supports both the classic TextRank method, as well as a hybrid Transformers+TextRank model.

Installation

The code and applications within were developed against Python 3.8.0., and are likely also to function with more recent versions of Python.

To install dependencies, first create and activate a new virtual environment through your preferred means, then pip install from the requirements file. We recommend:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m spacy download en_core_web_sm

In CML or CDSW, no virtual env is necessary. Instead, inside a Python 3 session (with at least 2 vCPU / 4 GiB Memory), simply run

!pip3 install -r requirements.txt     # notice `pip3`, not `pip`

Launch Summarize.

After installation, the Summarize. application can be launched locally by running

streamlit run apps/summarize-app.py 

The application can also be launched programatically as an Application in Cloudera CDSW/CML via the launch script mentioned above.

Deploying on CML

There are three ways to launch this project on CML:

  • From Prototype Catalog - Navigate to the Prototype Catalog on a CML workspace, select the "Summarize." tile, click "Launch as Project", click "Configure Project"
  • As ML Prototype - In a CML workspace, click "New Project", add a Project Name, select "AMPs" as the Initial Setup option, copy in the repo URL, click "Create Project", click "Configure Project"
  • Manual Setup - In a CML workspace, click "New Project", add a Project Name, select "Git" as the Initial Setup option, copy in the repo URL, click "Create Project". Then, follow the installation instructions above.

summarize.'s People

Contributors

melaniebeck avatar victordibia avatar gaffney2010 avatar

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.