daltonfury42 / truecase Goto Github PK
View Code? Open in Web Editor NEWA python true casing utility that restores case information for texts
License: Apache License 2.0
A python true casing utility that restores case information for texts
License: Apache License 2.0
Informal spoken American English words like WANNA and GONNA are converted to wanNa and gonNa.
>>> import truecase
>>> truecase.get_true_case("I DON'T WANNA GO TO SCHOOL.")
"I don't wanNA go to school."
>>> truecase.get_true_case("Testing $bug")
'Testing$ bug'
When I use the code, I get the error :
module 'truecase' has no attribute 'get_true_case'
how to fix it?
I am running Ubuntu 20.04.4 LTS
I have installed nltk
I use python 3.7
Thank you for your answer
Thanks for making this repo.
bugs in __function_one and __function_two of Trainer.py.
Logical bug, I checked the original implementation of
https://github.com/nreimers/truecaser
He first goes through the whole corpus to get all casing info. But you are getting casing info on the fly, which means that when a casing appears for the first time for one lower token, its 2-gram and 3-gram statistics will never be counted. This is not desired for this algorithm.
Let me know what you think of allowing users to specify their own lambda func if they aren't satisfied with the out of vocab options.
I can work on this in my fork and create a PR.
correctedStr = truecase.get_true_case("I didn't get the best price.")
print(correctedStr)
I did n't get the best price.
correctedStr = truecase.get_true_case("I don't want another.")
print(correctedStr)
I do n't want another.
After installing the package I get:
ModuleNotFoundError: No module named 'truecase'
on
import truecase
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.