root commited on
Commit
e84a893
·
1 Parent(s): c1efc08
Files changed (4) hide show
  1. README.md +65 -7
  2. app.py +154 -58
  3. fix_dependencies.py +42 -0
  4. requirements.txt +10 -12
README.md CHANGED
@@ -12,16 +12,74 @@ license: mit
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
 
 
12
 
13
  # Resume Screener and Skill Extractor
14
 
15
+ A comprehensive application for analyzing resumes, matching them to job positions, and providing personalized career advice.
16
 
17
  ## Features
18
 
19
+ - **Skill Extraction**: Identifies relevant skills for specific job positions
20
+ - **Resume Summarization**: Generates concise summaries of candidate backgrounds
21
+ - **Skill Gap Analysis**: Identifies missing skills for target roles
22
+ - **Career Advice**: Provides personalized recommendations for skill development and projects
23
+ - **Experience Analysis**: Analyzes work history and career progression
24
+ - **Fraud Detection**: Flags potential inconsistencies for verification
25
+
26
+ ## Installation
27
+
28
+ ### Fix Dependencies (Recommended)
29
+
30
+ If you encounter any dependency issues, run the dependency fixer script:
31
+
32
+ ```bash
33
+ python fix_dependencies.py
34
+ ```
35
+
36
+ This will install compatible versions of all required packages.
37
+
38
+ ### Manual Installation
39
+
40
+ Alternatively, you can install the dependencies manually:
41
+
42
+ ```bash
43
+ pip install -r requirements.txt
44
+ python -m spacy download en_core_web_sm
45
+ python -c "import nltk; nltk.download('punkt')"
46
+ ```
47
+
48
+ ## Common Issues and Solutions
49
+
50
+ ### ImportError: cannot import name 'cached_download' from 'huggingface_hub'
51
+
52
+ This occurs due to version incompatibility between huggingface_hub and sentence_transformers. To fix:
53
+
54
+ 1. Run the dependency fixer script: `python fix_dependencies.py`
55
+ 2. Or manually install compatible versions: `pip install huggingface-hub==0.14.1 sentence-transformers==2.2.2`
56
+
57
+ ## Running the Application
58
+
59
+ ```bash
60
+ streamlit run app.py
61
+ ```
62
+
63
+ ## Usage
64
+
65
+ 1. Upload a resume in PDF format
66
+ 2. Select a target job position
67
+ 3. Review the analysis results in the different tabs
68
+ 4. Click "Generate Personalized Career Advice" to get recommendations
69
+
70
+ ## Dependencies
71
+
72
+ - streamlit
73
+ - pdfplumber
74
+ - spacy
75
+ - transformers
76
+ - sentence-transformers
77
+ - torch
78
+ - nltk
79
+ - plotly
80
+ - pandas
81
+ - numpy
82
+ - matplotlib
83
 
84
  ## Supported Job Positions
85
 
app.py CHANGED
@@ -5,7 +5,7 @@ import spacy
5
  import re
6
  import pandas as pd
7
  import matplotlib.pyplot as plt
8
- from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
9
  from sentence_transformers import SentenceTransformer, util
10
  import subprocess
11
  import sys
@@ -18,6 +18,18 @@ import plotly.graph_objects as go
18
  import numpy as np
19
  from collections import defaultdict
20
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  # Initialize NLTK
22
  @st.cache_resource
23
  def download_nltk_resources():
@@ -57,24 +69,10 @@ def load_models():
57
  st.error(f"Failed to load sentence transformer: {str(e)}")
58
  sentence_model = None
59
 
60
- # Load Qwen3-8B model for career advice
61
- try:
62
- device = "cuda" if torch.cuda.is_available() else "cpu"
63
- qwen_tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-8B")
64
- qwen_model = AutoModelForCausalLM.from_pretrained(
65
- "Qwen/Qwen3-8B",
66
- torch_dtype=torch.float16 if device == "cuda" else torch.float32,
67
- device_map="auto"
68
- )
69
- except Exception as e:
70
- st.error(f"Failed to load Qwen3-8B model: {str(e)}")
71
- qwen_tokenizer = None
72
- qwen_model = None
73
-
74
- return summarizer, nlp, sentence_model, qwen_tokenizer, qwen_model
75
 
76
  # Initialize models
77
- summarizer, nlp, sentence_model, qwen_tokenizer, qwen_model = load_models()
78
 
79
  # Job descriptions and required skills
80
  job_descriptions = {
@@ -483,56 +481,154 @@ def analyze_resume(text, job_title, sentence_model):
483
  "semantic_score": semantic_score
484
  }
485
 
486
- def generate_career_advice(resume_text, job_title, analysis_results):
487
- if qwen_model is None or qwen_tokenizer is None:
488
- return "Career advice model not available. Please check the model installation."
489
-
490
- # Get missing skills
491
- missing_skills = [skill for skill in job_descriptions[job_title]["skills"]
492
- if skill not in analysis_results["found_skills"]]
 
 
 
 
 
 
493
 
494
- # Create a prompt for the model
495
- prompt = f"""
496
- You are a professional career advisor. Based on the resume and the target job position,
497
- provide personalized advice on skills to develop and suggest projects that would help the candidate
498
- become a better fit for the position.
 
 
499
 
500
- Resume summary: {analysis_results["summary"]}
 
 
 
 
 
501
 
502
- Target position: {job_title}
 
 
 
 
 
503
 
504
- Job requirements: {job_descriptions[job_title]["description"]}
 
 
 
 
 
505
 
506
- Skills the candidate has: {', '.join([f"{skill} ({analysis_results['skill_proficiencies'].get(skill, 'Basic')})" for skill in analysis_results["found_skills"]])}
 
 
 
 
 
 
 
 
 
 
 
 
507
 
508
- Skills the candidate needs to develop: {', '.join(missing_skills)}
 
 
 
 
 
509
 
510
- Current experience: {analysis_results["years_experience"]} years
511
- Current seniority level: {analysis_results["seniority_score"]}/10
512
- Potential next career moves: {', '.join(analysis_results["next_roles"])}
 
 
 
513
 
514
- Provide the following:
515
- 1. Specific advice on how to develop the missing skills
516
- 2. 3-5 project ideas that would showcase these skills and align with the candidate's career trajectory
517
- 3. Resources for learning (courses, books, websites)
518
- 4. Suggestions on how to position existing experience for this role
519
  """
 
 
 
 
 
520
 
521
- # Generate advice using Qwen3-8B
522
- try:
523
- inputs = qwen_tokenizer(prompt, return_tensors="pt").to(qwen_model.device)
524
- with torch.no_grad():
525
- outputs = qwen_model.generate(
526
- **inputs,
527
- max_new_tokens=1024,
528
- temperature=0.7,
529
- top_p=0.9,
530
- do_sample=True
531
- )
532
- advice = qwen_tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
533
- return advice
534
- except Exception as e:
535
- return f"Failed to generate career advice: {str(e)}"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
536
 
537
  # Streamlit UI
538
  st.title("📄 Comprehensive Resume Analyzer")
@@ -928,7 +1024,7 @@ if uploaded_file and job_title:
928
 
929
  if st.button("Generate Personalized Career Advice"):
930
  with st.spinner("Generating detailed career advice and development plan..."):
931
- advice = generate_career_advice(text, job_title, analysis_results)
932
  st.markdown(advice)
933
 
934
  except Exception as e:
 
5
  import re
6
  import pandas as pd
7
  import matplotlib.pyplot as plt
8
+ from transformers import pipeline
9
  from sentence_transformers import SentenceTransformer, util
10
  import subprocess
11
  import sys
 
18
  import numpy as np
19
  from collections import defaultdict
20
 
21
+ # Fix for huggingface_hub import issue
22
+ try:
23
+ # For newer versions of huggingface_hub
24
+ from huggingface_hub import hf_hub_download
25
+ except ImportError:
26
+ try:
27
+ # For older versions of huggingface_hub
28
+ from huggingface_hub import cached_download as hf_hub_download
29
+ except ImportError:
30
+ st.error("Could not import required functions from huggingface_hub. Please check your installation.")
31
+ hf_hub_download = None
32
+
33
  # Initialize NLTK
34
  @st.cache_resource
35
  def download_nltk_resources():
 
69
  st.error(f"Failed to load sentence transformer: {str(e)}")
70
  sentence_model = None
71
 
72
+ return summarizer, nlp, sentence_model
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
  # Initialize models
75
+ summarizer, nlp, sentence_model = load_models()
76
 
77
  # Job descriptions and required skills
78
  job_descriptions = {
 
481
  "semantic_score": semantic_score
482
  }
483
 
484
+ def generate_career_advice(resume_text, job_title, found_skills, missing_skills):
485
+ """
486
+ Generate career advice using a template-based approach instead of Qwen3-8B
487
+ to avoid dependency issues
488
+ """
489
+ # Template-based advice generation
490
+ advice = f"""## Career Development Plan for {job_title} Position
491
+
492
+ ### Skills to Develop
493
+
494
+ The following skills would strengthen your resume for this position:
495
+
496
+ """
497
 
498
+ # Add advice for each missing skill
499
+ for skill in missing_skills:
500
+ if skill == "python":
501
+ advice += f"""#### Python
502
+ - **How to develop**: Take online courses focused on Python for {job_title.lower()} applications
503
+ - **Project idea**: Build a data analysis tool or web application using Python and popular frameworks
504
+ - **Resources**: Coursera's Python for Everybody, Python.org tutorials, Real Python website
505
 
506
+ """
507
+ elif skill == "java":
508
+ advice += f"""#### Java
509
+ - **How to develop**: Complete a comprehensive Java course with practical exercises
510
+ - **Project idea**: Develop a backend service with Spring Boot
511
+ - **Resources**: Oracle's Java tutorials, Udemy courses on Java, "Effective Java" by Joshua Bloch
512
 
513
+ """
514
+ elif skill == "javascript":
515
+ advice += f"""#### JavaScript
516
+ - **How to develop**: Practice with modern JavaScript frameworks
517
+ - **Project idea**: Create an interactive web application with React or Vue.js
518
+ - **Resources**: MDN Web Docs, freeCodeCamp, "Eloquent JavaScript" by Marijn Haverbeke
519
 
520
+ """
521
+ elif skill == "sql":
522
+ advice += f"""#### SQL
523
+ - **How to develop**: Practice with database design and complex queries
524
+ - **Project idea**: Design a database system for a small business with reports and analytics
525
+ - **Resources**: SQLZoo, Mode Analytics SQL tutorial, W3Schools SQL course
526
 
527
+ """
528
+ elif "algorithms" in skill or "data structures" in skill:
529
+ advice += f"""#### Algorithms & Data Structures
530
+ - **How to develop**: Solve coding problems regularly on platforms like LeetCode
531
+ - **Project idea**: Implement classic algorithms and optimize them for specific use cases
532
+ - **Resources**: "Cracking the Coding Interview" book, AlgoExpert, Coursera Algorithms specialization
533
+
534
+ """
535
+ elif "git" in skill:
536
+ advice += f"""#### Git & Version Control
537
+ - **How to develop**: Contribute to open source projects to practice Git workflows
538
+ - **Project idea**: Set up a personal project with proper branching strategies and CI/CD
539
+ - **Resources**: Git documentation, GitHub Learning Lab, Atlassian Git tutorials
540
 
541
+ """
542
+ elif "cloud" in skill:
543
+ advice += f"""#### Cloud Technologies
544
+ - **How to develop**: Get hands-on experience with a major cloud provider (AWS, Azure, GCP)
545
+ - **Project idea**: Deploy an application to the cloud with proper infrastructure as code
546
+ - **Resources**: Cloud provider documentation, A Cloud Guru courses, free tier accounts
547
 
548
+ """
549
+ elif "ui" in skill or "ux" in skill:
550
+ advice += f"""#### UI/UX Design
551
+ - **How to develop**: Study design principles and practice creating user interfaces
552
+ - **Project idea**: Redesign an existing website or app with focus on user experience
553
+ - **Resources**: Nielsen Norman Group articles, Interaction Design Foundation, Figma tutorials
554
 
 
 
 
 
 
555
  """
556
+ elif "machine learning" in skill:
557
+ advice += f"""#### Machine Learning
558
+ - **How to develop**: Take courses on ML fundamentals and practice with datasets
559
+ - **Project idea**: Build a predictive model to solve a real-world problem
560
+ - **Resources**: Andrew Ng's Coursera courses, Kaggle competitions, "Hands-On Machine Learning" book
561
 
562
+ """
563
+ elif "data analysis" in skill:
564
+ advice += f"""#### Data Analysis
565
+ - **How to develop**: Practice analyzing datasets and creating visualizations
566
+ - **Project idea**: Perform an exploratory data analysis on a public dataset
567
+ - **Resources**: DataCamp courses, Kaggle datasets, "Python for Data Analysis" by Wes McKinney
568
+
569
+ """
570
+ else:
571
+ advice += f"""#### {skill.title()}
572
+ - **How to develop**: Research industry best practices and take relevant courses
573
+ - **Project idea**: Create a portfolio piece that showcases this skill
574
+ - **Resources**: Online courses, industry blogs, and practice projects
575
+
576
+ """
577
+
578
+ # Add project recommendations based on job title
579
+ advice += f"""
580
+ ### Recommended Projects for {job_title}
581
+
582
+ Based on the target position and the skills needed, here are some project ideas:
583
+
584
+ """
585
+ if job_title == "Software Engineer":
586
+ advice += """
587
+ 1. **Full-Stack Web Application**: Build a complete web app with frontend, backend, and database
588
+ 2. **API Service**: Create a RESTful or GraphQL API with proper authentication and documentation
589
+ 3. **Mobile Application**: Develop a cross-platform mobile app using React Native or Flutter
590
+ 4. **Automation Tools**: Build scripts or applications that automate repetitive tasks
591
+ 5. **Contribution to Open Source**: Find a project aligned with your skills and contribute meaningfully
592
+
593
+ """
594
+ elif job_title == "Interaction Designer":
595
+ advice += """
596
+ 1. **Design System**: Create a comprehensive design system with components and usage guidelines
597
+ 2. **Website Redesign**: Redesign an existing website with focus on improved UX
598
+ 3. **Mobile App Prototype**: Design a fully interactive mobile app prototype
599
+ 4. **User Research Project**: Conduct user research and create a report with insights and recommendations
600
+ 5. **Design Case Study**: Document your design process for solving a specific problem
601
+
602
+ """
603
+ elif job_title == "Data Scientist":
604
+ advice += """
605
+ 1. **Predictive Model**: Build a machine learning model that solves a real-world problem
606
+ 2. **Data Visualization Dashboard**: Create an interactive dashboard to visualize complex data
607
+ 3. **Natural Language Processing**: Develop a text analysis or sentiment analysis project
608
+ 4. **Time Series Analysis**: Analyze time-based data and build forecasting models
609
+ 5. **A/B Testing Framework**: Design and implement a framework for testing hypotheses
610
+
611
+ """
612
+
613
+ # General advice for all positions
614
+ advice += """
615
+ ### Learning Resources
616
+
617
+ - **Online Platforms**: Coursera, Udemy, Pluralsight, LinkedIn Learning
618
+ - **Documentation**: Official language and framework documentation
619
+ - **Communities**: Stack Overflow, GitHub, Reddit programming communities
620
+ - **Books**: O'Reilly publications specific to your target technologies
621
+ - **YouTube Channels**: Traversy Media, Tech With Tim, freeCodeCamp
622
+
623
+ ### Positioning Your Experience
624
+
625
+ - Highlight transferable skills from your current experience
626
+ - Quantify achievements with metrics where possible
627
+ - Frame previous work in terms relevant to the target position
628
+ - Create a tailored resume that emphasizes relevant projects and responsibilities
629
+ """
630
+
631
+ return advice
632
 
633
  # Streamlit UI
634
  st.title("📄 Comprehensive Resume Analyzer")
 
1024
 
1025
  if st.button("Generate Personalized Career Advice"):
1026
  with st.spinner("Generating detailed career advice and development plan..."):
1027
+ advice = generate_career_advice(text, job_title, analysis_results["found_skills"], missing_skills)
1028
  st.markdown(advice)
1029
 
1030
  except Exception as e:
fix_dependencies.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import subprocess
2
+ import sys
3
+
4
+ def fix_dependencies():
5
+ """
6
+ Fix dependency issues by installing compatible versions of required packages
7
+ """
8
+ print("Fixing dependencies for Resume Screener application...")
9
+
10
+ # List of compatible package versions
11
+ packages = [
12
+ "streamlit==1.22.0",
13
+ "pdfplumber==0.9.0",
14
+ "spacy==3.5.0",
15
+ "transformers==4.28.1",
16
+ "torch>=1.13.1",
17
+ "huggingface-hub==0.14.1",
18
+ "sentence-transformers==2.2.2",
19
+ "nltk==3.8.1",
20
+ "plotly==5.14.1",
21
+ "pandas==1.5.3",
22
+ "numpy==1.24.3",
23
+ "matplotlib==3.7.1"
24
+ ]
25
+
26
+ # Install each package
27
+ for package in packages:
28
+ print(f"Installing {package}...")
29
+ subprocess.check_call([sys.executable, "-m", "pip", "install", package])
30
+
31
+ # Download spaCy model
32
+ print("Downloading spaCy model...")
33
+ subprocess.check_call([sys.executable, "-m", "spacy", "download", "en_core_web_sm"])
34
+
35
+ # Download NLTK data
36
+ print("Downloading NLTK data...")
37
+ subprocess.check_call([sys.executable, "-c", "import nltk; nltk.download('punkt')"])
38
+
39
+ print("Dependencies fixed successfully!")
40
+
41
+ if __name__ == "__main__":
42
+ fix_dependencies()
requirements.txt CHANGED
@@ -1,14 +1,12 @@
1
- streamlit==1.29.0
2
- pdfplumber==0.10.2
3
- spacy==3.7.2
4
- transformers==4.36.2
 
 
5
  sentence-transformers==2.2.2
6
- torch==2.1.2
7
  nltk==3.8.1
8
- pandas==2.1.4
9
- matplotlib==3.8.2
10
- plotly==5.18.0
11
- numpy==1.26.2
12
- python-docx==1.0.1
13
- huggingface-hub==0.19.4
14
- accelerate==0.25.0
 
1
+ streamlit==1.22.0
2
+ pdfplumber==0.9.0
3
+ spacy==3.5.0
4
+ transformers==4.28.1
5
+ torch>=1.13.1
6
+ huggingface-hub==0.14.1
7
  sentence-transformers==2.2.2
 
8
  nltk==3.8.1
9
+ plotly==5.14.1
10
+ pandas==1.5.3
11
+ numpy==1.24.3
12
+ matplotlib==3.7.1