Update app.py
Browse files
app.py
CHANGED
|
@@ -35,30 +35,28 @@ st.markdown("<style>#fc1{font-size: 20px !important;}</style>", unsafe_allow_htm
|
|
| 35 |
jd = st.text_area("Paste the Job Description:", height=150)
|
| 36 |
resume = st.text_area("Paste Your the Resume:", height=150)
|
| 37 |
|
| 38 |
-
|
| 39 |
if st.button("GET MATCH SCORE & WORD CLOUD"):
|
| 40 |
if jd and resume:
|
| 41 |
-
jp=kp.get_key_phrases(jd)
|
| 42 |
-
rp=kp.get_key_phrases(resume)
|
| 43 |
|
| 44 |
# Generate word clouds for JD and Resume
|
| 45 |
generate_wordcloud(' '.join(jp), 'Word Cloud for Job Description Keywords')
|
| 46 |
generate_wordcloud(' '.join(rp), 'Word Cloud for Resume Keywords')
|
| 47 |
-
|
| 48 |
score = calculate_similarity(model, jd, resume)
|
| 49 |
# st.write(f"The match score is: {score}", )
|
| 50 |
# Display the match score as a percentage
|
| 51 |
score_percentage = f"{score * 100:.0f}%"
|
| 52 |
-
|
| 53 |
st.write("The match score is:")
|
| 54 |
st.write(score_percentage, key='match_score')
|
| 55 |
-
|
| 56 |
else:
|
| 57 |
st.write("Please enter both the job description and resume.", )
|
| 58 |
-
|
| 59 |
if st.button("GET KEYWORDS"):
|
| 60 |
if jd and resume:
|
| 61 |
-
|
| 62 |
jp = kp.get_key_phrases(jd)
|
| 63 |
rp = kp.get_key_phrases(resume)
|
| 64 |
|
|
@@ -66,16 +64,24 @@ if st.button("GET KEYWORDS"):
|
|
| 66 |
missing_keywords = set(jp) - set(rp)
|
| 67 |
matching_keywords = set(jp) & set(rp)
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
# Display keywords in a table
|
| 70 |
keywords_table_data = {
|
| 71 |
'Keywords From Job Description': jp,
|
| 72 |
'Keywords From Resume': rp,
|
| 73 |
-
'Matching Keywords':
|
| 74 |
-
'Missing Keywords':
|
| 75 |
}
|
| 76 |
|
| 77 |
st.write("Keywords Overview:")
|
| 78 |
st.table(pd.DataFrame(keywords_table_data))
|
| 79 |
|
| 80 |
else:
|
| 81 |
-
st.write("Please enter both the job description and resume.", )
|
|
|
|
| 35 |
jd = st.text_area("Paste the Job Description:", height=150)
|
| 36 |
resume = st.text_area("Paste Your the Resume:", height=150)
|
| 37 |
|
|
|
|
| 38 |
if st.button("GET MATCH SCORE & WORD CLOUD"):
|
| 39 |
if jd and resume:
|
| 40 |
+
jp = kp.get_key_phrases(jd)
|
| 41 |
+
rp = kp.get_key_phrases(resume)
|
| 42 |
|
| 43 |
# Generate word clouds for JD and Resume
|
| 44 |
generate_wordcloud(' '.join(jp), 'Word Cloud for Job Description Keywords')
|
| 45 |
generate_wordcloud(' '.join(rp), 'Word Cloud for Resume Keywords')
|
| 46 |
+
|
| 47 |
score = calculate_similarity(model, jd, resume)
|
| 48 |
# st.write(f"The match score is: {score}", )
|
| 49 |
# Display the match score as a percentage
|
| 50 |
score_percentage = f"{score * 100:.0f}%"
|
| 51 |
+
|
| 52 |
st.write("The match score is:")
|
| 53 |
st.write(score_percentage, key='match_score')
|
| 54 |
+
|
| 55 |
else:
|
| 56 |
st.write("Please enter both the job description and resume.", )
|
| 57 |
+
|
| 58 |
if st.button("GET KEYWORDS"):
|
| 59 |
if jd and resume:
|
|
|
|
| 60 |
jp = kp.get_key_phrases(jd)
|
| 61 |
rp = kp.get_key_phrases(resume)
|
| 62 |
|
|
|
|
| 64 |
missing_keywords = set(jp) - set(rp)
|
| 65 |
matching_keywords = set(jp) & set(rp)
|
| 66 |
|
| 67 |
+
# Make sure all arrays have the same length
|
| 68 |
+
max_length = max(len(jp), len(rp), len(matching_keywords), len(missing_keywords))
|
| 69 |
+
|
| 70 |
+
jp += [''] * (max_length - len(jp))
|
| 71 |
+
rp += [''] * (max_length - len(rp))
|
| 72 |
+
matching_keywords = list(matching_keywords) + [''] * (max_length - len(matching_keywords))
|
| 73 |
+
missing_keywords = list(missing_keywords) + [''] * (max_length - len(missing_keywords))
|
| 74 |
+
|
| 75 |
# Display keywords in a table
|
| 76 |
keywords_table_data = {
|
| 77 |
'Keywords From Job Description': jp,
|
| 78 |
'Keywords From Resume': rp,
|
| 79 |
+
'Matching Keywords': matching_keywords,
|
| 80 |
+
'Missing Keywords': missing_keywords
|
| 81 |
}
|
| 82 |
|
| 83 |
st.write("Keywords Overview:")
|
| 84 |
st.table(pd.DataFrame(keywords_table_data))
|
| 85 |
|
| 86 |
else:
|
| 87 |
+
st.write("Please enter both the job description and resume.", )
|