Skip to main content

NLP Toolbox

Project description

Reason

License PyPI Downloads Lines Activity

Python easy-to-use natural language processing toolbox.

Install

Install latest stable version using pip:

pip install reason

Quick-Start

Tokenization Tools:

>>> from reason.tokenize import word_tokenize

>>> text = "Testing reason0.1.0, (on: 127.0.0.1). Cool stuff..."
>>> word_tokenize(text, 'alphanumeric')
['Testing', 'reason0.1.0', 'on', '127.0.0.1', 'Cool', 'stuff']
>>> from reason.tokenize import sent_tokenize

>>> text = "Hey, what's up? I love using Reason library!"
>>> sents = sent_tokenize(text)
>>> for sent in sents:
...     print(sent)
Hey, what's up?
I love using Reason library!

Classification Tools:

>>> from reason.classify import NaiveBayesClassifier
>>> classifier = NaiveBayesClassifier(train_set)
>>> y_pred = classifier.classify(new_data)

>>> from reason.metrics import accuracy
>>> accuracy(y_true, y_pred)
0.9358

Dependencies

  • NumPy
    Used to handle data
  • Pandas
    Used in classify package

Keep in mind NumPy will be automatically installed with Reason.

License

MIT -- See LICENSE for details.

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

reason-0.2.1.tar.gz (222.0 kB view details)

Uploaded Source

Built Distribution

reason-0.2.1-py3-none-any.whl (232.6 kB view details)

Uploaded Python 3

File details

Details for the file reason-0.2.1.tar.gz.

File metadata

  • Download URL: reason-0.2.1.tar.gz
  • Upload date:
  • Size: 222.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.4

File hashes

Hashes for reason-0.2.1.tar.gz
Algorithm Hash digest
SHA256 aca1ac8fb2c172087ed60b71bf8e27c1dffa668ec829c2e707c14db5b4204448
MD5 382bb09ff3bbbee559fa5332c4e77959
BLAKE2b-256 d6bbfb282e4930ce87f232c8388a9c2237fc9ec84f842cd375ca1e4f77c61a4c

See more details on using hashes here.

File details

Details for the file reason-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: reason-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 232.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.4

File hashes

Hashes for reason-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d35d2d623d4b4aca838db63e8c99731c2c657773c7c40fdcc686a2f80812f35
MD5 751e376c71b384c1b5d53738d8c7c350
BLAKE2b-256 6016582118795307554adc9e79eb4a0baa920b22306888dc28b19f085f155ace

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