califyn / title-capitalization Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Amazing Project! However when using the text enhancer I'll have to do extensive text cleanup. When running
input_text = "aushilfe (m/w/d) als reinigungskraft"
output_text = apply_te(input_text, lan='de')
python errors with
IndexError Traceback (most recent call last)
[<ipython-input-9-11b317305bd2>](https://localhost:8080/#) in <module>()
1 # input_text = model.examples[0]
2 input_text = "aushilfe (m/w/d) als reinigungskraft"
----> 3 output_text = apply_te(input_text, lan='de')
4 print(f"Input: \n{input_text}\nOutput:\n{output_text}")
[<ipython-input-2-196122d4e396>](https://localhost:8080/#) in apply_te(text, lan)
15
16 def apply_te(text, lan='en'):
---> 17 return model.enhance_text(text, lan)
<torch_package_0>.release_module.py in enhance_text(self, text, lan, len_limit)
118
119 if len(text.split()) < len_limit:
--> 120 enhanced = self.enhance_textblock(text, lan_id)
121 else:
122 enhanced = self.enhance_long_textblock(text, lan_id, len_limit)
<torch_package_0>.release_module.py in enhance_textblock(self, text, lan_id)
73 punct[0][1:-1],
74 capital[0][1:-1],
---> 75 self.index2punct))
76
77 def count_occurrences(self, text, char):
<torch_package_0>.release_module.py in enhance_tokens(tokens, punct, capital, index2punct)
163 if len(token) < 2:
164 print(token)
--> 165 token = '##' + token[2].upper() + token[3:]
166 if c == 2:
167 token = token.upper()
IndexError: string index out of range
The same text without the (m/w/d)
works as expected
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.