root commited on
Commit
4dfdb8b
Β·
1 Parent(s): 11996bd
Files changed (2) hide show
  1. README.md +40 -5
  2. app.py +146 -2
README.md CHANGED
@@ -1,13 +1,48 @@
1
  ---
2
- title: Resume Screener And Skill Extractor
3
- emoji: πŸ†
4
- colorFrom: gray
5
- colorTo: pink
6
  sdk: streamlit
7
- sdk_version: 1.42.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
  ---
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: Resume Screener and Skill Extractor
3
+ emoji: πŸ“„
4
+ colorFrom: blue
5
+ colorTo: green
6
  sdk: streamlit
7
+ sdk_version: 1.31.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
  ---
12
 
13
+ # Resume Screener and Skill Extractor
14
+
15
+ An intelligent resume screening application that analyzes resumes and extracts relevant skills based on job positions. Built with Streamlit and Hugging Face transformers.
16
+
17
+ ## Features
18
+
19
+ - Upload PDF or DOCX resumes
20
+ - Select from multiple job positions
21
+ - Automatic skill matching with percentage score
22
+ - AI-powered resume summarization
23
+ - Skills gap analysis
24
+ - Modern, user-friendly interface
25
+
26
+ ## Supported Job Positions
27
+
28
+ - Software Engineer
29
+ - Interaction Designer
30
+ - Data Scientist
31
+
32
+ ## How it Works
33
+
34
+ 1. Upload your resume (PDF or DOCX format)
35
+ 2. Select the target job position
36
+ 3. The app will analyze your resume and provide:
37
+ - A list of matched skills with a match percentage
38
+ - An AI-generated summary of your resume
39
+ - Suggestions for skills you might want to develop
40
+
41
+ ## Technologies Used
42
+
43
+ - Streamlit for the web interface
44
+ - Hugging Face Transformers for AI-powered text summarization
45
+ - spaCy for natural language processing
46
+ - PyPDF2 and python-docx for document parsing
47
+
48
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py CHANGED
@@ -1,4 +1,148 @@
1
  import streamlit as st
2
 
3
- x = st.slider('Select a value')
4
- st.write(x, 'squared is', x * x)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
 
3
+ st.set_page_config(
4
+ page_title="Resume Screener & Skill Extractor",
5
+ page_icon="πŸ“„",
6
+ layout="wide"
7
+ )
8
+
9
+ # Load the NLP model
10
+ @st.cache_resource
11
+ def load_models():
12
+ summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
13
+ nlp = spacy.load("en_core_web_sm")
14
+ return summarizer, nlp
15
+
16
+ # Initialize models
17
+ summarizer, nlp = load_models()
18
+
19
+ # Job descriptions and required skills
20
+ job_descriptions = {
21
+ "Software Engineer": {
22
+ "skills": ["python", "java", "javascript", "sql", "algorithms", "data structures",
23
+ "git", "cloud", "web development", "software development", "coding"],
24
+ "description": "Looking for software engineers with strong programming skills and experience in software development."
25
+ },
26
+ "Interaction Designer": {
27
+ "skills": ["ui", "ux", "user research", "wireframing", "prototyping", "figma",
28
+ "sketch", "adobe", "design thinking", "interaction design"],
29
+ "description": "Seeking interaction designers with expertise in user experience and interface design."
30
+ },
31
+ "Data Scientist": {
32
+ "skills": ["python", "r", "statistics", "machine learning", "data analysis",
33
+ "sql", "tensorflow", "pytorch", "pandas", "numpy"],
34
+ "description": "Looking for data scientists with strong analytical and machine learning skills."
35
+ }
36
+ }
37
+
38
+ def extract_text_from_pdf(pdf_file):
39
+ pdf_reader = PyPDF2.PdfReader(pdf_file)
40
+ text = ""
41
+ for page in pdf_reader.pages:
42
+ text += page.extract_text()
43
+ return text
44
+
45
+ def extract_text_from_docx(docx_file):
46
+ doc = Document(docx_file)
47
+ text = ""
48
+ for paragraph in doc.paragraphs:
49
+ text += paragraph.text + "\n"
50
+ return text
51
+
52
+ def analyze_resume(text, job_title):
53
+ # Extract relevant skills
54
+ doc = nlp(text.lower())
55
+ found_skills = []
56
+ required_skills = job_descriptions[job_title]["skills"]
57
+
58
+ for skill in required_skills:
59
+ if skill in text.lower():
60
+ found_skills.append(skill)
61
+
62
+ # Generate summary
63
+ chunks = [text[i:i + 1000] for i in range(0, len(text), 1000)]
64
+ summaries = []
65
+ for chunk in chunks[:3]: # Process first 3000 characters to avoid token limits
66
+ summary = summarizer(chunk, max_length=150, min_length=50, do_sample=False)[0]["summary_text"]
67
+ summaries.append(summary)
68
+
69
+ return found_skills, " ".join(summaries)
70
+
71
+ # Streamlit UI
72
+ st.title("πŸ“„ Resume Screener & Skill Extractor")
73
+
74
+ # Add description
75
+ st.markdown("""
76
+ This app helps recruiters analyze resumes by:
77
+ - Extracting relevant skills for specific job positions
78
+ - Generating a concise summary of the candidate's background
79
+ - Identifying skill gaps for the selected role
80
+ """)
81
+
82
+ # Create two columns
83
+ col1, col2 = st.columns([2, 1])
84
+
85
+ with col1:
86
+ # File upload
87
+ uploaded_file = st.file_uploader("Upload Resume (PDF or DOCX)", type=["pdf", "docx"])
88
+
89
+ with col2:
90
+ # Job selection
91
+ job_title = st.selectbox("Select Job Position", list(job_descriptions.keys()))
92
+
93
+ # Show job description
94
+ if job_title:
95
+ st.info(f"**Required Skills:**\n" +
96
+ "\n".join([f"- {skill.title()}" for skill in job_descriptions[job_title]["skills"]]))
97
+
98
+ if uploaded_file and job_title:
99
+ try:
100
+ # Show spinner while processing
101
+ with st.spinner("Analyzing resume..."):
102
+ # Extract text based on file type
103
+ if uploaded_file.type == "application/pdf":
104
+ text = extract_text_from_pdf(uploaded_file)
105
+ else:
106
+ text = extract_text_from_docx(uploaded_file)
107
+
108
+ # Analyze resume
109
+ found_skills, summary = analyze_resume(text, job_title)
110
+
111
+ # Display results in tabs
112
+ tab1, tab2, tab3 = st.tabs(["πŸ“Š Skills Match", "πŸ“ Resume Summary", "🎯 Skills Gap"])
113
+
114
+ with tab1:
115
+ # Display matched skills
116
+ st.subheader("🎯 Matched Skills")
117
+ if found_skills:
118
+ for skill in found_skills:
119
+ st.success(f"βœ… {skill.title()}")
120
+
121
+ # Calculate match percentage
122
+ match_percentage = len(found_skills) / len(job_descriptions[job_title]["skills"]) * 100
123
+ st.metric("Skills Match", f"{match_percentage:.1f}%")
124
+ else:
125
+ st.warning("No direct skill matches found.")
126
+
127
+ with tab2:
128
+ # Display resume summary
129
+ st.subheader("πŸ“ Resume Summary")
130
+ st.write(summary)
131
+
132
+ with tab3:
133
+ # Display missing skills
134
+ st.subheader("πŸ“Œ Skills to Develop")
135
+ missing_skills = [skill for skill in job_descriptions[job_title]["skills"]
136
+ if skill not in found_skills]
137
+ if missing_skills:
138
+ for skill in missing_skills:
139
+ st.warning(f"βž– {skill.title()}")
140
+ else:
141
+ st.success("Great! The candidate has all the required skills!")
142
+
143
+ except Exception as e:
144
+ st.error(f"An error occurred while processing the resume: {str(e)}")
145
+
146
+ # Add footer
147
+ st.markdown("---")
148
+ st.markdown("Made with ❀️ using Streamlit and Hugging Face")