This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def weighted_sum(score, weights): | |
return sum(weights[cls] * proba | |
for cls, proba in score['probability'].items()) | |
def normalized_weighted_sum(score, weights): | |
return weighted_sum(score, weights) / len(weights) | |
enwiki_weights = { | |
'Stub': 1, | |
'Start': 2, |