Giter Club home page Giter Club logo

text-summary's Introduction

Check out the DEMO of summarize.world

Summarizing text

This module provides an API for making summary of text.

The solution is based on the [https://en.wikipedia.org/wiki/PageRank](PageRank Algorithm).

Example

We get a description from Wikipedia about umbrellas (https://en.wikipedia.org/wiki/Umbrella)

The regular resume of this text would be:

Umbrellas and parasols are primarily hand-held portable devices sized for personal use. The word "umbrella" typically refers to a device used for protection from rain. Umbrella canopies may be made of fabric or flexible plastic.

A resume based on asked question, for example "What is the price of umbrella?" is:

Umbrella canopies may be made of fabric or flexible plastic. Umbrellas are available in a range of price and quality points, ranging from inexpensive, modest quality models sold at discount stores to expensive, finely made, designer-labeled models. Another distinction can be made between manually operated umbrellas and spring-loaded automatic umbrellas which spring open at the press of a button.

The API allows the end user to select how many sentences to be displayed. In the exmaple above we selected 3.

##Installation

npm install text-summary

##Usage

var summarize = require ("text-summary");

var text ="Put some text here.";
var numberSentences = 2;
var question = "What is the price of an umbrella?";

var summary = summarize.summary(text, numberSentences);

var summaryWithQuestion = summarize.summaryWithQuestion(question, text, numberSentences);

console.log(summary);

License

MIT

text-summary's People

Contributors

lilia-simeonova avatar jeffdare 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.