Skip to main content

A shallow phrase extractor

Project description

phrase extractor

A shallow phrase extractor based on nltk

Installation

pip3 install phraseextractor

Example

from extractor import phrases_extractor

text = ('GOP Sen. Rand Paul was assaulted in his home in Bowling Green, Kentucky, on Friday, '
        'according to Kentucky State Police. State troopers responded to a call to the senator\'s '
        'residence at 3:21 p.m. Friday. Police arrested a man named Rene Albert Boucher, who they '
        'allege "intentionally assaulted" Paul, causing him "minor injury". Boucher, 59, of Bowling '
        'Green was charged with one count of fourth-degree assault. As of Saturday afternoon, he '
        'was being held in the Warren County Regional Jail on a $5,000 bond.')

grammar = r"""
        NP:   {<NNP>?<NNP>?}
    """

label = 'NP'

terms = phrases_extractor.get_phrases(text,grammar,label)

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

phraseextractor-0.5.tar.gz (2.1 kB view details)

Uploaded Source

File details

Details for the file phraseextractor-0.5.tar.gz.

File metadata

  • Download URL: phraseextractor-0.5.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.5

File hashes

Hashes for phraseextractor-0.5.tar.gz
Algorithm Hash digest
SHA256 bc89e95f8beafe8b1dd9ea22f9be49f4f413ad618057ceb32b69b6b83578efd3
MD5 d2a38e1831308472dcb189c7e17fb98d
BLAKE2b-256 e6a00afd2a155a120cc42488e48cb34c35e242ffea4988be6933b31bf1cecccb

See more details on using hashes here.

Supported by

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