1
0
Fork 0

Fix online classifier update

This commit is contained in:
Andy Wingo 2022-11-29 10:16:30 +01:00
parent ba9a560f01
commit 17905ace44

View file

@ -283,13 +283,19 @@
(assq-ref index 'master)))) (assq-ref index 'master))))
(let ((removed-features (count-features removed)) (let ((removed-features (count-features removed))
(added-features (count-features added))) (added-features (count-features added)))
;; If a comment passes the spam filter, it gets added, and is
;; presumed legitimate. It could then be reverted, in which
;; case we should remove its features from the legitimate count
;; and add them to the bogus count.
(hash-for-each (lambda (k v) (hash-for-each (lambda (k v)
(remove-feature! legit-features k v) (remove-feature! legit-features k v)
(add-feature! bogus-features k v)) (add-feature! bogus-features k v))
removed-features) removed-features)
(hash-for-each (lambda (k v) (hash-for-each (lambda (k v)
(add-feature! legit-features k v) ;; Asymmetry with removed-features; the
(remove-feature! bogus-features k v)) ;; comment wasn't previously marked bogus, so
;; we just add its features to the legit set.
(add-feature! legit-features k v))
added-features) added-features)
(update-bogosities! bogosities removed-features (update-bogosities! bogosities removed-features
legit-features bogus-features) legit-features bogus-features)