Upload 12 files
Browse files- .gitattributes +5 -0
- app.py +211 -0
- modelfile/bighealth2.keras +3 -0
- modelfile/bighr2.keras +3 -0
- modelfile/bigit2.keras +3 -0
- modelfile/bigothers2.keras +3 -0
- modelfile/bigrsales2.keras +3 -0
- requirements.txt +6 -0
- tokernizer/tokenizershealth.pkl +3 -0
- tokernizer/tokenizershr.pkl +3 -0
- tokernizer/tokenizersit.pkl +3 -0
- tokernizer/tokenizersothers.pkl +3 -0
- tokernizer/tokenizerssales.pkl +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,8 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
modelfile/bighealth2.keras filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
modelfile/bighr2.keras filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
modelfile/bigit2.keras filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
modelfile/bigothers2.keras filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
modelfile/bigrsales2.keras filter=lfs diff=lfs merge=lfs -text
|
app.py
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pickle
|
| 2 |
+
import numpy as np
|
| 3 |
+
import spacy
|
| 4 |
+
import re
|
| 5 |
+
import string
|
| 6 |
+
import streamlit as st
|
| 7 |
+
from tensorflow.keras.models import load_model
|
| 8 |
+
from tensorflow.keras.preprocessing.sequence import pad_sequences
|
| 9 |
+
|
| 10 |
+
# Abbreviations dictionary for job market
|
| 11 |
+
abbreviations = {
|
| 12 |
+
"mgr": "manager",
|
| 13 |
+
"sr": "senior",
|
| 14 |
+
"jr": "junior",
|
| 15 |
+
"asst": "assistant",
|
| 16 |
+
"assoc": "associate",
|
| 17 |
+
"dept": "department",
|
| 18 |
+
"exp": "experience",
|
| 19 |
+
"hr": "human resources",
|
| 20 |
+
"acct": "account",
|
| 21 |
+
"acctg": "accounting",
|
| 22 |
+
"fin": "finance",
|
| 23 |
+
"eng": "engineer",
|
| 24 |
+
"engg": "engineering",
|
| 25 |
+
"it": "information technology",
|
| 26 |
+
"qa": "quality assurance",
|
| 27 |
+
"dev": "development",
|
| 28 |
+
"devops": "development operations",
|
| 29 |
+
"proj": "project",
|
| 30 |
+
"mktg": "marketing",
|
| 31 |
+
"biz": "business",
|
| 32 |
+
"comm": "communication",
|
| 33 |
+
"adm": "administration",
|
| 34 |
+
"sec": "secretary",
|
| 35 |
+
"exec": "executive",
|
| 36 |
+
"corp": "corporation",
|
| 37 |
+
"intl": "international",
|
| 38 |
+
"rep": "representative",
|
| 39 |
+
"mfg": "manufacturing",
|
| 40 |
+
"prod": "production",
|
| 41 |
+
"purch": "purchasing",
|
| 42 |
+
"sales": "sales",
|
| 43 |
+
"cust": "customer",
|
| 44 |
+
"svc": "service",
|
| 45 |
+
"tech": "technical",
|
| 46 |
+
"sup": "supervisor",
|
| 47 |
+
"supv": "supervision",
|
| 48 |
+
"log": "logistics",
|
| 49 |
+
"inv": "inventory",
|
| 50 |
+
"sch": "schedule",
|
| 51 |
+
"edu": "education",
|
| 52 |
+
"lang": "language",
|
| 53 |
+
"pr": "public relations",
|
| 54 |
+
"hrd": "human resources development",
|
| 55 |
+
"cfo": "chief financial officer",
|
| 56 |
+
"ceo": "chief executive officer",
|
| 57 |
+
"coo": "chief operating officer",
|
| 58 |
+
"cmo": "chief marketing officer",
|
| 59 |
+
"cto": "chief technology officer",
|
| 60 |
+
"cio": "chief information officer",
|
| 61 |
+
"pmo": "project management office",
|
| 62 |
+
"pmp": "project management professional",
|
| 63 |
+
"ba": "business analyst",
|
| 64 |
+
"bpm": "business process management",
|
| 65 |
+
"ui": "user interface",
|
| 66 |
+
"ux": "user experience",
|
| 67 |
+
"svp": "senior vice president",
|
| 68 |
+
"vp": "vice president",
|
| 69 |
+
"gm": "general manager",
|
| 70 |
+
"doe": "depends on experience",
|
| 71 |
+
"r&d": "research and development",
|
| 72 |
+
"seo": "search engine optimization",
|
| 73 |
+
"sem": "search engine marketing",
|
| 74 |
+
"smm": "social media marketing",
|
| 75 |
+
"b2b": "business to business",
|
| 76 |
+
"b2c": "business to consumer",
|
| 77 |
+
"kpi": "key performance indicator",
|
| 78 |
+
"roi": "return on investment",
|
| 79 |
+
"saas": "software as a service",
|
| 80 |
+
"paas": "platform as a service",
|
| 81 |
+
"iaas": "infrastructure as a service",
|
| 82 |
+
"crm": "customer relationship management",
|
| 83 |
+
"erp": "enterprise resource planning",
|
| 84 |
+
"sd": "software development",
|
| 85 |
+
"pm": "project manager",
|
| 86 |
+
"pa": "personal assistant",
|
| 87 |
+
"exec": "executive",
|
| 88 |
+
"fin": "finance",
|
| 89 |
+
"hrm": "human resources management",
|
| 90 |
+
"it": "information technology",
|
| 91 |
+
"pr": "public relations",
|
| 92 |
+
"qa": "quality assurance",
|
| 93 |
+
"r&d": "research and development",
|
| 94 |
+
"scm": "supply chain management",
|
| 95 |
+
"seo": "search engine optimization",
|
| 96 |
+
"smm": "social media marketing",
|
| 97 |
+
"ux": "user experience",
|
| 98 |
+
"ui": "user interface",
|
| 99 |
+
"bi": "business intelligence",
|
| 100 |
+
"dev": "development",
|
| 101 |
+
"ops": "operations"
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
# Load Spacy model
|
| 106 |
+
nlp = spacy.load("en_core_web_sm")
|
| 107 |
+
|
| 108 |
+
def expand_abbreviations(text, abbreviations):
|
| 109 |
+
for abbr, expanded in abbreviations.items():
|
| 110 |
+
text = re.sub(r'\b{}\b'.format(abbr), expanded, text)
|
| 111 |
+
return text
|
| 112 |
+
|
| 113 |
+
def clean_and_preprocess(text):
|
| 114 |
+
text = expand_abbreviations(text, abbreviations)
|
| 115 |
+
text = text.lower()
|
| 116 |
+
text = re.sub(r'\d+', '', text)
|
| 117 |
+
text = text.translate(str.maketrans('', '', string.punctuation))
|
| 118 |
+
text = re.sub(r'\s+', ' ', text).strip()
|
| 119 |
+
doc = nlp(text)
|
| 120 |
+
tokens = [token.lemma_ for token in doc if token.is_alpha and not token.is_stop]
|
| 121 |
+
return ' '.join(tokens)
|
| 122 |
+
|
| 123 |
+
def extract_nouns(text):
|
| 124 |
+
doc = nlp(text)
|
| 125 |
+
nouns = [token.lemma_ for token in doc if token.pos_ == "NOUN"]
|
| 126 |
+
return nouns
|
| 127 |
+
|
| 128 |
+
# Define the sector options and their corresponding model and tokenizer paths
|
| 129 |
+
sectors = {
|
| 130 |
+
'HR': {
|
| 131 |
+
'model': r'modelfile\bighr2.keras',
|
| 132 |
+
'tokenizer': r'tokernizer\tokenizershr.pkl'
|
| 133 |
+
},
|
| 134 |
+
'IT': {
|
| 135 |
+
'model': r'modelfile\bigit2.keras',
|
| 136 |
+
'tokenizer': r'tokernizer\tokenizersit.pkl'
|
| 137 |
+
},
|
| 138 |
+
'Sales': {
|
| 139 |
+
'model': r'modelfile\bigrsales2.keras',
|
| 140 |
+
'tokenizer': r'tokernizer\tokenizerssales.pkl'
|
| 141 |
+
},
|
| 142 |
+
'Health': {
|
| 143 |
+
'model': r'modelfile\bighealth2.keras',
|
| 144 |
+
'tokenizer': r'tokernizer\tokenizershealth.pkl'
|
| 145 |
+
},
|
| 146 |
+
'Other': {
|
| 147 |
+
'model': r'modelfile\bigothers2.keras',
|
| 148 |
+
'tokenizer': r'tokernizer\tokenizersothers.pkl'
|
| 149 |
+
}
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
# Streamlit UI
|
| 153 |
+
st.title("Resume and Job Description Analyzer")
|
| 154 |
+
|
| 155 |
+
st.write("Upload your resume and job description, then select the job sector to analyze how well the resume fits the job description.")
|
| 156 |
+
|
| 157 |
+
# Resume input
|
| 158 |
+
resume = st.text_area("Paste your Resume:", height=150)
|
| 159 |
+
|
| 160 |
+
# Job description input
|
| 161 |
+
job_description = st.text_area("Paste Job Description:", height=150)
|
| 162 |
+
|
| 163 |
+
# Sector selection
|
| 164 |
+
sector = st.selectbox("Select Sector:", list(sectors.keys()))
|
| 165 |
+
|
| 166 |
+
if st.button("Analyze Resume"):
|
| 167 |
+
if resume and job_description:
|
| 168 |
+
try:
|
| 169 |
+
# Load the selected model and tokenizer
|
| 170 |
+
model_path = sectors[sector]['model']
|
| 171 |
+
tokenizer_path = sectors[sector]['tokenizer']
|
| 172 |
+
|
| 173 |
+
model = load_model(model_path)
|
| 174 |
+
|
| 175 |
+
with open(tokenizer_path, 'rb') as f:
|
| 176 |
+
tokenizers = pickle.load(f)
|
| 177 |
+
|
| 178 |
+
resume_tokenizer = tokenizers['resume_tokenizer']
|
| 179 |
+
description_tokenizer = tokenizers['description_tokenizer']
|
| 180 |
+
common_nouns_tokenizer = tokenizers['common_nouns_tokenizer']
|
| 181 |
+
|
| 182 |
+
# Preprocess the resume
|
| 183 |
+
processed_resume = clean_and_preprocess(resume)
|
| 184 |
+
|
| 185 |
+
# Preprocess the job description
|
| 186 |
+
processed_description = clean_and_preprocess(job_description)
|
| 187 |
+
|
| 188 |
+
# Convert to sequences using the resume tokenizer
|
| 189 |
+
resume_sequence = resume_tokenizer.texts_to_sequences([processed_resume])
|
| 190 |
+
resume_data_padded = pad_sequences(resume_sequence, maxlen=1500)
|
| 191 |
+
|
| 192 |
+
# Convert to sequences using the description tokenizer
|
| 193 |
+
description_sequence = description_tokenizer.texts_to_sequences([processed_description])
|
| 194 |
+
description_data_padded = pad_sequences(description_sequence, maxlen=1500)
|
| 195 |
+
|
| 196 |
+
# Extract common nouns from the resume
|
| 197 |
+
common_nouns = set(extract_nouns(processed_resume))
|
| 198 |
+
common_nouns_str = ' '.join(common_nouns)
|
| 199 |
+
|
| 200 |
+
# Convert to sequences using the common nouns tokenizer
|
| 201 |
+
common_nouns_sequence = common_nouns_tokenizer.texts_to_sequences([common_nouns_str])
|
| 202 |
+
common_nouns_data = pad_sequences(common_nouns_sequence, maxlen=10)
|
| 203 |
+
|
| 204 |
+
# Make predictions
|
| 205 |
+
prediction = model.predict([resume_data_padded, description_data_padded, common_nouns_data])
|
| 206 |
+
|
| 207 |
+
st.success(f"Your predicted ATS Score is: {prediction[0][0]:.2f}")
|
| 208 |
+
except Exception as e:
|
| 209 |
+
st.error(f"An error occurred: {e}")
|
| 210 |
+
else:
|
| 211 |
+
st.error("Please paste both your resume and job description before analyzing.")
|
modelfile/bighealth2.keras
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:59e13d30646e87cd5126a8ce9cfae4d342bdbc9b911e77370766160ed471b8c3
|
| 3 |
+
size 16911730
|
modelfile/bighr2.keras
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:63e6dd10cbe7f909a8b822d12c6034ba32d69787d705309ff759c2ad1869aea1
|
| 3 |
+
size 16412530
|
modelfile/bigit2.keras
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:73da88d0d26c37d70ee686f574c0b13c8417b013eb3e8adec4c77204ad5f1ba5
|
| 3 |
+
size 16614130
|
modelfile/bigothers2.keras
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ff736f59baac8310c0cdb9753cac6b0d54f470fbfadaa7cd3687dee426846020
|
| 3 |
+
size 20487730
|
modelfile/bigrsales2.keras
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:41b55191182605377b6fc865fd8e39e5b2b31816a004ad90d165545a1a7228b9
|
| 3 |
+
size 15355330
|
requirements.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
pickle
|
| 2 |
+
numpy
|
| 3 |
+
spacy
|
| 4 |
+
string
|
| 5 |
+
streamlit
|
| 6 |
+
tensorflow
|
tokernizer/tokenizershealth.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e71e617104ae224680bec66de7c645d9ed154a817c32873d61acaec8668753d1
|
| 3 |
+
size 476060
|
tokernizer/tokenizershr.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bdca68e1dcd818834d10a8579028d648e5a7dd97c668279da3b95f05bd212985
|
| 3 |
+
size 456963
|
tokernizer/tokenizersit.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:23767d74bbbd5a43ffc374c9316b1c01cff1e08f34a2476df2a319c745dc887d
|
| 3 |
+
size 414524
|
tokernizer/tokenizersothers.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:af6b59669ea9a266a27522d6a13e0ac26d97f1b46b5c69cd888bbd4d78c0f85b
|
| 3 |
+
size 611798
|
tokernizer/tokenizerssales.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:58c2e0e86f847720d17bdb146263a3a9ade7baee0b3767db69597876ac7f2d6d
|
| 3 |
+
size 414524
|