-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathranking.py
More file actions
27 lines (23 loc) · 759 Bytes
/
Copy pathranking.py
File metadata and controls
27 lines (23 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
ranking.py
Helper functions for IMDB-based scoring of candidates.
"""
from typing import Dict, Any
def score_candidate(
imdb_rating: float,
genre_match_score: float = 0.0,
disliked_genre_penalty: float = 0.0,
runtime_match_score: float = 0.0,
) -> float:
"""
Compute a simple numeric score for a candidate.
You can call this from a custom tool if you want to do ranking
programmatically, or just keep it as documentation for your scoring scheme.
"""
# Basic weighting (you can tweak these multipliers)
score = 0.0
score += imdb_rating * 2.0
score += genre_match_score * 1.5
score -= disliked_genre_penalty * 2.0
score += runtime_match_score * 1.0
return score