snipsco / snips-nlu-rs

Snips NLU rust implementation
https://snips.ai
Other
340 stars 56 forks source link

Optimize memory footprint of resources #151

Closed adrienball closed 5 years ago

adrienball commented 5 years ago

Description

In English, with the current word clusters included in the resources, this results in a constant 25MB gain in memory. For other languages without word clusters, the expected gain is between 0.5MB and 1MB.

Backward compatibility The new implementation is backward compatible. Old word clusters, which typically are stored like hierarchical binary paths of the form "10001011001", can still be loaded. In this case, clusters will be loaded as strings. New word clusters, introduced in https://github.com/snipsco/snips-nlu-language-resources/pull/33, will benefit from this improved implementation, as all clusters are u16-like.