]> source.dussan.org Git - rspamd.git/commitdiff
[Conf] Adjust names and weights for neural network plugin
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 10 Mar 2018 14:30:44 +0000 (14:30 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 10 Mar 2018 14:56:00 +0000 (14:56 +0000)
conf/groups.conf
src/plugins/lua/neural.lua

index 734a710fbcd69031fddd4d178651ac49e6d5367e..04b777e6b958a0f8a98b2c0aa0a7543a5bbdaf2e 100644 (file)
@@ -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
index 216a2800d98a1d6de3f3b424a337103e87a642be..547751f939b561e982bffacc5492abca3dbc46e7 100644 (file)
@@ -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