Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -80,16 +80,30 @@ def calculate_selected_score(df, selected_columns):
|
|
80 |
|
81 |
def get_final_score(df, selected_columns):
|
82 |
normalize_df = get_normalized_df(df)
|
83 |
-
final_score = normalize_df.drop('name', axis=1).sum(axis=1)
|
|
|
|
|
|
|
|
|
|
|
84 |
if 'Overall Score' in df:
|
85 |
df['Overall Score'] = final_score
|
86 |
else:
|
87 |
df.insert(1, 'Overall Score', final_score)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
selected_score = calculate_selected_score(normalize_df, selected_columns)
|
89 |
-
if '
|
90 |
-
df['
|
91 |
else:
|
92 |
-
df.insert(1, '
|
93 |
return df
|
94 |
|
95 |
def get_baseline_df():
|
|
|
80 |
|
81 |
def get_final_score(df, selected_columns):
|
82 |
normalize_df = get_normalized_df(df)
|
83 |
+
#final_score = normalize_df.drop('name', axis=1).sum(axis=1)
|
84 |
+
for name in normalize_df.drop('name', axis=1):
|
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:
|
97 |
+
df.insert(2, 'Semantic Score', semantic_score)
|
98 |
+
if 'Quality Score' in df:
|
99 |
+
df['Quality Score'] = quality_score
|
100 |
+
else:
|
101 |
+
df.insert(3, 'Quality Score', quality_score)
|
102 |
selected_score = calculate_selected_score(normalize_df, selected_columns)
|
103 |
+
if 'Selected Score' in df:
|
104 |
+
df['Selected Score'] = selected_score
|
105 |
else:
|
106 |
+
df.insert(1, 'Selected Score', selected_score)
|
107 |
return df
|
108 |
|
109 |
def get_baseline_df():
|