lynn-twinkl
commited on
Commit
·
340a869
1
Parent(s):
60556bc
Added Tiwnkl originals filters
Browse files
app.py
CHANGED
|
@@ -14,6 +14,7 @@ from src.extract_usage import extract_usage
|
|
| 14 |
from src.necessity_index import compute_necessity, index_scaler, qcut_labels
|
| 15 |
from src.column_detection import detect_freeform_col
|
| 16 |
from src.shortlist import shortlist_applications
|
|
|
|
| 17 |
from typing import Tuple
|
| 18 |
|
| 19 |
##################################
|
|
@@ -46,6 +47,10 @@ def load_and_process(raw_csv: bytes) -> Tuple[pd.DataFrame, str]:
|
|
| 46 |
scored = df_orig.join(df_orig[freeform_col].apply(compute_necessity))
|
| 47 |
scored['necessity_index'] = index_scaler(scored['necessity_index'].values)
|
| 48 |
scored['priority'] = qcut_labels(scored['necessity_index'])
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
# Usage Extraction
|
| 51 |
docs = df_orig[freeform_col].to_list()
|
|
@@ -145,7 +150,8 @@ if uploaded_file is not None:
|
|
| 145 |
'urgency_score',
|
| 146 |
'severity_score',
|
| 147 |
'vulnerability_score',
|
| 148 |
-
'shortlist_score'
|
|
|
|
| 149 |
]
|
| 150 |
|
| 151 |
st.dataframe(auto_short_df.loc[:, shorltist_cols_to_show], hide_index=True)
|
|
|
|
| 14 |
from src.necessity_index import compute_necessity, index_scaler, qcut_labels
|
| 15 |
from src.column_detection import detect_freeform_col
|
| 16 |
from src.shortlist import shortlist_applications
|
| 17 |
+
from src.twinkl_originals import find_book_candidates
|
| 18 |
from typing import Tuple
|
| 19 |
|
| 20 |
##################################
|
|
|
|
| 47 |
scored = df_orig.join(df_orig[freeform_col].apply(compute_necessity))
|
| 48 |
scored['necessity_index'] = index_scaler(scored['necessity_index'].values)
|
| 49 |
scored['priority'] = qcut_labels(scored['necessity_index'])
|
| 50 |
+
|
| 51 |
+
# Find Twinkl Originals Candidates
|
| 52 |
+
scored['book_candidates'] = find_book_candidates(scored, freeform_col)
|
| 53 |
+
|
| 54 |
|
| 55 |
# Usage Extraction
|
| 56 |
docs = df_orig[freeform_col].to_list()
|
|
|
|
| 150 |
'urgency_score',
|
| 151 |
'severity_score',
|
| 152 |
'vulnerability_score',
|
| 153 |
+
'shortlist_score',
|
| 154 |
+
'book_candidates',
|
| 155 |
]
|
| 156 |
|
| 157 |
st.dataframe(auto_short_df.loc[:, shorltist_cols_to_show], hide_index=True)
|