diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/neural.lua | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/plugins/lua/neural.lua b/src/plugins/lua/neural.lua index 894d42e30..ca11d9e66 100644 --- a/src/plugins/lua/neural.lua +++ b/src/plugins/lua/neural.lua @@ -119,10 +119,24 @@ local function ann_scores_filter(task) if score > 0 then local result = score - task:insert_result(rule.symbol_spam, result, symscore) + + if not rule.spam_score_threshold or result >= rule.spam_score_threshold then + task:insert_result(rule.symbol_spam, result, symscore) + else + lua_util.debugm(N, task, '%s:%s:%s ann score: %s < %s (spam_score_threshold)', + rule.prefix, set.name, set.ann.version, symscore, + rule.spam_score_threshold) + end else local result = -(score) - task:insert_result(rule.symbol_ham, result, symscore) + + if not rule.ham_score_threshold or result >= rule.ham_score_threshold then + task:insert_result(rule.symbol_ham, result, symscore) + else + lua_util.debugm(N, task, '%s:%s:%s ann score: %s < %s (ham_score_threshold)', + rule.prefix, set.name, set.ann.version, result, + rule.ham_score_threshold) + end end end end |