• Stars
    star
    115
  • Rank 304,226 (Top 7 %)
  • Language
    CoffeeScript
  • License
    BSD 3-Clause "New...
  • Created about 10 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Automatically pull interesting quotes out of an article.

Pullquoter

Automatically pull interesting quotes out of an article.

Build Status

You've probably seen pull quotes like this in online articles:

Well, until now a human being had to spend several moments choosing which quotes to feature. This node module uses basic text summarization techniques to find interesting sentences to use as pull quotes automatically.

Why would I want this?

  • Spice up your website with cool pull quotes without any real work
  • Make a clone of Rotten Tomatoes that is totally automated but still has cool review snippets.
  • Maybe you are so busy that you only have time to read one sentence of any article?

Credits / Thanks

This node module uses an improved version of the algorithm presented in the article Build your own summary tool! by Shlomi Babluki. However, this module is improved in both capability and efficency.

Install

To install the command-line pullquoter utility:

npm install -g pullquoter

To install the pullquoter module for use in your Node.js project:

npm install --save pullquoter

Usage

You can use pullquoter from node or right on the command line!

Command line interface

You can pass text to pullquoter and it will pull out interesting sentences.

You can either pass in a file name:

pullquoter my_file.txt

Or you can pipe it in:

cat my_file.txt | pullquoter

By default, it returns one interesting sentence. If you want more, use the -n parameter:

pullquoter -n 10 my_file.txt

You can easily chain this together with other unix commands to do cool stuff. For example, you can download a web page, and then use unfluff to grab the page text and jq to pull out the body test. Then just pass it to pullquoter and get sentences!

curl -s "http://www.polygon.com/2014/6/26/5842180/shovel-knight-review-pc-3ds-wii-u" | unfluff | jq -r .text | pullquoter
It's not just the mechanics of old-school games that Shovel Knight nails, though; it also has that undefinable, metaphysical look and feel of an NES classic.

Module Interface

pullquoter(text, numberOfQuotesToPull)

text: The text you want to parse. This should be plain text in English.

numberOfQuotesToPull (default: 1): The number of sentences to pull out of the article

pullquoter = require('pullquoter');

quotes = pullquoter(myText);

Or pass in how mant quotes you want:

pullquoter = require('pullquoter');

quotes = pullquoter(myText, 10);

Limitations / Problems / TODO

  • This only works for English. The stopwords, stemmer and tokenized currently only support English. It could be expanded for other western languages pretty easily, though.
  • This module has a runtime of something like O(n^2/2) where n is the number of sentences in the text. So maybe don't run it on a huge piece of text.
  • If you are doing something serious, maybe look into a better text summarization algorithm.

More Repositories

1

face_recognition

The world's simplest facial recognition api for Python and the command line
Python
52,535
star
2

node-unfluff

Automatically extract body content (and other cool stuff) from an html document
HTML
2,151
star
3

amplify

A Jekyll html theme in the vague style of Medium.com built using Google AMP
CSS
1,872
star
4

show-facebook-computer-vision-tags

A very simple Chrome Extension that displays the automated image tags that Facebook has generated for your images
JavaScript
1,485
star
5

face_recognition_models

Trained models for the face_recognition python library
Makefile
346
star
6

image_to_numpy

Load an image file into a numpy array with Exif orientation support. Prevents upside-down and sideways images!
Python
180
star
7

all-podcasts-dataset

A free dataset of (almost) all publicly available podcasts.
127
star
8

medium_to_ghost

Instantly move all your Medium.com content (formatted posts + images) to an open source Ghost blog!
Python
121
star
9

image_segmentation_examples

Examples of Image Segmentation with Mask R-CNN from PyImageConf 2018
Python
44
star
10

age-gender-estimation

Keras implementation of a CNN network for estimating age and gender
Jupyter Notebook
25
star
11

spanish-to-english-translation

Example of building a working Spanish-to-English translation model with Marian NMT
Python
21
star
12

titanic_machine_learning_example

A simple example of how to solve Kaggle's "Titanic: Machine Learning from Disaster" challenge using Python and scikit-learn
Python
12
star
13

pypdf

A pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files
Python
4
star
14

pyflight

A Python Wrapper around Google's QPX Express API that supports both asynchronous and synchronous operation.
Python
3
star
15

london_bus_simple_led_sign

a simple london bus arrival sign script to use on a raspberry pi to show a kid how that works
Python
2
star