lynn-twinkl
commited on
Commit
·
9e5b677
1
Parent(s):
a0f5b0e
implemented new book_candidate detection with school_type column detection
Browse files
app.py
CHANGED
|
@@ -59,6 +59,7 @@ def load_and_process(raw_csv: bytes) -> Tuple[pd.DataFrame, str]:
|
|
| 59 |
# Detect freeform column
|
| 60 |
freeform_col = detect_freeform_col(df_orig)
|
| 61 |
id_col = detect_id_col(df_orig)
|
|
|
|
| 62 |
print(id_col)
|
| 63 |
|
| 64 |
df_orig = df_orig[df_orig[freeform_col].notna()]
|
|
@@ -72,7 +73,7 @@ def load_and_process(raw_csv: bytes) -> Tuple[pd.DataFrame, str]:
|
|
| 72 |
scored['priority'] = qcut_labels(scored['necessity_index'])
|
| 73 |
|
| 74 |
# Find Twinkl Originals Candidates
|
| 75 |
-
scored['book_candidates'] = find_book_candidates(scored, freeform_col)
|
| 76 |
|
| 77 |
# Label Heartfelt Applications
|
| 78 |
scored['clean_text'] = scored[freeform_col].map(normalise_text)
|
|
|
|
| 59 |
# Detect freeform column
|
| 60 |
freeform_col = detect_freeform_col(df_orig)
|
| 61 |
id_col = detect_id_col(df_orig)
|
| 62 |
+
school_type_col = detect_school_type_col(df_orig)
|
| 63 |
print(id_col)
|
| 64 |
|
| 65 |
df_orig = df_orig[df_orig[freeform_col].notna()]
|
|
|
|
| 73 |
scored['priority'] = qcut_labels(scored['necessity_index'])
|
| 74 |
|
| 75 |
# Find Twinkl Originals Candidates
|
| 76 |
+
scored['book_candidates'] = find_book_candidates(scored, freeform_col, school_type_col)
|
| 77 |
|
| 78 |
# Label Heartfelt Applications
|
| 79 |
scored['clean_text'] = scored[freeform_col].map(normalise_text)
|