Giter VIP home page Giter VIP logo

summarize's Introduction

summarize

A python library for simple text summarization

Installation

First install nltk and numpy:

sudo pip install nltk
sudo pip install numpy

Then install the punkt and stopwords nltk packages:

sudo python -m nltk.downloader -d /usr/share/nltk_data punkt
sudo python -m nltk.downloader -d /usr/share/nltk_data stopwords

Then, run the tests:

python run-tests.py

If nothing is output, you're good to go!

Examples

See test/summarize.doctest for a few simple usage examples

summarize's People

Contributors

michaelwills avatar thavelick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

summarize's Issues

encoding error

hi, i am a new programmer, i have an error, could you help me please?

C:\Programlar\Python36\python.exe C:/Programlar/Denemeler/ozet/run-tests.py
Traceback (most recent call last):
File "C:/Programlar/Denemeler/ozet/run-tests.py", line 9, in
doctest.testfile(file)
File "C:\Programlar\Python36\lib\doctest.py", line 2054, in testfile
encoding or "utf-8")
File "C:\Programlar\Python36\lib\doctest.py", line 223, in _load_testfile
file_contents = file_contents.decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 16: invalid continuation byte

Failed example

I am new to python, but I am working with AI where I work and I am studying programs like yours to improve some processes we have here and understand better. I came with this issue first time I ran run-test.py I've tried python2.7 and python3.7
log-run-test.txt

log-run-test_3.7.txt

Error in ss.sumarize(input,1) from test/summarize.doctest

import summarize

ss = summarize.SimpleSummarizer()
input = "NLTK is a python library for working human-written text. Summarize is a package 				 
that uses NLTK to create summaries."
ss.summarize(input, 1)

ss.summarize results in this error:

Traceback (most recent call last):
File "SumTest.py", line 5, in
ss.summarize(input, 1)
File "summarize.py", line 75, in summarize
return " ".join(self.get_summarized(input, num_sentences))
File "summarize.py", line 47, in get_summarized
word_frequencies.items()[:100]]
TypeError: 'dict_items' object is not subscriptable

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.