tune: raise nspam hide threshold from 0.5 to 0.7

Reduces false positives against real users that still show up with
the v2.2 model, at the cost of letting through some borderline
spam. Applied to both reply notifications and thread rendering.
This commit is contained in:
Barry Deen
2026-04-18 11:28:13 -04:00
parent c1a1c8dab1
commit 799c52cd5b
2 changed files with 4 additions and 4 deletions
@@ -639,7 +639,7 @@ class NotificationRepository(
val repo = eventRepo
val noteCount = repo?.getCachedEventsByAuthor(event.pubkey, 1, 10)?.size ?: 0
val cached = spamAuthorCache?.get(event.pubkey, noteCount)
if (cached != null && cached >= 0.5f) return false
if (cached != null && cached >= 0.7f) return false
if (cached == null) {
val classifier = spamClassifier
val cache = spamAuthorCache
@@ -652,7 +652,7 @@ class NotificationRepository(
val score = classifier.score(inputs)
if (score != null) {
cache.put(event.pubkey, score, inputs.size)
if (score >= 0.5f) return false
if (score >= 0.7f) return false
}
}
}
@@ -371,7 +371,7 @@ class ThreadViewModel : ViewModel() {
val inputs = notes.map { e -> NoteInput(e.content, e.tags, e.created_at) }
val score = classifier.score(inputs) ?: continue
cache.put(pubkey, score, inputs.size)
if (score >= 0.5f) changed = true
if (score >= 0.7f) changed = true
}
if (changed) withContext(Dispatchers.Main) { scheduleRebuild() }
}
@@ -410,7 +410,7 @@ class ThreadViewModel : ViewModel() {
) {
val noteCount = eventRepoRef?.getCachedEventsByAuthor(event.pubkey, 1, 10)?.size ?: 0
val cached = spamAuthorCache?.get(event.pubkey, noteCount)
if (cached != null && cached >= 0.5f) {
if (cached != null && cached >= 0.7f) {
spamEvents.add(event)
continue
}