Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,78 +1,60 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from utils import (
|
|
|
|
| 3 |
get_skills_suggestions,
|
| 4 |
-
|
| 5 |
-
|
| 6 |
get_education_opportunities,
|
| 7 |
-
|
| 8 |
-
get_job_recommendations,
|
| 9 |
-
get_cv_score,
|
| 10 |
-
get_field_classification,
|
| 11 |
-
get_personalized_advice,
|
| 12 |
)
|
| 13 |
|
| 14 |
-
st.set_page_config(page_title="Smart CV Analyzer
|
| 15 |
|
| 16 |
-
st.title("π Universal Smart CV Analyzer &
|
| 17 |
-
st.markdown("Upload your CV and get a detailed analysis including personalized job suggestions, skill-building advice, education and visa guidance, and a tailored career roadmap.")
|
| 18 |
|
| 19 |
-
uploaded_file = st.file_uploader("Upload your CV (
|
| 20 |
|
| 21 |
if uploaded_file:
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
import PyPDF2
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
st.
|
| 45 |
-
|
| 46 |
-
st.write(
|
| 47 |
-
|
| 48 |
-
st.
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
st.markdown(f"- {edu}")
|
| 66 |
-
|
| 67 |
-
st.header("π Visa Pathways")
|
| 68 |
-
for v in visa:
|
| 69 |
-
st.markdown(f"- {v}")
|
| 70 |
-
|
| 71 |
-
st.header("πΌ Job Opportunities (USA)")
|
| 72 |
-
for job in jobs:
|
| 73 |
-
st.subheader(job.get("title", "N/A"))
|
| 74 |
-
st.markdown(f"**Company:** {job.get('company', 'Unknown')}")
|
| 75 |
-
st.markdown(f"**Location:** {job.get('location', 'Unknown')}")
|
| 76 |
-
st.markdown(f"**Description:** {job.get('description', '')[:300]}...")
|
| 77 |
-
st.markdown(f"[Apply Here]({job.get('url', '#')})")
|
| 78 |
-
st.markdown("---")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from utils import (
|
| 3 |
+
detect_cv_field,
|
| 4 |
get_skills_suggestions,
|
| 5 |
+
get_certifications,
|
| 6 |
+
get_scholarships,
|
| 7 |
get_education_opportunities,
|
| 8 |
+
get_visa_opportunities,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
)
|
| 10 |
|
| 11 |
+
st.set_page_config(page_title="Universal Smart CV Analyzer", layout="wide")
|
| 12 |
|
| 13 |
+
st.title("π Universal Smart CV Analyzer & Career Roadmap Generator")
|
|
|
|
| 14 |
|
| 15 |
+
uploaded_file = st.file_uploader("Upload your CV (TXT or PDF recommended)", type=["txt", "pdf"])
|
| 16 |
|
| 17 |
if uploaded_file:
|
| 18 |
+
file_text = uploaded_file.read()
|
| 19 |
+
try:
|
| 20 |
+
text = file_text.decode("utf-8")
|
| 21 |
+
except UnicodeDecodeError:
|
| 22 |
import PyPDF2
|
| 23 |
+
pdf_reader = PyPDF2.PdfReader(uploaded_file)
|
| 24 |
+
text = ""
|
| 25 |
+
for page in pdf_reader.pages:
|
| 26 |
+
text += page.extract_text()
|
| 27 |
+
|
| 28 |
+
st.subheader("CV Summary")
|
| 29 |
+
st.write(text[:1000] + "...")
|
| 30 |
+
|
| 31 |
+
# --- Step 1: Identify field ---
|
| 32 |
+
field = detect_cv_field(text)
|
| 33 |
+
st.success(f"π§ Detected Field: **{field.title()}**")
|
| 34 |
+
|
| 35 |
+
# --- Step 2: Personalized Suggestions ---
|
| 36 |
+
st.subheader("π§ Recommended Skill Improvements")
|
| 37 |
+
skills = get_skills_suggestions(field)
|
| 38 |
+
st.write(skills)
|
| 39 |
+
|
| 40 |
+
st.subheader("π Relevant Certifications")
|
| 41 |
+
certs = get_certifications(field)
|
| 42 |
+
st.write(certs)
|
| 43 |
+
|
| 44 |
+
st.subheader("π Scholarship Opportunities")
|
| 45 |
+
scholarships = get_scholarships(field)
|
| 46 |
+
st.write(scholarships)
|
| 47 |
+
|
| 48 |
+
st.subheader("π« Higher Education Opportunities")
|
| 49 |
+
education = get_education_opportunities(field)
|
| 50 |
+
st.write(education)
|
| 51 |
+
|
| 52 |
+
st.subheader("π Suggested Visa Pathways")
|
| 53 |
+
visa_paths = get_visa_opportunities(field)
|
| 54 |
+
st.write(visa_paths)
|
| 55 |
+
|
| 56 |
+
# --- Final Counseling Advice ---
|
| 57 |
+
st.subheader("π§βπΌ Career Counselor Advice")
|
| 58 |
+
st.markdown(f"""
|
| 59 |
+
Based on your background in **{field.title()}**, consider deepening your expertise in the top in-demand tools and seeking international opportunities through scholarships and visa-friendly countries. You may benefit from completing a few certifications like **{certs[0]}** and **{certs[1]}**. Keep your LinkedIn profile up to date and connect with professionals in this space.
|
| 60 |
+
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|