Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -75,7 +75,12 @@ def get_normalized_df(df):
|
|
75 |
return normalize_df
|
76 |
|
77 |
def calculate_selected_score(df, selected_columns):
|
78 |
-
selected_score = df[selected_columns].sum(axis=1)
|
|
|
|
|
|
|
|
|
|
|
79 |
return selected_score
|
80 |
|
81 |
def get_final_score(df, selected_columns):
|
|
|
75 |
return normalize_df
|
76 |
|
77 |
def calculate_selected_score(df, selected_columns):
|
78 |
+
# selected_score = df[selected_columns].sum(axis=1)
|
79 |
+
selected_QUALITY = [i for i in selected_columns if i in QUALITY_LIST]
|
80 |
+
selected_SEMANTIC = [i for i in selected_columns if i in SEMANTIC_LIST]
|
81 |
+
selected_quality_score = normalize_df[selected_QUALITY].sum(axis=1)/sum([DIM_WEIGHT[i] for i in selected_QUALITY])
|
82 |
+
selected_semantic_score = normalize_df[selected_SEMANTIC].sum(axis=1)/sum([DIM_WEIGHT[i] for i in selected_SEMANTIC ])
|
83 |
+
selected_score = (selected_quality_score * QUALITY_WEIGHT + selected_semantic_score * SEMANTIC_WEIGHT) / (QUALITY_WEIGHT + SEMANTIC_WEIGHT)
|
84 |
return selected_score
|
85 |
|
86 |
def get_final_score(df, selected_columns):
|