Reduce Reddit and Polymarket false positives

Weight Reddit relevance toward titles, stop Polymarket from expanding low-signal standalone terms, and prevent short binary outcomes from matching unrelated queries.

Validation: uv run python -m unittest tests.test_reddit_sc tests.test_polymarket
This commit is contained in:
Jeffrey Sperling
2026-03-14 00:38:52 -07:00
parent 8c1dce95e8
commit c711e443fe
4 changed files with 118 additions and 16 deletions
+19
View File
@@ -158,5 +158,24 @@ class TestDepthConfig(unittest.TestCase):
)
class TestPostRelevance(unittest.TestCase):
def test_body_cannot_rescue_weak_title_too_far(self):
score = reddit._compute_post_relevance(
"anthropic odds",
"President Trump orders agencies to stop using Anthropic technology",
"Long body text eventually mentions odds and other tangential details.",
)
self.assertLess(score, 0.7)
self.assertGreaterEqual(score, 0.5)
def test_exact_title_match_stays_high(self):
score = reddit._compute_post_relevance(
"claude code tips",
"Claude Code tips for faster workflows",
"",
)
self.assertGreater(score, 0.7)
if __name__ == "__main__":
unittest.main()