change confidence to %

This commit is contained in:
2025-01-17 06:41:56 -05:00
parent 2c9c4a22a6
commit 890408f018
4 changed files with 9 additions and 6 deletions

View File

@@ -2,6 +2,7 @@
from difflib import SequenceMatcher
from typing import List, Optional, Tuple
import logging
import regex
class TrackMatcher:
@@ -28,6 +29,8 @@ class TrackMatcher:
Optional[Tuple[int, str, float]]: Tuple of (best matching track, similarity score)
or None if no good match found
"""
if not input_track or not candidate_tracks:
return None
@@ -53,7 +56,7 @@ class TrackMatcher:
best_match = candidate
# Return the match only if it meets the threshold
return (best_match, round(best_score, 2)) if best_score >= self.threshold else None
return (best_match, round(best_score *100)) if best_score >= self.threshold else None
def _normalize_string(self, text: str) -> str:
"""