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.13.tar.gz (28.8 MB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: truecase-0.0.13.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.13.tar.gz
Algorithm Hash digest
SHA256 bafc737947338f1b46fb115caa434db18f484cccf7b56819690ef63759f93f93
MD5 fb719f3b7747fda9720578aa5606482f
BLAKE2b-256 eec6c545fb086ad9c916b9e6a8d0e58c7cf35af89d343d1596ebc457a4afc14e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: truecase-0.0.13-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.13-py3-none-any.whl
Algorithm Hash digest
SHA256 ccb9ea732813b8cf53ddcb9f4e29cdd429c747e0189463cd5bf25ea816b8f4ff
MD5 ccf2fbcf0c10b0d7ad7a3c956661f80c
BLAKE2b-256 252721e76c94df8d0fdc436ca83c9df7b229110aa2cb1148f429d84f5ee2b78f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page