Update app.py
Browse files
app.py
CHANGED
|
@@ -18,10 +18,10 @@ Your goal is to analyze resumes, identify missing keywords, rate resumes,
|
|
| 18 |
and suggest better skills to highlight.
|
| 19 |
|
| 20 |
### Response Format:
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
"""
|
| 26 |
|
| 27 |
# Function to Extract Text from PDF
|
|
@@ -63,17 +63,31 @@ if uploaded_file is not None:
|
|
| 63 |
stream=True,
|
| 64 |
)
|
| 65 |
|
| 66 |
-
# Stream response
|
| 67 |
st.subheader("π‘ Resume Analysis")
|
| 68 |
full_response = ""
|
| 69 |
for chunk in completion:
|
| 70 |
chunk_text = chunk.choices[0].delta.content or ""
|
| 71 |
full_response += chunk_text
|
| 72 |
-
st.write(chunk_text)
|
| 73 |
|
| 74 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
st.success("β
Resume analyzed successfully!")
|
| 76 |
else:
|
| 77 |
st.error("β οΈ No readable text found in the PDF. Please upload a valid resume.")
|
| 78 |
-
|
| 79 |
-
|
|
|
|
| 18 |
and suggest better skills to highlight.
|
| 19 |
|
| 20 |
### Response Format:
|
| 21 |
+
**π Resume Rating:** _(Score out of 10)_
|
| 22 |
+
**π Missing Keywords:** _(Comma-separated list)_
|
| 23 |
+
**π Suggested Skills:** _(Bullet points)_
|
| 24 |
+
**π‘ Expert Improvement Tips:** _(Clear and actionable advice)_
|
| 25 |
"""
|
| 26 |
|
| 27 |
# Function to Extract Text from PDF
|
|
|
|
| 63 |
stream=True,
|
| 64 |
)
|
| 65 |
|
| 66 |
+
# Stream response and format correctly
|
| 67 |
st.subheader("π‘ Resume Analysis")
|
| 68 |
full_response = ""
|
| 69 |
for chunk in completion:
|
| 70 |
chunk_text = chunk.choices[0].delta.content or ""
|
| 71 |
full_response += chunk_text
|
|
|
|
| 72 |
|
| 73 |
+
# Format Response
|
| 74 |
+
st.markdown("### **π Resume Rating**")
|
| 75 |
+
rating_part = full_response.split("**π Missing Keywords:**")[0].replace("**π Resume Rating:**", "").strip()
|
| 76 |
+
st.markdown(f"β
**Rating:** {rating_part}")
|
| 77 |
+
|
| 78 |
+
st.markdown("### **π Missing Keywords**")
|
| 79 |
+
missing_keywords_part = full_response.split("**π Missing Keywords:**")[1].split("**π Suggested Skills:**")[0].strip()
|
| 80 |
+
st.markdown(f"πΉ {missing_keywords_part}")
|
| 81 |
+
|
| 82 |
+
st.markdown("### **π Suggested Skills**")
|
| 83 |
+
suggested_skills_part = full_response.split("**π Suggested Skills:**")[1].split("**π‘ Expert Improvement Tips:**")[0].strip()
|
| 84 |
+
st.markdown(f"πΈ {suggested_skills_part.replace('-', 'πΉ')}") # Convert hyphens to bullet points
|
| 85 |
+
|
| 86 |
+
st.markdown("### **π‘ Expert Improvement Tips**")
|
| 87 |
+
improvement_tips_part = full_response.split("**π‘ Expert Improvement Tips:**")[1].strip()
|
| 88 |
+
st.markdown(f"π {improvement_tips_part.replace('-', 'π')}") # Convert hyphens to bullet points
|
| 89 |
+
|
| 90 |
+
# Display success message
|
| 91 |
st.success("β
Resume analyzed successfully!")
|
| 92 |
else:
|
| 93 |
st.error("β οΈ No readable text found in the PDF. Please upload a valid resume.")
|
|
|
|
|
|