Spaces:
Sleeping
Sleeping
Merge pull request #10 from luisrodriguesphd/feat-explanation-flag
Browse files- conf/params.yml +4 -1
- src/app/app.py +11 -7
conf/params.yml
CHANGED
@@ -51,6 +51,7 @@ app_frontend:
|
|
51 |
4. **Tailored Salary Range Estimation**: Receive a personalized salary estimate that reflects your unique skills and the job market, based on the best-matching job vacancies.
|
52 |
5. **Direct Opportunity Linkage**: Get direct links to job vacancies that align well with your resume, providing immediate career opportunities.
|
53 |
6. **Resume-Job Match Explanation**: Understand how your resume aligns with the recommended job vacancy through the explanation provided by our Retrieval-Augmented Generation (RAG).
|
|
|
54 |
jobs: ["Data Engineer", "Data Scientist", "Data Analyst", "Machine Learning Engineer"]
|
55 |
messages:
|
56 |
job_title_not_found: "WARNING: You must choose one of the roles in the Job Title section!"
|
@@ -64,5 +65,7 @@ app_frontend:
|
|
64 |
Unfortunately, at the moment, we couldn't find active jobs that matches your resume.
|
65 |
examples:
|
66 |
1:
|
|
|
67 |
"job_title": "Data Scientist"
|
68 |
-
"resume_path": ["data", "01_raw", "resume_examples", "Luis_Rodrigues_Resume_20240421.pdf"]
|
|
|
|
51 |
4. **Tailored Salary Range Estimation**: Receive a personalized salary estimate that reflects your unique skills and the job market, based on the best-matching job vacancies.
|
52 |
5. **Direct Opportunity Linkage**: Get direct links to job vacancies that align well with your resume, providing immediate career opportunities.
|
53 |
6. **Resume-Job Match Explanation**: Understand how your resume aligns with the recommended job vacancy through the explanation provided by our Retrieval-Augmented Generation (RAG).
|
54 |
+
sources: ["All", "Jobstreet"]
|
55 |
jobs: ["Data Engineer", "Data Scientist", "Data Analyst", "Machine Learning Engineer"]
|
56 |
messages:
|
57 |
job_title_not_found: "WARNING: You must choose one of the roles in the Job Title section!"
|
|
|
65 |
Unfortunately, at the moment, we couldn't find active jobs that matches your resume.
|
66 |
examples:
|
67 |
1:
|
68 |
+
"source": "All"
|
69 |
"job_title": "Data Scientist"
|
70 |
+
"resume_path": ["data", "01_raw", "resume_examples", "Luis_Rodrigues_Resume_20240421.pdf"]
|
71 |
+
"explanation_flag": False
|
src/app/app.py
CHANGED
@@ -11,7 +11,7 @@ app_backend = params['app_backend']
|
|
11 |
app_frontend = params['app_frontend']
|
12 |
|
13 |
|
14 |
-
def salary_estimator(job_title: str, resume_path: str):
|
15 |
|
16 |
salary_range, job_url, explanation = '', '', ''
|
17 |
|
@@ -37,7 +37,7 @@ def salary_estimator(job_title: str, resume_path: str):
|
|
37 |
if job_url is None:
|
38 |
job_url = app_frontend['messages']['active_job_not_found']
|
39 |
|
40 |
-
if job_description is not None:
|
41 |
explanation = generate_explanation_why_resume_for_a_job(resume, job_description)
|
42 |
|
43 |
return salary_range, job_url, explanation
|
@@ -47,18 +47,22 @@ def salary_estimator(job_title: str, resume_path: str):
|
|
47 |
demo = gr.Interface(
|
48 |
fn=salary_estimator,
|
49 |
inputs=[
|
50 |
-
gr.Radio(app_frontend['
|
51 |
-
gr.
|
|
|
|
|
52 |
],
|
53 |
outputs=[
|
54 |
gr.Textbox(label="Salary Range Estimation", lines=1),
|
55 |
-
gr.Textbox(label="Suitable Job Vacancy Sample", lines=
|
56 |
-
gr.Textbox(label="Why the Resume and the Job Match", lines=
|
57 |
],
|
58 |
examples=[
|
59 |
[
|
|
|
60 |
app_frontend['examples'][1]["job_title"],
|
61 |
-
os.path.join(*app_frontend['examples'][1]["resume_path"])
|
|
|
62 |
],
|
63 |
],
|
64 |
title=app_frontend['title'],
|
|
|
11 |
app_frontend = params['app_frontend']
|
12 |
|
13 |
|
14 |
+
def salary_estimator(sources:str, job_title: str, resume_path: str, explanation_flag: bool):
|
15 |
|
16 |
salary_range, job_url, explanation = '', '', ''
|
17 |
|
|
|
37 |
if job_url is None:
|
38 |
job_url = app_frontend['messages']['active_job_not_found']
|
39 |
|
40 |
+
if (explanation_flag) and (job_description is not None):
|
41 |
explanation = generate_explanation_why_resume_for_a_job(resume, job_description)
|
42 |
|
43 |
return salary_range, job_url, explanation
|
|
|
47 |
demo = gr.Interface(
|
48 |
fn=salary_estimator,
|
49 |
inputs=[
|
50 |
+
gr.Radio(app_frontend['sources'], value=app_frontend['sources'][0], label="Sources", info="More sources will be added later!"),
|
51 |
+
gr.Dropdown(app_frontend['jobs'], label="Job Title", info="More jobs will be added later!"),
|
52 |
+
gr.File(file_count='single', file_types=['.pdf'], label="Resume PDF File", show_label=True),
|
53 |
+
gr.Checkbox(value=False, label="Enable the resume-job match explanation feature", info="It takes approximately 5 minutes to run if enabled")
|
54 |
],
|
55 |
outputs=[
|
56 |
gr.Textbox(label="Salary Range Estimation", lines=1),
|
57 |
+
gr.Textbox(label="Suitable Job Vacancy Sample", lines=3),
|
58 |
+
gr.Textbox(label="Why the Resume and the Job Match", lines=16),
|
59 |
],
|
60 |
examples=[
|
61 |
[
|
62 |
+
app_frontend['examples'][1]["source"],
|
63 |
app_frontend['examples'][1]["job_title"],
|
64 |
+
os.path.join(*app_frontend['examples'][1]["resume_path"]),
|
65 |
+
app_frontend['examples'][1]["explanation_flag"],
|
66 |
],
|
67 |
],
|
68 |
title=app_frontend['title'],
|