Skip to main content

textcrafts: Summary, keyphrase and relation extraction with dependecy graphs

Project description

TextGraphCrafts

Python-based summary, keyphrase and relation extractor from text documents using dependency graphs.

HOME: https://github.com/ptarau/TextGraphCrafts

Project Description

** The system uses dependency links for building Text Graphs, that with help of a centrality algorithm like PageRank, extract relevant keyphrases, summaries and relations from text documents. Developed with Python 3, on OS X, but portable to Linux.**

Dependencies:

  • python 3.7 or newer, pip3, java 9.x or newer. Also, having git installed is recommended for easy updates
  • pip3 install nltk
  • also, run in python3 something like
import nltk
nltk.download('wordnet')
nltk.download('words')
nltk.download('stopwords')
  • or, if that fails on a Mac, use run python3 down.py to collect the desired nltk resource files.
  • pip3 install networkx
  • pip3 install requests
  • pip3 install graphviz, also ensure .gv files can be viewed
  • pip3 install stanfordnlp parser
  • Note that stanfordnlp requires torch binaries which are easier to instal with ````anaconda```.

Tested with the above on a Mac, with macOS Mojave and Catalina and on Ubuntu Linux 18.x.

Running it:

in a shell window, run

start_server.sh

in another shell window, start with

python3 -i tests.py

and then interactively, at the ">>>" prompt, try

>>> test1()
>>> test2()
>>> ...
>>> test9()
>>> test12()
>>> test0()

see how to activate other outputs in file

deepRank.py

text file inputs (including the US Constitution const.txt) are in the folder

examples/

Handling PDF documents

The easiest way to do this is to install pdftotext, which is part of Poppler tools.

If pdftotext is installed, you can place a file like textrank.pdf already in subdirectory pdfs/ and try something similar to:

Change setting in file params.py to use the system with other global parameter settings.

Alternative NLP toolkit

Optionally, you can activate the alternative Stanford CoreNLP toolkit as follows:

  • install Stanford CoreNLP and unzip in a derictory of your choice (ag., the local directory)
  • edit if needed start_parser.sh with the location of the parser directory
  • override the params class and set corenlp=True

Note however that the Stanford CoreNLP is GPL-licensed, which can place restrictions on proprietary software activating this option.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

textcrafts-0.1.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

textcrafts-0.1.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file textcrafts-0.1.0.tar.gz.

File metadata

  • Download URL: textcrafts-0.1.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

File hashes

Hashes for textcrafts-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fc269046427b06a7188cda7799f95e716f8693cc39c123c4f188960eeae3820e
MD5 7d7daaafa7273dd5317038d512a70ab7
BLAKE2b-256 8cd7bab3f8c6d76e525f66bc6badcdbe4833226566fdc87378ca7483d99e71e1

See more details on using hashes here.

File details

Details for the file textcrafts-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: textcrafts-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

File hashes

Hashes for textcrafts-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1253d22e1282aae59fbbb5253b4759fc7f535c981a7a70a2345b91c3fd44a511
MD5 103c883c09620b57431c7e430458b613
BLAKE2b-256 4e256ade47a3a9fe32cce0c2bd8b63b86484ede815fd298028be0fa5f0e42e40

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page