Giter VIP home page Giter VIP logo

Comments (3)

drupchen avatar drupchen commented on August 21, 2024 1

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.

drupchen avatar drupchen commented on August 21, 2024

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.

10zinten avatar 10zinten commented on August 21, 2024

We have improved tokenizer to work on syllable based Trie (as @drupchen has described above)

from botok.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.