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:
- Character
- Word
- 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:
- Pure python implementation that is easy to modify anything to try new ideas. (other implementations require c++ expertise to modify the core)
- BPE model is a simple text that can be inspected with
less
orcut
. It includes info on which pieces were put together and what frequencies etc. - Reasonably faster than the other pure python implementations -- speed in python comes with the cost of extra memory due to indexing.
- 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
- locally at docs/intro.adoc
- HTML format: https://isi-nlp.github.io/nlcodec
Authors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nlcodec-0.2.3.tar.gz
.
File metadata
- Download URL: nlcodec-0.2.3.tar.gz
- Upload date:
- Size: 26.5 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 877bba810237b0939e3e560ed115cf60377f165dce1f7122d2716fe94d5026eb |
|
MD5 | d41d6a05b7f249ca97f1e72d4c60ed13 |
|
BLAKE2b-256 | 24aaa836068478017e834fefeee2c4db845f83918ab0bdd71fd454b956fd861b |
File details
Details for the file nlcodec-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: nlcodec-0.2.3-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | d61872c4c98e38c1bc6a26dd6b228c1629786fe97eb5fa06cf2ee7480c55bc9e |
|
MD5 | b4a5e9ff498d1f4ad1e251f9f99c2a11 |
|
BLAKE2b-256 | b42d0a9ceaf18946d9774257d7d287105a962fdf9fa3b2e444665a2d62e30ee0 |