change confidence to %
This commit is contained in:
@@ -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:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user