lynn-twinkl
commited on
Commit
·
1a2ef50
1
Parent(s):
e4fedf2
Changed column name for shortlist score and preview cols for shortlist
Browse files- app.py +12 -4
- functions/shortlist.py +4 -4
app.py
CHANGED
|
@@ -74,7 +74,7 @@ if uploaded_file is not None:
|
|
| 74 |
)
|
| 75 |
|
| 76 |
scored_full = shortlist_applications(df, k=len(df))
|
| 77 |
-
threshold_score = scored_full["
|
| 78 |
auto_short = shortlist_applications(df, threshold=threshold_score)
|
| 79 |
|
| 80 |
st.title("Filters")
|
|
@@ -114,9 +114,17 @@ if uploaded_file is not None:
|
|
| 114 |
shortlistCounter_col.metric("Shorlist Length", len(auto_short))
|
| 115 |
mode_col.metric("Mode", mode)
|
| 116 |
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
## REVIEW APPLICATIONS
|
| 122 |
|
|
|
|
| 74 |
)
|
| 75 |
|
| 76 |
scored_full = shortlist_applications(df, k=len(df))
|
| 77 |
+
threshold_score = scored_full["shortlist_score"].quantile(quantile_map[mode])
|
| 78 |
auto_short = shortlist_applications(df, threshold=threshold_score)
|
| 79 |
|
| 80 |
st.title("Filters")
|
|
|
|
| 114 |
shortlistCounter_col.metric("Shorlist Length", len(auto_short))
|
| 115 |
mode_col.metric("Mode", mode)
|
| 116 |
|
| 117 |
+
shorltist_cols_to_show = [
|
| 118 |
+
freeform_col,
|
| 119 |
+
'Usage',
|
| 120 |
+
'necessity_index',
|
| 121 |
+
'urgency_score',
|
| 122 |
+
'severity_score',
|
| 123 |
+
'vulnerability_score',
|
| 124 |
+
'shortlist_score'
|
| 125 |
+
]
|
| 126 |
+
|
| 127 |
+
st.dataframe(auto_short.loc[:, shorltist_cols_to_show], hide_index=True)
|
| 128 |
|
| 129 |
## REVIEW APPLICATIONS
|
| 130 |
|
functions/shortlist.py
CHANGED
|
@@ -60,13 +60,13 @@ def shortlist_applications(
|
|
| 60 |
weights['usage'] * usage_score
|
| 61 |
)
|
| 62 |
df = df.copy()
|
| 63 |
-
df['
|
| 64 |
|
| 65 |
# Select applications based on k or threshold
|
| 66 |
-
df_sorted = df.sort_values('
|
| 67 |
if k is not None:
|
| 68 |
result = df_sorted.head(k)
|
| 69 |
else:
|
| 70 |
-
result = df_sorted[df_sorted['
|
| 71 |
|
| 72 |
-
return result
|
|
|
|
| 60 |
weights['usage'] * usage_score
|
| 61 |
)
|
| 62 |
df = df.copy()
|
| 63 |
+
df['shortlist_score'] = combined
|
| 64 |
|
| 65 |
# Select applications based on k or threshold
|
| 66 |
+
df_sorted = df.sort_values('shortlist_score', ascending=False)
|
| 67 |
if k is not None:
|
| 68 |
result = df_sorted.head(k)
|
| 69 |
else:
|
| 70 |
+
result = df_sorted[df_sorted['shortlist_score'] >= threshold]
|
| 71 |
|
| 72 |
+
return result
|