npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

summarybot

v0.0.7

Published

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

Downloads

51

Readme

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