Spaces:
Running
ChatGPT
Browse filesYou said:
Ai resume classifer
ChatGPT said:
Got it 👍 You’re asking about an AI résumé classifier — basically a system that automatically classifies or ranks résumés (CVs) based on given criteria like job role, skills, or relevance.
Here’s a breakdown for you:
🔹 What an AI Résumé Classifier Does
Parses résumé text (PDF, Word, etc.) into structured data.
Extracts features like name, education, experience, skills, certifications.
Classifies or ranks candidates based on job requirements (e.g., Python developer, ML engineer).
Can be rule-based (keywords, regex, scoring) or ML-based (NLP + ML model).
🔹 Approaches
1. Rule-Based Classifier
Simple keyword matching & scoring.
Example: If job requires "Python", add +1 score if found in résumé.
Pros: Easy to implement.
Cons: Not intelligent, ignores context.
2. Machine Learning (ML)-Based
Use classification models (Logistic Regression, SVM, Random Forest).
Input: résumé text → feature vectors (TF-IDF, BERT embeddings).
Output: Job category / Relevance score.
3. Deep Learning / NLP
Use transformers (BERT, RoBERTa, DistilBERT) for semantic understanding.
Train a classifier to predict if résumé matches a job description.
More accurate than keyword-based.
🔹 Example Workflow (Python)
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import classification_report
# Sample Data: resumes with labels (job roles)
data = {
"resume_text": [
"Experienced in Python, ML, TensorFlow, Data Science projects",
"Expert in HTML, CSS, JavaScript, React, Node.js",
"Worked on cloud platforms AWS, Azure, DevOps pipelines"
],
"label": ["Data Scientist", "Web Developer", "DevOps Engineer"]
}
df = pd.DataFrame(data)
# Convert text to TF-IDF vectors
vectorizer = TfidfVectorizer(stop_words='english')
X = vectorizer.fit_transform(df['resume_text'])
y = df['label']
# Train-test split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
# Classifier
clf = LogisticRegression()
clf.fit(X_train, y_train)
# Prediction
y_pred = clf.predict(X_test)
print(classification_report(y_test, y_pred))
🔹 Enhancements
Use Spacy / NLTK to extract entities (skills, education, experience).
Apply BERT embeddings for contextual understanding.
Integrate with ATS (Applicant Tracking System) to automate filtering.
👉 Do you want me to build you a full working Python project (resume classifier with dataset + preprocessing + model training), or just a basic template code you can expand?
You said:
i want to user input in this model
ChatGPT said:
Perfect 👍 You want the AI résumé classifier to take user input (like pasting or uploading a résumé text) and then classify it into a job category.
Let’s extend the earlier code so it works with user input:
🔹 Python Example: User Input Classifier
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
# ====== Step 1: Sample Training Data ======
data = {
"resume_text": [
"Experienced in Python, ML, TensorFlow, Data Science projects",
"Expert in HTML, CSS, JavaScript, React, Node.js",
"Worked on cloud platforms AWS, Azure, DevOps pipelines",
"Skilled in Java, Spring Boot, Microservices, REST APIs",
"Good knowledge of SQL, MySQL, Database Administration"
],
"label": ["Data Scientist", "Web Developer", "DevOps Engineer", "Backend Developer", "Database Admin"]
}
df = pd.DataFrame(data)
# ====== Step 2: Vectorize ======
vectorizer = TfidfVectorizer(stop_words='english')
X = vectorizer.fit_transform(df['resume_text'])
y = df['label']
# ====== Step 3: Train Classifier ======
clf = LogisticRegression()
clf.fit(X, y)
# ====== Step 4: User Input ======
while True:
user_resume = input("\nPaste your resume text (or type 'exit' to quit):\n")
if user_resume.lower() == "exit":
break
# Convert input into vector
user_vec = vectorizer.transform([user_resume])
# Predict job role
prediction = clf.predict(user_vec)[0]
print(f"\n🔍 Predicted Job Category: {prediction}\n")
🔹 Example Run
Paste your resume text:
I have worked on CNN models, Python, TensorFlow, and machine learning.
🔍 Predicted Job Category: Data Scientist
🔹 Next Steps You Can Add
File Upload Support – read from .txt or .pdf résumé.
Web App – wrap this in Flask/Django/Streamlit for a GUI.
BERT Embeddings – replace TF-IDF with Hugging Face models for higher accuracy.
👉 Do you want me to show you how to extend this so users can upload a PDF/Word résumé file instead of just typing text?
You said:
Uploaded image
to build a application for this model
ChatGPT said:
Great 👍 Thanks for sharing the assignment statement.
You need to build an AI Resume Classifier application that:
Accepts resumes in Text or PDF format.
Extracts skills from the resume.
Classifies the resume into categories:
Web Developer
Data Analyst
AI/ML
Core Engineer
Highlights Top 3 Skills for each student.
Uses ML/NLP for automation.
🔹 Tech Stack Suggestion
Backend: Python (Flask / FastAPI / Streamlit for simplicity).
Libraries:
PyPDF2 or pdfplumber → extract text from PDF.
NLTK / spaCy → extract skills.
scikit-learn → classification model (TF-IDF + Logistic Regression).
Frontend:
Streamlit (easiest – instant web UI).
Or Flask + HTML (custom web app).
🔹 Step-by-Step Implementation Plan
1. Data Preprocessing
Collect sample resumes (or text snippets).
Label them into categories (Web Developer, Data Analyst, AI/ML, Core Engineer).
2. Skill Extraction
Use keyword matching from a skills dictionary.
Or use NER with spaCy (en_core_web_sm) to extract entities like "Python", "SQL", "TensorFlow".
3. Classification
Convert text to TF-IDF embeddings.
Train a classifier (LogisticRegression or RandomForest).
Predict job category.
4. Top 3 Skills
Count frequency of extracted skills → return top 3.
5. Application
User uploads PDF.
Extract text → clean → run through classifier.
Display:
Predicted Category
Top 3 Skills
🔹 Example Code (Streamlit App)
Here’s a working mini-app:
import streamlit as st
import pdfplumber
import re
import spacy
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
# Sample training data
data = {
"resume_text": [
"Skilled in Python, TensorFlow, Machine Learning, AI research",
"Experienced with HTML, CSS, JavaScript, React, Node.js",
"Strong in SQL, Excel, Data Analysis, PowerBI",
"Knowledge of Mechanical Design, CAD, Thermodynamics"
],
"label": ["AI/ML", "Web Developer", "Data Analyst", "Core Engineer"]
}
# Train simple classifier
vectorizer = TfidfVectorizer(stop_words='english')
X = vectorizer.fit_transform(data['resume_text'])
clf = LogisticRegression()
clf.fit(X, data['label'])
# Load spaCy for skill extraction
nlp = spacy.load("en_core_web_sm")
def extract_text_from_pdf(uploaded_file):
text = ""
with pdfplumber.open(uploaded_file) as pdf:
for page in pdf.pages:
text += page.extract_text() + " "
return text
def extract_skills(text):
doc = nlp(text)
tokens = [token.text for token in doc if token.is_alpha]
skills_dict = ["Python", "Java", "C++", "TensorFlow", "SQL", "Excel", "React", "Node.js", "CAD"]
found_skills = [word for word in tokens if word in skills_dict]
top_skills = list(pd.Series(found_skills).value_counts().head(3).index)
return top_skills
# Streamlit UI
st.title("AI Resume Classifier")
uploaded_file = st.file_uploader("Upload Resume (PDF only)", type=["pdf"])
if uploaded_file is not None:
resume_text = extract_text_from_pdf(uploaded_file)
# Predict category
vector_input = vectorizer.transform([resume_text])
category = clf.predict(vector_input)[0]
# Extract skills
skills = extract_skills(resume_text)
# Display results
st.subheader("Classification Result")
st.write(f"*Predicted Category:* {category}")
st.write(f"*Top 3 Skills:* {', '.join(skills) if skills else 'No major skills found'}")
🔹 Example Output
If you upload a résumé with:
"I am proficient in Python, TensorFlow, and Machine Learning projects"
👉 The app will show:
Predicted Category: AI/ML
Top 3 Skills: Python, TensorFlow, Machine
⚡ Question for you:
Do you want me to build this as a Streamlit web app (easy to run in browser) or a Flask app (better if you want full deployment in college project)?
You said:
To use this model in Decision tree algorithm
ChatGPT said:
Perfect 👍 You want the AI Resume Classifier to use a Decision Tree Algorithm instead of Logistic Regression. That’s totally possible!
Here’s how we can adapt the earlier approach:
🔹 Steps
Data Preparation
Collect sample labeled resumes (job categories: Web Developer, Data Analyst, AI/ML, Core Engineer).
Convert resume text → numeric features using TF-IDF.
Decision Tree Classifier
Use DecisionTreeClassifier from sklearn.tree.
Train on the TF-IDF vectors.
Prediction for New Resumes
When a user uploads a resume, extract text → transform → predict category.
Top 3 Skills Extraction
Same as before (skills dictionary or spaCy-based extraction).
🔹 Example Code (Decision Tree)
import pdfplumber
import pandas as pd
import spacy
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.tree import DecisionTreeClassifier
# ====== Step 1: Sample Training Data ======
data = {
"resume_text": [
"Skilled in Python, TensorFlow, Machine Learning, AI research",
"Experienced with HTML, CSS, JavaScript, React, Node.js",
"Strong in SQL, Excel, Data Analysis, PowerBI",
"Knowledge of Mechanical Design, CAD, Thermodynamics"
],
"label": ["AI/ML", "Web Developer", "Data Analyst", "Core Engineer"]
}
df = pd.DataFrame(data)
# ====== Step 2: TF-IDF Vectorization ======
vectorizer = TfidfVectorizer(stop_words='english')
X
- README.md +8 -4
- index.html +0 -19
- results.html +126 -0
|
@@ -1,10 +1,14 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji: 🔥
|
| 4 |
colorFrom: yellow
|
| 5 |
-
colorTo:
|
|
|
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: ResumeWhizAI 🚀
|
|
|
|
| 3 |
colorFrom: yellow
|
| 4 |
+
colorTo: red
|
| 5 |
+
emoji: 🐳
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://deepsite.hf.co).
|
| 14 |
+
|
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
<!doctype html>
|
| 2 |
-
<html>
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="utf-8" />
|
| 5 |
-
<meta name="viewport" content="width=device-width" />
|
| 6 |
-
<title>My static Space</title>
|
| 7 |
-
<link rel="stylesheet" href="style.css" />
|
| 8 |
-
</head>
|
| 9 |
-
<body>
|
| 10 |
-
<div class="card">
|
| 11 |
-
<h1>Welcome to your static Space!</h1>
|
| 12 |
-
<p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
|
| 13 |
-
<p>
|
| 14 |
-
Also don't forget to check the
|
| 15 |
-
<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
|
| 16 |
-
</p>
|
| 17 |
-
</div>
|
| 18 |
-
</body>
|
| 19 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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" type="image/x-icon" href="/static/favicon.ico">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
</head>
|
| 11 |
+
<body class="bg-gray-50">
|
| 12 |
+
<header class="bg-blue-600 text-white py-6">
|
| 13 |
+
<div class="container mx-auto px-4">
|
| 14 |
+
<h1 class="text-4xl font-bold">ResumeWhizAI 🚀</h1>
|
| 15 |
+
<p class="mt-2 text-xl">Your Resume Analysis Results</p>
|
| 16 |
+
</div>
|
| 17 |
+
</header>
|
| 18 |
+
|
| 19 |
+
<main class="container mx-auto px-4 py-8">
|
| 20 |
+
<div class="bg-white rounded-lg shadow-md p-8 max-w-3xl mx-auto">
|
| 21 |
+
<div class="text-center mb-8">
|
| 22 |
+
<div class="w-24 h-24 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4">
|
| 23 |
+
<i data-feather="file-text" class="w-12 h-12 text-blue-600"></i>
|
| 24 |
+
</div>
|
| 25 |
+
<h2 class="text-2xl font-semibold">Resume Analysis Complete</h2>
|
| 26 |
+
<p class="text-gray-600 mt-2">Here's what our AI found in your resume</p>
|
| 27 |
+
</div>
|
| 28 |
+
|
| 29 |
+
<div class="grid md:grid-cols-2 gap-8">
|
| 30 |
+
<div>
|
| 31 |
+
<h3 class="text-xl font-medium mb-4 flex items-center">
|
| 32 |
+
<i data-feather="tag" class="mr-2 text-blue-500"></i>
|
| 33 |
+
Predicted Category
|
| 34 |
+
</h3>
|
| 35 |
+
<div class="bg-blue-50 border border-blue-200 rounded-lg p-4">
|
| 36 |
+
<span class="inline-block bg-blue-600 text-white px-3 py-1 rounded-full text-sm font-medium mb-2">
|
| 37 |
+
AI/ML Engineer
|
| 38 |
+
</span>
|
| 39 |
+
<p class="text-gray-700">Your skills best match this job category</p>
|
| 40 |
+
</div>
|
| 41 |
+
</div>
|
| 42 |
+
|
| 43 |
+
<div>
|
| 44 |
+
<h3 class="text-xl font-medium mb-4 flex items-center">
|
| 45 |
+
<i data-feather="award" class="mr-2 text-yellow-500"></i>
|
| 46 |
+
Top 3 Skills
|
| 47 |
+
</h3>
|
| 48 |
+
<div class="space-y-2">
|
| 49 |
+
<div class="flex items-center bg-yellow-50 border border-yellow-200 rounded-lg p-3">
|
| 50 |
+
<span class="bg-yellow-100 text-yellow-800 p-2 rounded-full mr-3">
|
| 51 |
+
<i data-feather="star" class="w-4 h-4"></i>
|
| 52 |
+
</span>
|
| 53 |
+
<span class="font-medium">Python</span>
|
| 54 |
+
</div>
|
| 55 |
+
<div class="flex items-center bg-yellow-50 border border-yellow-200 rounded-lg p-3">
|
| 56 |
+
<span class="bg-yellow-100 text-yellow-800 p-2 rounded-full mr-3">
|
| 57 |
+
<i data-feather="star" class="w-4 h-4"></i>
|
| 58 |
+
</span>
|
| 59 |
+
<span class="font-medium">TensorFlow</span>
|
| 60 |
+
</div>
|
| 61 |
+
<div class="flex items-center bg-yellow-50 border border-yellow-200 rounded-lg p-3">
|
| 62 |
+
<span class="bg-yellow-100 text-yellow-800 p-2 rounded-full mr-3">
|
| 63 |
+
<i data-feather="star" class="w-4 h-4"></i>
|
| 64 |
+
</span>
|
| 65 |
+
<span class="font-medium">Machine Learning</span>
|
| 66 |
+
</div>
|
| 67 |
+
</div>
|
| 68 |
+
</div>
|
| 69 |
+
</div>
|
| 70 |
+
|
| 71 |
+
<div class="mt-8 pt-6 border-t border-gray-200">
|
| 72 |
+
<h3 class="text-xl font-medium mb-4 flex items-center">
|
| 73 |
+
<i data-feather="bar-chart-2" class="mr-2 text-purple-500"></i>
|
| 74 |
+
Skill Breakdown
|
| 75 |
+
</h3>
|
| 76 |
+
<div class="space-y-3">
|
| 77 |
+
<div>
|
| 78 |
+
<div class="flex justify-between mb-1">
|
| 79 |
+
<span>Python</span>
|
| 80 |
+
<span>95% match</span>
|
| 81 |
+
</div>
|
| 82 |
+
<div class="w-full bg-gray-200 rounded-full h-2.5">
|
| 83 |
+
<div class="bg-blue-600 h-2.5 rounded-full" style="width: 95%"></div>
|
| 84 |
+
</div>
|
| 85 |
+
</div>
|
| 86 |
+
<div>
|
| 87 |
+
<div class="flex justify-between mb-1">
|
| 88 |
+
<span>TensorFlow</span>
|
| 89 |
+
<span>88% match</span>
|
| 90 |
+
</div>
|
| 91 |
+
<div class="w-full bg-gray-200 rounded-full h-2.5">
|
| 92 |
+
<div class="bg-blue-600 h-2.5 rounded-full" style="width: 88%"></div>
|
| 93 |
+
</div>
|
| 94 |
+
</div>
|
| 95 |
+
<div>
|
| 96 |
+
<div class="flex justify-between mb-1">
|
| 97 |
+
<span>Data Analysis</span>
|
| 98 |
+
<span>76% match</span>
|
| 99 |
+
</div>
|
| 100 |
+
<div class="w-full bg-gray-200 rounded-full h-2.5">
|
| 101 |
+
<div class="bg-blue-600 h-2.5 rounded-full" style="width: 76%"></div>
|
| 102 |
+
</div>
|
| 103 |
+
</div>
|
| 104 |
+
</div>
|
| 105 |
+
</div>
|
| 106 |
+
|
| 107 |
+
<div class="mt-8 flex justify-center">
|
| 108 |
+
<a href="index.html" class="bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-6 rounded-lg inline-flex items-center">
|
| 109 |
+
<i data-feather="arrow-left" class="mr-2"></i>
|
| 110 |
+
Analyze Another Resume
|
| 111 |
+
</a>
|
| 112 |
+
</div>
|
| 113 |
+
</div>
|
| 114 |
+
</main>
|
| 115 |
+
|
| 116 |
+
<footer class="bg-gray-100 py-6 mt-12">
|
| 117 |
+
<div class="container mx-auto px-4 text-center text-gray-600">
|
| 118 |
+
<p>© 2023 ResumeWhizAI. All rights reserved.</p>
|
| 119 |
+
</div>
|
| 120 |
+
</footer>
|
| 121 |
+
|
| 122 |
+
<script>
|
| 123 |
+
feather.replace();
|
| 124 |
+
</script>
|
| 125 |
+
</body>
|
| 126 |
+
</html>
|