]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Add neural PCA tests
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 28 Aug 2020 16:40:13 +0000 (17:40 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 28 Aug 2020 16:40:13 +0000 (17:40 +0100)
test/functional/cases/330_neural.robot
test/functional/configs/neural.conf

index a9a338f9537c7295faf7e4095bc737e44b0a11a7..e7f8418ffefb0339a295ff0bb191447b8a69c56e 100644 (file)
@@ -26,13 +26,17 @@ Train
 Check Neural HAM
   Sleep  2s  Wait for neural to be loaded
   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings={symbols_enabled = ["HAM_SYMBOL"];groups_enabled=["neural"];symbols_disabled = ["NEURAL_LEARN"]}
-  Check Rspamc  ${result}  NEURAL_HAM_SHORT
-  Check Rspamc  ${result}  NEURAL_SPAM_SHORT  inverse=1
+  Check Rspamc  ${result}  NEURAL_HAM_SHORT (
+  Check Rspamc  ${result}  NEURAL_SPAM_SHORT (  inverse=1
+  Check Rspamc  ${result}  NEURAL_HAM_SHORT_PCA (
+  Check Rspamc  ${result}  NEURAL_SPAM_SHORT_PCA (  inverse=1
 
 Check Neural SPAM
   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings={symbols_enabled = ["SPAM_SYMBOL"];groups_enabled=["neural"];symbols_disabled = ["NEURAL_LEARN"]}
-  Check Rspamc  ${result}  NEURAL_SPAM_SHORT
-  Check Rspamc  ${result}  NEURAL_HAM_SHORT  inverse=1
+  Check Rspamc  ${result}  NEURAL_SPAM_SHORT (
+  Check Rspamc  ${result}  NEURAL_HAM_SHORT (  inverse=1
+  Check Rspamc  ${result}  NEURAL_SPAM_SHORT_PCA (
+  Check Rspamc  ${result}  NEURAL_HAM_SHORT_PCA (  inverse=1
 
 
 Train INVERSE
@@ -46,13 +50,17 @@ Train INVERSE
 Check Neural HAM INVERSE
   Sleep  2s  Wait for neural to be loaded
   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings={symbols_enabled = ["HAM_SYMBOL"];groups_enabled=["neural"]}
-  Check Rspamc  ${result}  NEURAL_SPAM_SHORT
-  Check Rspamc  ${result}  NEURAL_HAM_SHORT  inverse=1
+  Check Rspamc  ${result}  NEURAL_SPAM_SHORT (
+  Check Rspamc  ${result}  NEURAL_SPAM_SHORT_PCA (
+  Check Rspamc  ${result}  NEURAL_HAM_SHORT (  inverse=1
+  Check Rspamc  ${result}  NEURAL_HAM_SHORT_PCA (  inverse=1
 
 Check Neural SPAM INVERSE
   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings={symbols_enabled = ["SPAM_SYMBOL"];groups_enabled=["neural"]}
-  Check Rspamc  ${result}  NEURAL_HAM_SHORT
-  Check Rspamc  ${result}  NEURAL_SPAM_SHORT  inverse=1
+  Check Rspamc  ${result}  NEURAL_HAM_SHORT (
+  Check Rspamc  ${result}  NEURAL_HAM_SHORT_PCA (
+  Check Rspamc  ${result}  NEURAL_SPAM_SHORT (  inverse=1
+  Check Rspamc  ${result}  NEURAL_SPAM_SHORT_PCA (  inverse=1
 
 *** Keywords ***
 Neural Setup
index 0a2ded95e3634f221fd3ab0b69c95c8584ee1baf..871a549fe551642f51114e35745fa3a337aaf258 100644 (file)
@@ -54,9 +54,23 @@ neural {
           symbol_spam = "NEURAL_SPAM_SHORT";
           symbol_ham = "NEURAL_HAM_SHORT";
           ann_expire = 86400;
-          watch_interval = 0.1;
+          watch_interval = 0.5;
+      }
+      SHORT_PCA {
+          train {
+              learning_rate = 0.001;
+              max_usages = 2;
+              spam_score = 1;
+              ham_score = -1;
+              max_trains = 10;
+              max_iterations = 250;
+          }
+          symbol_spam = "NEURAL_SPAM_SHORT_PCA";
+          symbol_ham = "NEURAL_HAM_SHORT_PCA";
+          ann_expire = 86400;
+          watch_interval = 0.5;
+          max_inputs = 2;
       }
-
   }
   allow_local = true;