Currently, the part-of-speech and lemmatizer models get cached in memory after they've been read from disk. This can lead to very high memory usage, especially if we have a single process that handles requests for many different languages.
This pull request adds a property called useModelCache that lets users disable the in-memory caching to reduce the memory usage at the expense of reading more data from disk. By default, the property is enabled so that the public API doesn't change from the previous behavior.
Currently, the part-of-speech and lemmatizer models get cached in memory after they've been read from disk. This can lead to very high memory usage, especially if we have a single process that handles requests for many different languages.
This pull request adds a property called
useModelCache
that lets users disable the in-memory caching to reduce the memory usage at the expense of reading more data from disk. By default, the property is enabled so that the public API doesn't change from the previous behavior.