Skip to main content

nlcodec is a collection of encoding schemes for natural language sequences

Project description

NLCodec

NOTE: The docs are available at https://isi-nlp.github.io/nlcodec

A set of (low level) Natural Language Encoder-Decoders (codecs), that are useful in preprocessing stage of NLP pipeline. These codecs include encoding of sequences into one of the following:

  1. Character
  2. Word
  3. BPE based subword

It provides python (so embed into your app) and CLI APIs (use it as stand alone tool).

There are many BPE implementations available already, but this one provides differs:

  1. Pure python implementation that is easy to modify anything to try new ideas. (other implementations require c++ expertise to modify the core)
  2. BPE model is a simple text that can be inspected with less or cut. It includes info on which pieces were put together and what frequencies etc.
  3. Reasonably faster than the other pure python implementations -- speed in python comes with the cost of extra memory due to indexing.
  4. PySpark backend for extracting term frequencies from large datasets

Installation

Please run only one of these

# Clone repo for development mode (preferred  mode)
git clone https://github.com/isi-nlp/nlcodec
cd nlcodec
pip install --editable . 

# Install from github, directly
$ pip install git+https://github.com/isi-nlp/nlcodec.git


# Install from pypi
$ pip install nlcodec

pip installer registers a cli tool named nlcodec in PATH which serves is the command line interface. You can always trigger either via python -m nlcodec or python path/to/nlcodec/__main__.py if you wish!

Docs are available at

Authors

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

nlcodec-0.2.4.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

nlcodec-0.2.4-py3-none-any.whl (37.1 kB view details)

Uploaded Python 3

File details

Details for the file nlcodec-0.2.4.tar.gz.

File metadata

  • Download URL: nlcodec-0.2.4.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for nlcodec-0.2.4.tar.gz
Algorithm Hash digest
SHA256 f79f14f5a9ffc28500a60bf7f2d2dc35fced36ba5c5e85f81d1dbb4a0da06ac8
MD5 713d7f4debe91692770e7a5b5a0e7a65
BLAKE2b-256 cd453c2e195e3b93718f56ea2e87dc88287211ac58cba5b18de20576fc951e47

See more details on using hashes here.

File details

Details for the file nlcodec-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: nlcodec-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 37.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for nlcodec-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d9041f1e373deecce865d0ce1f3518c7737241152a0e5194560a036894ea3700
MD5 66973de978836f6cd6ec19b9ae94d8b7
BLAKE2b-256 5c59ff6d3c655a4810493a8aab6d9a9ae81871d6fb77b55aa47664177f21415d

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