subwave: add 4 more 1996 shows, add artist-score floor to fix false match
Adds Tunecaster Rock Top 30 for 1996-01-13, 1996-04-13, 1996-07-13, and 1996-12-14, cross-checked against all 4 existing 1995 shows and each other for exact-track duplicates. Also fixes a real false-positive: "John Mellencamp - Just Another Day" was matching Jon Secada's unrelated song of the same generic title, because a perfect title score could carry a middling-but-not-absurd artist-name coincidence (0.56) over the acceptance threshold. Added a hard artist similarity floor (0.65) independent of the combined score. Claude-Session: https://claude.ai/code/session_01L7Rwa6guD5wK8F8tWQwcJX
This commit is contained in:
@@ -172,6 +172,15 @@ def contains_normalized(a, b):
|
||||
return bool(na.strip()) and bool(nb.strip()) and (na in nb or nb in na)
|
||||
|
||||
|
||||
# A hard floor, independent of the combined score: without it a generic title
|
||||
# match (e.g. two different "Just Another Day"s) can drag a middling but not
|
||||
# absurd artist-name coincidence (e.g. "Jon Secada" vs "John Mellencamp",
|
||||
# 0.56) over the acceptance threshold on title strength alone. Legitimate
|
||||
# matches -- exact names or the containment-boosted composite-credit/subtitle
|
||||
# cases -- always clear this by a wide margin.
|
||||
ARTIST_SCORE_FLOOR = 0.65
|
||||
|
||||
|
||||
def score_candidate(song, artist, title):
|
||||
title_score = similarity(song.get("title", ""), title)
|
||||
if contains_normalized(song.get("title", ""), title):
|
||||
@@ -179,6 +188,8 @@ def score_candidate(song, artist, title):
|
||||
artist_score = similarity(song.get("artist", ""), artist)
|
||||
if contains_normalized(song.get("artist", ""), artist):
|
||||
artist_score = 1.0
|
||||
if artist_score < ARTIST_SCORE_FLOOR:
|
||||
return 0.0
|
||||
return title_score * 0.6 + artist_score * 0.4
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user