-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
32e7c81
commit cb87ba5
Showing
8 changed files
with
91 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
============================================== | ||
summa - textrank | ||
============================================== | ||
|
||
TextRank_ implementation for text summarization and keyword extraction in Python | ||
|
||
.. _TextRank: http://web.eecs.umich.edu/~mihalcea/papers/mihalcea.emnlp04.pdf | ||
|
||
Features | ||
--------- | ||
|
||
* Text summarization | ||
* Keyword extraction | ||
* Text modeling with graph and gexf exportation | ||
|
||
Examples | ||
-------- | ||
|
||
Text summarization:: | ||
|
||
>>> text = "Automatic summarization is the process of reducing a text document with a | ||
computer program in order to create a summary that retains the most important points | ||
of the original document. As the problem of information overload has grown, and as | ||
the quantity of data has increased, so has interest in automatic summarization. | ||
Technologies that can make a coherent summary take into account variables such as | ||
length, writing style and syntax. An example of the use of summarization technology | ||
is search engines such as Google. Document summarization is another." | ||
|
||
>>> from summa import summarizer | ||
>>> print summarizer.summarize(text) | ||
'Automatic summarization is the process of reducing a text document with a computer | ||
program in order to create a summary that retains the most important points of the | ||
original document.' | ||
|
||
|
||
Keyword extraction:: | ||
|
||
>>> from summa import keywords | ||
>>> print keywords.keywords(text) | ||
document | ||
automatic summarization | ||
technologies | ||
technology | ||
|
||
|
||
Installation | ||
-------------- | ||
|
||
This software depends on `NumPy and Scipy <http://www.scipy.org/Download>`_, two Python packages for scientific computing. | ||
You must have them installed prior to installing `summa`:: | ||
|
||
pip install summa | ||
|
||
|
||
If you are going to use the export function, you also need `NetworkX <https://networkx.github.io/download.html>`_. | ||
For a better performance of keyword extraction, install `Pattern <http://www.clips.ua.ac.be/pattern>`_ | ||
|
||
This version has been tested under Python 2.7 | ||
|
||
|
||
More examples | ||
------------- | ||
|
||
Command-line usage:: | ||
|
||
cd path/to/folder/summa/ | ||
python textrank.py -t FILE | ||
|
||
|
||
Export:: | ||
|
||
>>> from summa import export | ||
>>> export.gexf_export(text, path="graph.gexf") | ||
|
||
|
||
------------- | ||
|
||
Summa is open source software released under the `The MIT License (MIT) <http://opensource.org/licenses/MIT>`_. | ||
Copyright (c) 2014 - now Summa NLP |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[metadata] | ||
description-file = README.md | ||
description-file = README |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,14 @@ | |
name = 'summa', | ||
packages = ['summa', 'summa.preprocessing'], | ||
package_data = { | ||
'summa': ['views/*', 'views/img/*', 'views/js/*', 'views/styles/*'] | ||
'summa': ['README', 'LICENSE'] | ||
}, | ||
version = '0.0.1', | ||
version = '0.0.4', | ||
description = 'A text summarization and keyword extraction package', | ||
author = 'Federico Barrios, Federico Lopez', | ||
author_email = '[email protected]', | ||
url = 'https:/summanlp/textrank', | ||
download_url = 'https:/summanlp/textrank/tarball/v0.0.2', | ||
download_url = 'https:/summanlp/textrank/tarball/v0.0.3', | ||
keywords = ['summa', 'nlp', 'summarization', "NLP", "natural language processing", "automatic summarization", | ||
"keywords", "summary", "textrank", "pagerank"], | ||
classifiers = [ | ||
|
@@ -34,5 +34,5 @@ | |
# that you indicate whether you support Python 2, Python 3 or both. | ||
'Programming Language :: Python :: 2.7' | ||
], | ||
long_description = open('README.rst').read() | ||
long_description = open('README').read() | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/usr/bin/env python -W ignore::DeprecationWarning | ||
|
||
import sys, getopt | ||
from summarizer import summarize | ||
|