Make Find Bar result ranking user specific
(MGNLPER-72)
|
|
| Status: | Closed |
| Project: | Periscope |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.1 |
| Type: | Sub-task | Priority: | Neutral |
| Reporter: | Federico Grilli | Assignee: | Federico Grilli |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Sprint: | Foundation 2, Foundation 3 | ||||||||
| Description |
|
ResultRankerProvider will keep a mapping of users and NeuralNetworkResultRanker(s), as the neural network and labels are now per user. Such mapping will be created lazily upon user's first search. Problem is, how and when to clean up such mapping when a user logs out. Cleaning up is essential because, internally, NeuralNetworkResultRanker uses deeplearning4j which may allocate significant amounts of "off-heap" memory, that is not managed by the JVM (on our demo a neural network takes ~13MB per user). See also https://deeplearning4j.org/docs/latest/deeplearning4j-config-memory Ideally, NeuralNetworkResultRanker should be an admincentral scoped component whose lifecycle ends with a user session but machine-learning module has no dependency on UI. One solution could be keeping the mapping in a cache with a LRU eviction policy. An alternative solution would be to have one Periscope instance per user (instead of being a singleton):
CONTRA
------- UPDATE ResultRankerProvider is replaced with a factory explicitly bound to user. |