Skip to main content

Phrase Tokenizer

pytestpythonCodacy BadgeCode style: blackdocstyle: googleLicense: MIT PyPI version

Tokenize an English sentence to phrases via benepar.

Installation

pip install phrase-tokenizer
# pip install phrase-tokenizer -U to update
# or to install the latest from github:
# pip git+https://github.com/ffreemt/phrase-tokenizer.git

Or clone the repo https://github.com/ffreemt/phrase-tokenizer.git:

git clone https://github.com/ffreemt/phrase-tokenizer.git
cd phrase-tokenizer
pip install logzero benepar tensorflow

Or use poetry, e.g.

git clone https://github.com/ffreemt/phrase-tokenizer.git
cd phrase-tokenizer
poetry install

Usage

from phrase_tokenizer import phrase_tok

res = phrase_tok("Short cuts make long delays.")
print(res)
# ['Short cuts', 'make long delays']

# verbose=True turns on verbose to see the tokenizing process
res = phrase_tok("Short cuts make long delays", verbose=True)
# ',..Short.cuts,.make..long.delays..'

Consult the source code for details.

For Developers

git clone https://github.com/ffreemt/phrase-tokenizer.git
cd phrase-tokenizer
pip install -r requirements-dev.txt

In ipython, plot_tree is able to draw a nice tree to aid the development, e.g.,

from phrase_tokenizer.phrase_tok import plot_tree

plot_tree("Short cuts make long delays.")

img

Metadata

Release files for phrase-tokenizer 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for phrase-tokenizer 0.1.3
File Size Uploaded
phrase-tokenizer-0.1.3.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for phrase-tokenizer 0.1.3
File Interpreter ABI Platform
phrase_tokenizer-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 9.6 kB

Release files / phrase-tokenizer-0.1.3.tar.gz

Download URL phrase-tokenizer-0.1.3.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3da2e6557661a9248d7782ef73eae55afec51ca3c7ac1bab16b7b73beb6ed048
BLAKE2b-256 checksum
How to use checksums
d36a19fe47fa5bd8811f6e940c0636acd0c8d8a2ded593f8528c28c35e94e143
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.8.5 Windows/10

Release files / phrase_tokenizer-0.1.3-py3-none-any.whl

Download URL phrase_tokenizer-0.1.3-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f5c0dc455d34c2d5beb35086d36f9f7d60bc2d34cc17807b7b74712ed18762b
BLAKE2b-256 checksum
How to use checksums
814bb470ff9c53414d052a24c6a2afb378b24720f42ad2d9bb04ae531847a90f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.8.5 Windows/10

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page