Convert single-byte charset probers to use nested dicts for language models#121
Convert single-byte charset probers to use nested dicts for language models#121dan-blanchard merged 3 commits intomasterfrom
Conversation
…e modules - Also provide conversion script
sigmavirus24
left a comment
There was a problem hiding this comment.
So, the only performance benefit to using iteritems anywhere is if you have a dictionary with millions of item pairs. If that is where we are (GitHub won't show these diffs) then that's fine, otherwise, I'd rather we just use .items() everywhere. Either way, this looks great. 🎉 🍰:sparkles:
…models (#121) * Convert single byte charset modules to use dicts of dicts for language modules - Also provide conversion script * Fix debug logging check * Keep Hungarian commented out until we retrain
Marcopolo |
This isolates one of the major changes in #99, which is changing our single-byte charset prober language model format to use nested dicts instead of giant lists and offset math. This makes the code much easier to understand and language model access takes about 60% of the time it used to.
The language model conversion script I've included in this PR does not need to stick around in
masterlong term; I just wanted it here for review, since looking through the code that converts the language models and seeing if that looks right is much easier than visually comparing giant language model files.I'm still seeing some test failures on this branch where Hungarian is being over-predicted, so this isn't quite ready to merge yet, but I figured putting it up here someone might notice something I missed.