feat(classifier): label 'drop' via hard-rule + score threshold (-5 default)

- Add DEFAULT_THRESHOLDS['drop'] = -5 and DEFAULT_HARD_DROP_RULES const
- Add evaluate_hard_drop(): fires when no positive signals + short latin name OR ≥3 placeholder fields
- Wire into classify(): drop overrides all other labels; synthetic reason explains trigger
- Add drop_reason_label() and 'drop' => ' авто-дроп' to MessageFormatter::LABEL_MAP
- Update ClassifierTest/MessageFormatterTest to extend Cf7stgTestCase (filter isolation)
- Adjust pre-existing assertions that now correctly yield 'drop' instead of 'spam'
This commit is contained in:
Vladimir Bryzgalov
2026-04-21 16:14:49 +05:00
parent 18a07c9b1b
commit a70785beca
5 changed files with 214 additions and 6 deletions
+1
View File
@@ -11,6 +11,7 @@ final class MessageFormatter
'client' => ['emoji' => '🟢', 'text' => 'похоже клиент'],
'unclear' => ['emoji' => '🟡', 'text' => 'неясно'],
'spam' => ['emoji' => '🔴', 'text' => 'похоже спам'],
'drop' => ['emoji' => '⛔', 'text' => 'авто-дроп'],
];
/**