Skip to main content

A library to restore capitalization for text

Project description

TrueCase

Main Publish PyPI

A language independent, statistical, language modeling based tool in Python that restores case information for text.

The model was inspired by the paper of Lucian Vlad Lita et al., tRuEcasIng but with some simplifications.

A model trained on NLTK English corpus comes with the package by default, and for other languages, a script is provided to create the model. This model is not perfect, train the system on a large and recent dataset to achieve the best results (e.g. on a recent dump of Wikipedia).

Prerequisites

  • Python 3

The project uses NLTK. Find install instructions here.

Installing

pip3 install truecase

Usage

Simple usecase:

>>> import truecase
>>> truecase.get_true_case('hey, what is the weather in new york?')
'Hey, what is the weather in New York?''

Training your own model

TODO. For now refer to Trainer.py

Contributing

I see a lot of space for improvement. Feel free to fork and improve. Do sent a pull request.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

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

truecase-0.0.14.tar.gz (28.8 MB view details)

Uploaded Source

Built Distribution

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

truecase-0.0.14-py3-none-any.whl (28.4 MB view details)

Uploaded Python 3

File details

Details for the file truecase-0.0.14.tar.gz.

File metadata

  • Download URL: truecase-0.0.14.tar.gz
  • Upload date:
  • Size: 28.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6

File hashes

Hashes for truecase-0.0.14.tar.gz
Algorithm Hash digest
SHA256 3a47b58c1724fcca7268cbeaf4056bb2c0cd041bd81f3b99a85ea263d7fc2d20
MD5 ac240d326f37833a7276faff5e8e5b36
BLAKE2b-256 850689d0adae754d32626dcd0dcd958a1b0be295a9e084a6ecda25af6ebbcdb2

See more details on using hashes here.

File details

Details for the file truecase-0.0.14-py3-none-any.whl.

File metadata

  • Download URL: truecase-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 28.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6

File hashes

Hashes for truecase-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 80e93b9d45a430d4bce4d9fe19fe0c185976ecf244779cf92e0901531ce86ced
MD5 c8cd5a9cb29c0859ba9af11c0d07c093
BLAKE2b-256 6aecca9dc9ab492aebc57af351709355d74d90e2b71c2b75befd2a1bf2c5db78

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