Comments (3)
I have just tested to build the tries on a syllable basis instead of a char basis, meaning there will be one node per syllable instead of about 4 or 5 of them.
It does significantly reduce de trie size. I can't compare the performance of the tokenizer since it is not meant for such a trie.
It does look like a good improvement, memory usage wise, and the loading time is much better too:
memory_profiler
outputs:
Loading Trie... (3s.)
Loading Trie... (2s.)
Loading Trie... (1s.)
Line # Increment Line Contents
================================================
11 691.4 MiB gmd = get_tok('GMD')
12 116.7 MiB pos = get_tok('POS')
13 186.9 MiB tsik = get_tok('tsikchen')
The building time is about the same.
Building Trie... (36 s.)
Building Trie... (14 s.)
Building Trie... (7 s.)
from botok.
I did not expect it to consume so much memory. The pickled trie weights about 19Mo for POS profile, so I never thought it would require 600+Mo in memory.
I'll check if there is anything else than the loaded trie that takes so much memory.
from botok.
We have improved tokenizer to work on syllable based Trie (as @drupchen has described above)
from botok.
Related Issues (20)
- Splitting མངས་བས་ wrong?
- Missing English words at the end of the text during sentence tokenization
- 催更帮助文档!
- understanding custom pipelines HOT 3
- dict like `get` method for Token object
- detect any language
- Download of dialect packs fails on macOS when running CI HOT 1
- Why VOWELS constant only has one vowel? HOT 1
- Invalid index in merge rule silently produces uncalled for result.
- Unexpected skip of syllable while tokenizing.
- POS tags ? distinguishing some patterns HOT 2
- identifying weak syllables HOT 1
- issue with Python 3.9
- importing a custom dictionary HOT 1
- syllable tokenizer request
- syllable component
- Missing pos for PUNCT
- `token.text_unaffixed` failed to add tsek
- Can we remove "Loading Trie... (1s.)" message
- [Feature] Classify all PUNCTs into left and right
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botok.