Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,62 +1,62 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
from functions import extract_text_from_pdf, git_most_similar_job, generate_gemini_content
|
| 3 |
-
import os
|
| 4 |
-
|
| 5 |
-
#################### Web ############################################################
|
| 6 |
-
st.title("Jobs Suitable for each CV ")
|
| 7 |
-
|
| 8 |
-
info = """- The user uploads his CV in PDF format and passes the number of jobs he wants,
|
| 9 |
-
and we display the number of jobs most suitable for each CV from the following recruitment sites,
|
| 10 |
-
LinkedIn, Wazzaf, Indeed and Bayt"""
|
| 11 |
-
st.write(f":blue[{info}]")
|
| 12 |
-
|
| 13 |
-
note = " Note : that the jobs currently available are in the fields of programming and technology only"
|
| 14 |
-
st.write(f":red[{note}]")
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
# Set the overall layout width
|
| 18 |
-
st.markdown(
|
| 19 |
-
"""
|
| 20 |
-
<style>
|
| 21 |
-
.dataframe {
|
| 22 |
-
max-width: 3000px;
|
| 23 |
-
margin: auto;
|
| 24 |
-
}
|
| 25 |
-
</style>
|
| 26 |
-
""",
|
| 27 |
-
unsafe_allow_html=True,
|
| 28 |
-
)
|
| 29 |
-
###############################################################################################
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
# code
|
| 33 |
-
uploaded_file = st.file_uploader("Choose a CV file", "pdf")
|
| 34 |
-
number_of_jobs = st.number_input("Number of Jobs", min_value=1, step=1, max_value=2000)
|
| 35 |
-
submit = st.button("get jobs")
|
| 36 |
-
|
| 37 |
-
if submit and uploaded_file and number_of_jobs:
|
| 38 |
-
st.subheader("The Most recommended jobs is
|
| 39 |
-
pdf_content = uploaded_file.read() # Read file content
|
| 40 |
-
|
| 41 |
-
pdf_text = extract_text_from_pdf(pdf_content)
|
| 42 |
-
cv_summary = generate_gemini_content(transcript_text=pdf_text)
|
| 43 |
-
data_df = git_most_similar_job(cv_summarize=cv_summary, number_of_jobs=number_of_jobs)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
st.data_editor(
|
| 48 |
-
data_df,
|
| 49 |
-
column_config={
|
| 50 |
-
"job_link": st.column_config.LinkColumn(
|
| 51 |
-
"Job Link",
|
| 52 |
-
help=f"The top {number_of_jobs} jobs links",
|
| 53 |
-
validate="^https://[a-z]+\.streamlit\.app$",
|
| 54 |
-
max_chars=1000,
|
| 55 |
-
),
|
| 56 |
-
},
|
| 57 |
-
hide_index=True,
|
| 58 |
-
)
|
| 59 |
-
st.success(f"The top {number_of_jobs} jobs")
|
| 60 |
-
|
| 61 |
-
else:
|
| 62 |
st.warning("Please upload a PDF file and add number of job .")
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from functions import extract_text_from_pdf, git_most_similar_job, generate_gemini_content
|
| 3 |
+
import os
|
| 4 |
+
|
| 5 |
+
#################### Web ############################################################
|
| 6 |
+
st.title("Jobs Suitable for each CV ")
|
| 7 |
+
|
| 8 |
+
info = """- The user uploads his CV in PDF format and passes the number of jobs he wants,
|
| 9 |
+
and we display the number of jobs most suitable for each CV from the following recruitment sites,
|
| 10 |
+
LinkedIn, Wazzaf, Indeed and Bayt"""
|
| 11 |
+
st.write(f":blue[{info}]")
|
| 12 |
+
|
| 13 |
+
note = " Note : that the jobs currently available are in the fields of programming and technology only"
|
| 14 |
+
st.write(f":red[{note}]")
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
# Set the overall layout width
|
| 18 |
+
st.markdown(
|
| 19 |
+
"""
|
| 20 |
+
<style>
|
| 21 |
+
.dataframe {
|
| 22 |
+
max-width: 3000px;
|
| 23 |
+
margin: auto;
|
| 24 |
+
}
|
| 25 |
+
</style>
|
| 26 |
+
""",
|
| 27 |
+
unsafe_allow_html=True,
|
| 28 |
+
)
|
| 29 |
+
###############################################################################################
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
# code
|
| 33 |
+
uploaded_file = st.file_uploader("Choose a CV file", "pdf")
|
| 34 |
+
number_of_jobs = st.number_input("Number of Jobs", min_value=1, step=1, max_value=2000)
|
| 35 |
+
submit = st.button("get jobs")
|
| 36 |
+
|
| 37 |
+
if submit and uploaded_file and number_of_jobs:
|
| 38 |
+
st.subheader("The Most recommended jobs is ..... ")
|
| 39 |
+
pdf_content = uploaded_file.read() # Read file content
|
| 40 |
+
|
| 41 |
+
pdf_text = extract_text_from_pdf(pdf_content)
|
| 42 |
+
cv_summary = generate_gemini_content(transcript_text=pdf_text)
|
| 43 |
+
data_df = git_most_similar_job(cv_summarize=cv_summary, number_of_jobs=number_of_jobs)
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
st.data_editor(
|
| 48 |
+
data_df,
|
| 49 |
+
column_config={
|
| 50 |
+
"job_link": st.column_config.LinkColumn(
|
| 51 |
+
"Job Link",
|
| 52 |
+
help=f"The top {number_of_jobs} jobs links",
|
| 53 |
+
validate="^https://[a-z]+\.streamlit\.app$",
|
| 54 |
+
max_chars=1000,
|
| 55 |
+
),
|
| 56 |
+
},
|
| 57 |
+
hide_index=True,
|
| 58 |
+
)
|
| 59 |
+
st.success(f"The top {number_of_jobs} jobs")
|
| 60 |
+
|
| 61 |
+
else:
|
| 62 |
st.warning("Please upload a PDF file and add number of job .")
|