Skip to content

Repository files navigation

Advanced AI Job Search System

A production-ready job search application that scrapes real jobs from LinkedIn and TimesJobs, with intelligent ranking using data structures and algorithms.

Key Features

1. Priority-Based Job Ranking with Max-Heap

  • Uses a max-heap (priority queue) to rank jobs by weighted score
  • Balances multiple factors: salary, company revenue, competition, urgency, and resume match
  • Score Formula: score = w1×salary + w2×revenue - w3×applicants + w4×urgency + w5×match
  • Efficient O(n) heap construction and O(k log n) top-k extraction

2. Fast Multi-Keyword Search

  • Trie (Prefix Tree) for instant autocomplete suggestions
  • Inverted Index for fast keyword matching across job titles, skills, and descriptions
  • Query processing in O(m×ℓ) where m = keywords, ℓ = average list size
  • Supports queries like "python remote senior" with intersection of matching jobs

3. Real Data Extraction

  • Salary Parsing: Extracts and normalizes salary values from various formats
  • Company Revenue: Database of 50+ companies with real revenue data for scoring
  • Applicant Count: Extracts or estimates competition level
  • Deadline Detection: Parses application deadlines and calculates urgency scores
  • Urgency Formula: urgency = 1 / (1 + days_left) - closer deadlines get higher priority

4. AI Resume Matching

  • Upload PDF/DOCX resumes for intelligent job matching
  • Extracts skills, experience, and education from resumes
  • Calculates match scores based on:
    • Skills overlap (40% weight)
    • Experience fit (30% weight)
    • Job title similarity (20% weight)
    • Location preference (10% weight)
  • Auto-extracts job titles from resume content

5. Real Job Scraping

  • Scrapes actual jobs from LinkedIn and TimesJobs
  • Extracts: title, company, location, salary, experience, skills, descriptions
  • Handles multiple HTML structures with fallback selectors
  • Respectful scraping with delays and proper headers

Architecture

Data Structures Used

  1. Max-Heap (Priority Queue)

    • Efficiently ranks jobs by composite score
    • Python's heapq with negated scores for max-heap behavior
  2. Trie (Prefix Tree)

    • Fast autocomplete: O(L) where L = prefix length
    • Stores job IDs at each node for quick retrieval
  3. Inverted Index

    • Maps keywords → set of job IDs
    • Enables fast multi-keyword search with set intersection
  4. Hash Maps

    • Company revenue database for O(1) lookups
    • Job cache for quick access by ID

Scoring Weights

weights = {
    'salary': 0.30,      # Higher salary = better
    'revenue': 0.25,     # Bigger company = more stable
    'applicants': 0.20,  # Fewer applicants = less competition
    'urgency': 0.15,     # Closer deadline = more urgent
    'match': 0.10        # Resume match bonus
}

Getting Started

Prerequisites

pip install requests beautifulsoup4 flask PyPDF2 python-docx scikit-learn numpy

Running the Application

  1. Web Interface (Recommended):
python simple_web_app.py

Then open http://localhost:5000 in your browser

  1. Command Line:
python simple_job_search.py
  1. Run Tests:
# Test all advanced features
python test_advanced_features.py

# Test resume parsing
python test_resume_parsing.py

# Create sample resume
python test_resume_sample.py

Usage Examples

Web Interface

  1. Basic Search: Enter job title and location
  2. Resume Upload: Drag & drop your resume for AI matching
  3. Keyword Filter: Use "python remote senior" to filter results
  4. View Rankings: Jobs are automatically ranked by priority score

Python API

from simple_job_search import SimpleJobSearch

# Initialize searcher
searcher = SimpleJobSearch()

# Search jobs
jobs = searcher.search_jobs("Python Developer", "Bangalore")

# Parse resume
resume_data = searcher.parse_resume("my_resume.pdf")

# Rank jobs with resume matching
ranked_jobs = searcher.rank_jobs_by_resume(jobs, resume_data)

# Fast keyword search
searcher.build_search_index(jobs)
filtered_jobs = searcher.fast_keyword_search("python remote")

# Get autocomplete suggestions
suggestions = searcher.trie.autocomplete("pyt")

How It Works

1. Job Search Flow

User Query → Scrape LinkedIn & TimesJobs → Extract Job Data
    ↓
Build Search Index (Trie + Inverted Index)
    ↓
Apply Keyword Filters (if any)
    ↓
Calculate Priority Scores (salary, revenue, applicants, urgency)
    ↓
Apply Resume Matching (if resume uploaded)
    ↓
Rank with Max-Heap → Return Top Jobs

2. Priority Score Calculation

For each job:

  1. Salary Score: Extract numeric value, normalize to 0-100
  2. Revenue Score: Lookup company in database, normalize with log scale
  3. Applicant Penalty: More applicants = lower score (inverted)
  4. Urgency Score: Calculate from deadline using 1/(1+days_left)
  5. Match Score: Resume similarity (if available)
  6. Weighted Sum: Combine all factors with configured weights

3. Resume Matching

  1. Parse resume (PDF/DOCX) → Extract text
  2. Extract skills using pattern matching
  3. Extract experience years and education
  4. For each job:
    • Calculate skills overlap
    • Compare experience requirements
    • Compute title similarity (TF-IDF)
    • Generate composite match score
  5. Combine with priority score for final ranking

📁 Project Structure

├── simple_job_search.py       # Core search engine with all algorithms
├── simple_web_app.py          # Flask web application
├── templates/
│   └── simple_search.html     # Web interface
├── uploads/                   # Resume storage
├── test_advanced_features.py  # Comprehensive test suite
├── test_resume_parsing.py     # Resume parsing tests
├── test_resume_sample.py      # Sample resume generator
└── README.md                  # This file

🔧 Configuration

Adjust Scoring Weights

Edit simple_job_search.py:

self.weights = {
    'salary': 0.3,      # Increase for salary-focused search
    'revenue': 0.25,    # Increase for big company preference
    'applicants': 0.2,  # Increase to avoid competitive jobs
    'urgency': 0.15,    # Increase for urgent applications
    'match': 0.1        # Increase for resume-focused search
}

Add More Companies

Add to company_revenue dictionary in simple_job_search.py:

self.company_revenue = {
    'your_company': 50000,  # Revenue in millions USD
    # ... more companies
}

Algorithms & Complexity

Feature Data Structure Time Complexity Space Complexity
Priority Ranking Max-Heap O(n) build, O(k log n) extract O(n)
Autocomplete Trie O(L) where L = prefix length O(N×M) where N = words, M = avg length
Keyword Search Inverted Index O(m×ℓ) where m = keywords, ℓ = list size O(N×K) where K = unique words
Resume Matching TF-IDF + Cosine O(n×d) where d = vocabulary size O(n×d)

Why This Approach?

Real-World Applicability

  1. No Mock Data: Uses actual job postings from real websites
  2. Production Patterns: Implements data structures used by real job platforms
  3. Scalable Design: Efficient algorithms that work with large datasets
  4. Practical Scoring: Balances multiple real factors (not just keyword matching)

Engineering Best Practices

  • Modular Code: Separate concerns (scraping, ranking, matching)
  • Error Handling: Graceful fallbacks when scraping fails
  • Type Hints: Clear function signatures
  • Documentation: Comprehensive comments and docstrings
  • Testing: Full test suite covering all features

Future Enhancements

  • Database integration (PostgreSQL) for job persistence
  • User accounts and saved searches
  • Email alerts for new matching jobs
  • More job sources (Indeed, Naukri, etc.)
  • Advanced NLP with transformers for better matching
  • Job application tracking
  • Salary prediction ML model
  • Company reviews integration

License

This project is for educational purposes. Respect website terms of service when scraping.

Contributing

This is a demonstration project showing real software engineering techniques. Feel free to learn from and adapt the code!

Key Takeaways

This project demonstrates:

  • Real data structures (Heap, Trie, Inverted Index) in production
  • Practical algorithms for ranking and search
  • Web scraping with error handling
  • Machine learning for text similarity
  • Clean, maintainable code architecture
  • Full-stack development (Python backend + HTML/JS frontend)

Built to be actually useful, not just a portfolio piece! 🎯

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages