Spaces:
Runtime error
Runtime error
Update app.py
Browse files[update] final score
app.py
CHANGED
|
@@ -85,12 +85,11 @@ def get_final_score(df, selected_columns):
|
|
| 85 |
normalize_df[name] = normalize_df[name]*DIM_WEIGHT[name]
|
| 86 |
quality_score = normalize_df[QUALITY_LIST].sum(axis=1)/sum([DIM_WEIGHT[i] for i in QUALITY_LIST])
|
| 87 |
semantic_score = normalize_df[SEMANTIC_LIST].sum(axis=1)/sum([DIM_WEIGHT[i] for i in SEMANTIC_LIST ])
|
| 88 |
-
final_score = quality_score+ semantic_score
|
| 89 |
if 'Overall Score' in df:
|
| 90 |
df['Overall Score'] = final_score
|
| 91 |
else:
|
| 92 |
df.insert(1, 'Overall Score', final_score)
|
| 93 |
-
final_score = quality_score+ semantic_score
|
| 94 |
if 'Semantic Score' in df:
|
| 95 |
df['Semantic Score'] = semantic_score
|
| 96 |
else:
|
|
|
|
| 85 |
normalize_df[name] = normalize_df[name]*DIM_WEIGHT[name]
|
| 86 |
quality_score = normalize_df[QUALITY_LIST].sum(axis=1)/sum([DIM_WEIGHT[i] for i in QUALITY_LIST])
|
| 87 |
semantic_score = normalize_df[SEMANTIC_LIST].sum(axis=1)/sum([DIM_WEIGHT[i] for i in SEMANTIC_LIST ])
|
| 88 |
+
final_score = (quality_score * QUALITY_WEIGHT + semantic_score * SEMANTIC_WEIGHT) / (QUALITY_WEIGHT + SEMANTIC_WEIGHT)
|
| 89 |
if 'Overall Score' in df:
|
| 90 |
df['Overall Score'] = final_score
|
| 91 |
else:
|
| 92 |
df.insert(1, 'Overall Score', final_score)
|
|
|
|
| 93 |
if 'Semantic Score' in df:
|
| 94 |
df['Semantic Score'] = semantic_score
|
| 95 |
else:
|