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.9.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.9-py3-none-any.whl (28.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: truecase-0.0.9.tar.gz
  • Upload date:
  • Size: 28.8 MB
  • 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 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for truecase-0.0.9.tar.gz
Algorithm Hash digest
SHA256 0aeb12269c1178716e539085ea43e6693a701c5cb5d5a0b1d72899f0dd9e0f4a
MD5 a3a7154a97b21aa8407807db3785c3a9
BLAKE2b-256 0914fe4d424b7e29c7717d4e999e187ea749acb49c4384cd612da7f0dc62a6c9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: truecase-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 28.4 MB
  • 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 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for truecase-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 8e3ff22592b6e390b6f01397b6c62ebc0184d6ca569946a863be9e65bab7d3fc
MD5 acec67f627be7c18e6d3c50e05d6486d
BLAKE2b-256 fdfffdbd419a6b5b3300cd3500f903a57a0ff8a2b66ed4faab6861f9d48a71fe

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