Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
|
| 4 |
+
from utils import extract_text_from_pdf
|
| 5 |
+
from extractor import extract_entities, extract_experience_years
|
| 6 |
+
from recommender import (
|
| 7 |
+
score_skills,
|
| 8 |
+
classify_field,
|
| 9 |
+
recommend_countries,
|
| 10 |
+
recommend_certifications,
|
| 11 |
+
recommend_education,
|
| 12 |
+
generate_roadmap,
|
| 13 |
+
)
|
| 14 |
+
|
| 15 |
+
# Load data
|
| 16 |
+
skills_df = pd.read_csv("data/skills_dataset.csv")
|
| 17 |
+
countries_df = pd.read_csv("data/countries_dataset.csv")
|
| 18 |
+
cert_df = pd.read_csv("data/certifications.csv")
|
| 19 |
+
edu_tech_df = pd.read_csv("data/education_technical.csv")
|
| 20 |
+
edu_non_tech_df = pd.read_csv("data/education_non_technical.csv")
|
| 21 |
+
scholarship_df = pd.read_csv("data/scholarships.csv") # Optional
|
| 22 |
+
|
| 23 |
+
st.set_page_config(page_title="Skill Scoring App", layout="wide")
|
| 24 |
+
st.title("📊 Personalized Skill Scoring & Career Roadmap App")
|
| 25 |
+
|
| 26 |
+
uploaded_file = st.file_uploader("📤 Upload your CV (PDF)", type=["pdf"])
|
| 27 |
+
age = st.number_input("Enter your age (if not in CV)", min_value=16, max_value=70)
|
| 28 |
+
|
| 29 |
+
if uploaded_file:
|
| 30 |
+
with st.spinner("Processing your CV..."):
|
| 31 |
+
text = extract_text_from_pdf(uploaded_file)
|
| 32 |
+
skills, background = extract_entities(text, skills_df)
|
| 33 |
+
years_exp = extract_experience_years(text)
|
| 34 |
+
score = score_skills(skills, skills_df)
|
| 35 |
+
field = classify_field(text, ["Engineering", "Medical", "IT", "Finance", "Labor", "HVAC"])
|
| 36 |
+
countries = recommend_countries(skills, countries_df)
|
| 37 |
+
certs = recommend_certifications(skills, cert_df)
|
| 38 |
+
edu = recommend_education(background, edu_tech_df, edu_non_tech_df)
|
| 39 |
+
roadmap = generate_roadmap(
|
| 40 |
+
{"years_experience": years_exp}, field, score, countries, certs, scholarship_df
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
+
st.subheader("✅ Extracted Skills")
|
| 44 |
+
st.write(skills or "No skills found.")
|
| 45 |
+
|
| 46 |
+
st.subheader("📈 Score & Field")
|
| 47 |
+
st.metric("Skill Score", f"{score}/100")
|
| 48 |
+
st.write(f"**Field Classification:** {field}")
|
| 49 |
+
|
| 50 |
+
st.subheader("🗺️ Roadmap")
|
| 51 |
+
st.markdown(roadmap, unsafe_allow_html=True)
|
| 52 |
+
|
| 53 |
+
else:
|
| 54 |
+
st.info("Please upload your CV to get started.")
|