Skip to main content

NLP helpers to parse noun or verb phrases in a sentence using spacy parse tree.

Project description

#Use Example usage for np_picker:

from phrase_pickers.np_picker import \*

nlp = spacy.load("en_core_web_sm")

print(get_np_indices(nlp('We produce oil and natural gas.')))
print(get_np_indices(nlp('I like green and red cars.')))
print(get_np_indices(nlp('I like Starbucks coffee.')))```

Example usage for vp_picker:
```import spacy
from phrase_pickers.vp_picker import \*

nlp = spacy.load("en_core_web_sm")

print(get_vp_indices(nlp("We will be offering general clothes after we get approval.")))
print(get_vp_indices(nlp("We make transportation and fracturing pipelines.")))
print(get_vp_indices(nlp("We provide repair services.")))
print(get_vp_indices(nlp("We are a car manufacturer.")))
print(get_vp_indices(nlp("We have not experienced any significant shortages of raw materials, components or finished parts and normally do not carry inventories of raw materials or finished parts in excess of those reasonably required to meet our production and shipping schedules.")))```

#Packaging Packaging for this module is tricky, because it requires a spacy model (e.g. en_core_web_sm) to work properly. To create a new release & push package to PyPI:

  1. Change the version number in setup() in setup.py
  2. Delete any old .whl or .tar.gz files in dist folder
  3. In your dev environment, run python setup.py clean --all sdist bdist_wheel
  4. Test upload to TestPyPI: python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
  5. In a clean, new environment, verify that package downloaded from TestPyPI is working: pip install --extra-index-url https://testpypi.python.org/pypi pn-phrase-pickers
  6. Upload to PyPI with twine.

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

phrase_pickers-0.2.6.tar.gz (155.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phrase_pickers-0.2.6-py3-none-any.whl (154.5 kB view details)

Uploaded Python 3

File details

Details for the file phrase_pickers-0.2.6.tar.gz.

File metadata

  • Download URL: phrase_pickers-0.2.6.tar.gz
  • Upload date:
  • Size: 155.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.36.1 CPython/3.6.4

File hashes

Hashes for phrase_pickers-0.2.6.tar.gz
Algorithm Hash digest
SHA256 4005c7bc2194d89cd5a4db39dec158d06d5747c552fd4607a9192df39e3e72a6
MD5 9cef616ad9a7f2f54ee70bf54e20db7a
BLAKE2b-256 f4ab2742980d1f88b5801088ff806f0df139cd16a2f57c1d3d7b422068fe79c4

See more details on using hashes here.

File details

Details for the file phrase_pickers-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: phrase_pickers-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 154.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.36.1 CPython/3.6.4

File hashes

Hashes for phrase_pickers-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 17f5fe0e8a0bb98c68bf6c356aacb19ef07b06f92e8428da55a40d70526654be
MD5 65b5b69a5085c9851df03e234d4a5c31
BLAKE2b-256 c9c0db8f5b74998a84fb0e2e7a8cf7e0962eb7039c35fcb10deb1de88fc7024c

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