TrueCase
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
- Dalton Fury - Initial work - daltonfury42
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Acknowledgments
- Lucian Vlad Lita et al., tRuEcasIng
- Borrowed a lot of code, and the idea from truecaser by nreimers
Metadata
Release files for truecase 0.0.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| truecase-0.0.14.tar.gz | 28.8 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| truecase-0.0.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 57.2 MB
Release files / truecase-0.0.14.tar.gz
| Download URL | truecase-0.0.14.tar.gz |
|---|---|
| Size | 28.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a47b58c1724fcca7268cbeaf4056bb2c0cd041bd81f3b99a85ea263d7fc2d20
|
|
BLAKE2b-256 checksum How to use checksums |
850689d0adae754d32626dcd0dcd958a1b0be295a9e084a6ecda25af6ebbcdb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / truecase-0.0.14-py3-none-any.whl
| Download URL | truecase-0.0.14-py3-none-any.whl |
|---|---|
| Size | 28.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80e93b9d45a430d4bce4d9fe19fe0c185976ecf244779cf92e0901531ce86ced
|
|
BLAKE2b-256 checksum How to use checksums |
6aecca9dc9ab492aebc57af351709355d74d90e2b71c2b75befd2a1bf2c5db78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for truecase 0.0.14
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.