Spaces:
Sleeping
Sleeping
Update utils/suggestions.py
Browse files- utils/suggestions.py +11 -4
utils/suggestions.py
CHANGED
|
@@ -63,8 +63,15 @@ def get_career_advice(parsed_text):
|
|
| 63 |
matched = match_field(field, df)
|
| 64 |
return matched['suggestion'].tolist()
|
| 65 |
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
matched = match_field(field, df)
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
matched = match_field(field, df)
|
| 64 |
return matched['suggestion'].tolist()
|
| 65 |
|
| 66 |
+
ddef get_job_listings(cv_text):
|
| 67 |
+
df = load_csv("jobs.csv")
|
| 68 |
+
field = identify_field(cv_text)
|
| 69 |
matched = match_field(field, df)
|
| 70 |
+
|
| 71 |
+
# Handle either 'listing' or 'suggestion' key
|
| 72 |
+
for col in ['listing', 'suggestion']:
|
| 73 |
+
if col in matched.columns:
|
| 74 |
+
return matched[col].dropna().tolist()
|
| 75 |
+
|
| 76 |
+
raise KeyError("CSV file must have either 'listing' or 'suggestion' column.")
|
| 77 |
+
|