aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/redis_scripts
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-12-07 15:40:08 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-12-07 15:40:08 +0000
commit752414a1f585b5ad3b03d812eb2aa995e899e9b3 (patch)
tree70faa7e3b483118473fa83c8f10ba59795a09d40 /lualib/redis_scripts
parent51e123f58ff32e362ba35f077d37e3a7d04de5a5 (diff)
downloadrspamd-752414a1f585b5ad3b03d812eb2aa995e899e9b3.tar.gz
rspamd-752414a1f585b5ad3b03d812eb2aa995e899e9b3.zip
[Project] Add some basic learning
Diffstat (limited to 'lualib/redis_scripts')
-rw-r--r--lualib/redis_scripts/bayes_learn.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/lualib/redis_scripts/bayes_learn.lua b/lualib/redis_scripts/bayes_learn.lua
index 2b74fcca9..638254706 100644
--- a/lualib/redis_scripts/bayes_learn.lua
+++ b/lualib/redis_scripts/bayes_learn.lua
@@ -7,9 +7,9 @@
-- key5 - set of tokens encoded in messagepack array of int64_t
local prefix = KEYS[1]
-local is_spam = KEYS[2]
+local is_spam = KEYS[2] == 'true' and true or false
local symbol = KEYS[3]
-local is_unlearn = KEYS[4]
+local is_unlearn = KEYS[4] == 'true' and true or false
local input_tokens = cmsgpack.unpack(KEYS[5])
local prefix_underscore = prefix .. '_'