lynn-twinkl
commited on
Commit
·
e831ddf
1
Parent(s):
7e21a53
Excluded already shortlisted app from manual shortlisting
Browse files
app.py
CHANGED
|
@@ -75,7 +75,7 @@ if uploaded_file is not None:
|
|
| 75 |
|
| 76 |
scored_full = shortlist_applications(df, k=len(df))
|
| 77 |
threshold_score = scored_full["shortlist_score"].quantile(quantile_map[mode])
|
| 78 |
-
|
| 79 |
|
| 80 |
st.title("Filters")
|
| 81 |
min_idx = float(df['necessity_index'].min())
|
|
@@ -83,7 +83,7 @@ if uploaded_file is not None:
|
|
| 83 |
filter_range = st.sidebar.slider(
|
| 84 |
"Necessity Index Range", min_value=min_idx, max_value=max_idx, value=(min_idx, max_idx)
|
| 85 |
)
|
| 86 |
-
filtered_df = df[df['necessity_index'].between(filter_range[0], filter_range[1])]
|
| 87 |
|
| 88 |
st.markdown(f"**Total Applications:** {len(df)}")
|
| 89 |
st.markdown(f"**Filtered Applications:** {len(filtered_df)}")
|
|
@@ -99,7 +99,7 @@ if uploaded_file is not None:
|
|
| 99 |
st.header("✨ Automatic Shortlist")
|
| 100 |
st.markdown("Here's your **automatically genereated shortlist!** If you'd like to manually add additional applications, you may do so on the section below!")
|
| 101 |
|
| 102 |
-
csv_auto =
|
| 103 |
st.download_button(
|
| 104 |
label="Download Shortlist",
|
| 105 |
data=csv_auto,
|
|
@@ -109,9 +109,10 @@ if uploaded_file is not None:
|
|
| 109 |
)
|
| 110 |
st.markdown("#### Shortlist Preview")
|
| 111 |
st.write("")
|
| 112 |
-
shortlistCounter_col, mode_col = st.columns(
|
| 113 |
|
| 114 |
-
|
|
|
|
| 115 |
mode_col.metric("Mode", mode)
|
| 116 |
|
| 117 |
shorltist_cols_to_show = [
|
|
@@ -125,7 +126,7 @@ if uploaded_file is not None:
|
|
| 125 |
'shortlist_score'
|
| 126 |
]
|
| 127 |
|
| 128 |
-
st.dataframe(
|
| 129 |
|
| 130 |
## REVIEW APPLICATIONS
|
| 131 |
|
|
|
|
| 75 |
|
| 76 |
scored_full = shortlist_applications(df, k=len(df))
|
| 77 |
threshold_score = scored_full["shortlist_score"].quantile(quantile_map[mode])
|
| 78 |
+
auto_short_df = shortlist_applications(df, threshold=threshold_score)
|
| 79 |
|
| 80 |
st.title("Filters")
|
| 81 |
min_idx = float(df['necessity_index'].min())
|
|
|
|
| 83 |
filter_range = st.sidebar.slider(
|
| 84 |
"Necessity Index Range", min_value=min_idx, max_value=max_idx, value=(min_idx, max_idx)
|
| 85 |
)
|
| 86 |
+
filtered_df = df[(~df.index.isin(auto_short_df.index)) & (df['necessity_index'].between(filter_range[0], filter_range[1]))]
|
| 87 |
|
| 88 |
st.markdown(f"**Total Applications:** {len(df)}")
|
| 89 |
st.markdown(f"**Filtered Applications:** {len(filtered_df)}")
|
|
|
|
| 99 |
st.header("✨ Automatic Shortlist")
|
| 100 |
st.markdown("Here's your **automatically genereated shortlist!** If you'd like to manually add additional applications, you may do so on the section below!")
|
| 101 |
|
| 102 |
+
csv_auto = auto_short_df.to_csv(index=False).encode("utf-8")
|
| 103 |
st.download_button(
|
| 104 |
label="Download Shortlist",
|
| 105 |
data=csv_auto,
|
|
|
|
| 109 |
)
|
| 110 |
st.markdown("#### Shortlist Preview")
|
| 111 |
st.write("")
|
| 112 |
+
total_col, shortlistCounter_col, mode_col = st.columns(3)
|
| 113 |
|
| 114 |
+
total_col.metric("Applications Submitted", len(df))
|
| 115 |
+
shortlistCounter_col.metric("Shorlist Length", len(auto_short_df))
|
| 116 |
mode_col.metric("Mode", mode)
|
| 117 |
|
| 118 |
shorltist_cols_to_show = [
|
|
|
|
| 126 |
'shortlist_score'
|
| 127 |
]
|
| 128 |
|
| 129 |
+
st.dataframe(auto_short_df.loc[:, shorltist_cols_to_show], hide_index=True)
|
| 130 |
|
| 131 |
## REVIEW APPLICATIONS
|
| 132 |
|