Giter VIP home page Giter VIP logo

summarybot's Introduction

SummaryBot

NPM Package

https://www.npmjs.com/package/summarybot

Description

A simple javascript script that will dissect text and pull the most relevant sentences. It uses techniques described in TextRank: Bringing Order into Texts: https://web.eecs.umich.edu/~mihalcea/papers/mihalcea.emnlp04.pdf

Use

CLI

npm install -S summarybot

Javascript

const SummaryBot = require('summarybot');
const summarizer = new SummaryBot()
const summary = summaryBot.run(text, numLinesOutput, summaryStatistics)
  1. Install through NPM
  2. Require summaryBot in your program -> this will return a constructor
  3. Create an instance of summaryBot using the constructor
  4. Call .run(text, numLinesOutput) on the instance which will return the output
  5. Call .getTopSentences(numLinesOutput) on the instance if you wish to get the output with a different number of lines

Example

//text is equal to the body of https://www.washingtonpost.com/politics/trump-is-struggling-to-stay-calm-on-russia-one-morning-call-at-a-time/2017/06/22/1da3385a-5762-11e7-b38e-35fd8e0c288f_story.html
const SummaryBot = require('summarybot')
const summarizer = new SummaryBot()
console.log(summaryBot.run(text, 5, false)

President Trump listens during a demonstration at the American Leadership in Emerging Technology event in the East Room of the White House on June 22, 2017. Interviews with 22 senior administration officials, outside advisers, and Trump confidants and allies reveal a White House still trying, after five months of halting progress, to establish a steady rhythm of governance while also indulging and managing Trump’s combative and sometimes self-destructive impulses. That’s what people want to see.”[Inside Trump’s climate decision: After fiery debate, he ‘stayed where he’s always been’] Senior officials have also been devising an overhaul of the WhiteHouse communications operation to better meet the offensive and defensive demands of the president they serve, as well as the 24-hour cycle of tweet-size news. The pace is breakneck, the trajectory upward.” White HouseChief of Staff Reince Priebus walks out of the White House on June 1, 2017, to await President Trump’s remarks in the Rose Garden about the U.S. Some of Priebus’s most senior colleagues speak ill of his leadership abilities, with one tagging him “the most imperiled person here,” although others insist Priebus is in solid standing with the president.Some in the White House fret over what they view as the president’s fits of rage, and Trump’s longtime friends say his mood has been more sour than at any point since they have known him.

Inputs

text:

A single string that consists of only entire sentences. Paragraph integration will be coming later

numLinesOutput:

A digit representing the number of sentences you wish summaryBot to output

summaryStatistics:

A boolean of whether or not to append statistics to the end of the result

summarybot's People

Contributors

camdenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

summarybot'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.