Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

truecase

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

truecase

A library to restore capitalization for text

  • 0.0.14
  • PyPI
  • Socket score

Maintainers
1

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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc