Skip to content

Instantly share code, notes, and snippets.

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,