File size: 2,834 Bytes
26df75f
3d2c185
 
 
 
 
 
 
 
26df75f
 
 
9237514
26df75f
 
3d2c185
26df75f
3d2c185
 
 
 
26df75f
 
 
9237514
3d2c185
 
9237514
3d2c185
 
 
 
 
 
 
 
26df75f
 
 
9237514
3d2c185
 
9237514
3d2c185
 
 
 
 
 
 
 
26df75f
 
 
9237514
3d2c185
 
9237514
3d2c185
 
 
 
 
 
 
 
26df75f
 
 
9237514
3d2c185
 
9237514
3d2c185
 
 
 
 
 
 
 
 
 
 
 
 
26df75f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import streamlit as st
from dotenv import load_dotenv
from langchain_google_genai import GoogleGenerativeAI
from langchain_core.prompts import PromptTemplate
from langchain_core.output_parsers import JsonOutputParser
from langchain_core.runnables import RunnableParallel

load_dotenv()

st.set_page_config(page_title="Job Application Intelligence", page_icon="🧠", layout="centered")
st.title("🧠 Job Application Intelligence System")
st.caption("Resume vs Job Description – Parallel AI Brain")

# 1. LLM
llm = GoogleGenerativeAI(model="gemini-2.5-flash", temperature=0.2)

# 2. Prompts
match_prompt = PromptTemplate.from_template("""
You are an ATS system.
Given Resume and Job Description, calculate skill match percentage (0-100).
Return ONLY JSON:
{{
  "match_percentage": number
}}

Resume:
{resume}

Job Description:
{jd}
""")

missing_prompt = PromptTemplate.from_template("""
You are a recruiter.
Find missing skills from resume compared to job description.
Return ONLY JSON:
{{
  "missing_skills": [ "skill1", "skill2" ]
}}

Resume:
{resume}

Job Description:
{jd}
""")

improve_prompt = PromptTemplate.from_template("""
You are a career coach.
Suggest improvements to the resume for this job.
Return ONLY JSON:
{{
  "improvement_suggestions": [ "point1", "point2" ]
}}

Resume:
{resume}

Job Description:
{jd}
""")

cover_prompt = PromptTemplate.from_template("""
You are an HR professional.
Write a short 3-line professional cover note for this job.
Return ONLY JSON:
{{
  "cover_note": "3 lines cover note"
}}

Resume:
{resume}

Job Description:
{jd}
""")

parser = JsonOutputParser()

parallel_chain = RunnableParallel({
    "match": match_prompt | llm | parser,
    "missing": missing_prompt | llm | parser,
    "improve": improve_prompt | llm | parser,
    "cover": cover_prompt | llm | parser,
})

# UI Inputs
resume_text = st.text_area("πŸ“„ Paste your Resume", height=180)
jd_text = st.text_area("πŸ“Œ Paste Job Description", height=180)

if st.button("Analyze Resume vs JD πŸš€"):
    if not resume_text.strip() or not jd_text.strip():
        st.warning("Please provide both Resume and Job Description.")
    else:
        with st.spinner("Analyzing with Parallel AI Brain..."):
            result = parallel_chain.invoke({
                "resume": resume_text,
                "jd": jd_text
            })

        st.subheader("πŸ“Š Results")

        st.metric("Match Percentage", f"{result['match']['match_percentage']}%")

        st.markdown("### ❌ Missing Skills")
        st.write(result["missing"]["missing_skills"])

        st.markdown("### ✍️ Improvement Suggestions")
        for i, point in enumerate(result["improve"]["improvement_suggestions"], 1):
            st.write(f"{i}. {point}")

        st.markdown("### πŸ“¨ Custom Cover Note")
        st.info(result["cover"]["cover_note"])