diff options
Diffstat (limited to 'lualib/redis_scripts/bayes_learn.lua')
-rw-r--r-- | lualib/redis_scripts/bayes_learn.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lualib/redis_scripts/bayes_learn.lua b/lualib/redis_scripts/bayes_learn.lua index 80d86d803..5456165b6 100644 --- a/lualib/redis_scripts/bayes_learn.lua +++ b/lualib/redis_scripts/bayes_learn.lua @@ -26,7 +26,7 @@ redis.call('HSET', prefix, 'version', '2') -- new schema redis.call('HINCRBY', prefix, learned_key, is_unlearn and -1 or 1) -- increase or decrease learned count for i, token in ipairs(input_tokens) do - redis.call('HINCRBY', token, hash_key, 1) + redis.call('HINCRBY', token, hash_key, is_unlearn and -1 or 1) if text_tokens then local tok1 = text_tokens[i * 2 - 1] local tok2 = text_tokens[i * 2] @@ -41,4 +41,4 @@ for i, token in ipairs(input_tokens) do redis.call('ZINCRBY', prefix .. '_z', is_unlearn and -1 or 1, token) end end -end
\ No newline at end of file +end |