Skip to content

Instantly share code, notes, and snippets.

View jackschultz's full-sized avatar

Jack Schultz jackschultz

View GitHub Profile
@jackschultz
jackschultz / article-summarizer.py
Created August 30, 2013 23:21
Article summarizer written in python.
import nltk
from nltk.stem.wordnet import WordNetLemmatizer
import string
class SentenceRank(object):
def __init__(self, body, title):
self.body = body
self.sentence_list = nltk.tokenize.sent_tokenize(self.body)[:]
self.title = title
@jackschultz
jackschultz / article-summarizer.clj
Created August 30, 2013 22:45
Clojure implementation of a semi-naive article summarizer. Takes the url supplied and attempts to find the num-sentences most "valuable" sentences ranked by most words in common with other sentences. To run, throw into Leiningen and download the opennlp binaries.
(ns classify.core
(:use [boilerpipe-clj.core]
[opennlp.nlp]
[opennlp.treebank]
[clojure.pprint :only [pprint]]
[opennlp.tools.filters]
[clojure.set]
[stemmer.snowball])
(:gen-class))