Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added bot messages as "known negatives" for learning purposes #44

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/VahterBanBot/DB.fs
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,15 @@ WITH really_banned AS (SELECT *
spam_or_ham AS (SELECT DISTINCT COALESCE(m.text, re_id.message_text) AS text,
CASE
-- known false negative spam messages
WHEN EXISTS(SELECT 1
FROM false_negative_messages fnm
WHERE fnm.chat_id = m.chat_id
AND fnm.message_id = m.message_id)
WHEN (EXISTS(SELECT 1
FROM false_negative_messages fnm
WHERE fnm.chat_id = m.chat_id
AND fnm.message_id = m.message_id)
-- known banned spam messages by bot, and not marked as false positive
OR EXISTS(SELECT 1
FROM banned_by_bot bbb
WHERE bbb.banned_in_chat_id = m.chat_id
AND bbb.message_id = m.message_id))
THEN TRUE
WHEN re_id.banned_user_id IS NULL AND re_text.banned_user_id IS NULL
THEN FALSE
Expand Down