Closed pemistahl closed 2 weeks ago
I think you will benefit from using a trie (not tree) data structure. Here is a Go implementation you may be able to use as a drop in replacement to map
.
I wonder if using a SQLite database to store your frequencies would help. That way you would only need to open a database connection and not load full frequency maps into memory. With indexing and query optimization (SQL could handle a piece of the logic of determining the highest frequency) it seems to me it would be pretty fast and very low memory footprint.
Closed in favor of #68.
Currently, the language models are loaded into simple maps at runtime. Even though accessing the maps is pretty fast, they consume a significant amount of memory. The goal is to investigate whether there are more suitable data structures available that require less storage space in memory, something like NumPy for Python.
One promising candidate could be Gonum.