From f8a7edce9476de88ec176fab95638dd4f853a674 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 10 Mar 2018 14:30:44 +0000 Subject: [PATCH] [Conf] Adjust names and weights for neural network plugin --- conf/groups.conf | 6 ++++++ src/plugins/lua/neural.lua | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/conf/groups.conf b/conf/groups.conf index 734a710fb..04b777e6b 100644 --- a/conf/groups.conf +++ b/conf/groups.conf @@ -95,5 +95,11 @@ group "excessb64" { .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/excessb64_group.conf" } +# Not defined by default +group "neural" { + .include(try=true; priority=1; duplicate=merge) "$LOCAL_CONFDIR/local.d/neural_group.conf" + .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/neural_group.conf" +} + .include(try=true; priority=1; duplicate=merge) "$LOCAL_CONFDIR/local.d/groups.conf" .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/groups.conf" \ No newline at end of file diff --git a/src/plugins/lua/neural.lua b/src/plugins/lua/neural.lua index 216a2800d..547751f93 100644 --- a/src/plugins/lua/neural.lua +++ b/src/plugins/lua/neural.lua @@ -57,8 +57,8 @@ local default_options = { lock_expire = 600, learning_spawned = false, ann_expire = 60 * 60 * 24 * 2, -- 2 days - symbol_spam = 'FANNR_SPAM', - symbol_ham = 'FANNR_HAM', + symbol_spam = 'NEURAL_SPAM', + symbol_ham = 'NEURAL_HAM', } local settings = { @@ -955,7 +955,7 @@ else end local id = rspamd_config:register_symbol({ - name = 'FANN_CHECK', + name = 'NEURAL_CHECK', type = 'postfilter,nostat', priority = 6, callback = ann_scores_filter @@ -1007,7 +1007,7 @@ else settings.rules[k] = def_rules rspamd_config:set_metric_symbol({ name = def_rules.symbol_spam, - score = 3.0, + score = 0.0, description = 'Neural network SPAM', group = 'neural' }) @@ -1019,7 +1019,7 @@ else rspamd_config:set_metric_symbol({ name = def_rules.symbol_ham, - score = -2.0, + score = -0.0, description = 'Neural network HAM', group = 'neural' }) @@ -1031,7 +1031,7 @@ else end rspamd_config:register_symbol({ - name = 'FANN_VECTOR_PUSH', + name = 'NEURAL_LEARN', type = 'idempotent,nostat', priority = 5, callback = ann_push_vector -- 2.39.5