Add project README and reason/quote fields to classifier response
- README.md: full project overview with setup, training, API, and RSpamd integration docs - server.py: add reason (human-readable explanation) and quote (suspicious snippet) to response - spamllm.lua: pass reason and quote through to RSpamd symbol description for logs/UI Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
38efd20b4d
commit
f05320a8cb
3 changed files with 203 additions and 3 deletions
|
|
@ -75,9 +75,14 @@ local function check_spamllm(task)
|
|||
local result = parser:get_object()
|
||||
|
||||
if result.is_spam then
|
||||
task:insert_result(settings.symbol_spam, result.confidence, "SpamLLM")
|
||||
rspamd_logger.infox(task, "SpamLLM: SPAM (confidence=%.2f, score=%.2f, lang=%s)",
|
||||
result.confidence, result.score, result.language or "?")
|
||||
-- Reason und Quote als Options an das Symbol anhängen
|
||||
local description = result.reason or "SpamLLM"
|
||||
if result.quote and #result.quote > 0 then
|
||||
description = description .. " | " .. result.quote
|
||||
end
|
||||
task:insert_result(settings.symbol_spam, result.confidence, description)
|
||||
rspamd_logger.infox(task, "SpamLLM: SPAM (confidence=%.2f, score=%.2f, lang=%s, reason=%s)",
|
||||
result.confidence, result.score, result.language or "?", result.reason or "?")
|
||||
else
|
||||
task:insert_result(settings.symbol_ham, -result.confidence, "SpamLLM")
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue