Skip to content

Instantly share code, notes, and snippets.

@JaminB
Created March 13, 2017 18:12
Show Gist options
  • Save JaminB/e6f68f4e68f87b0c68d0314568d7d17b to your computer and use it in GitHub Desktop.
Save JaminB/e6f68f4e68f87b0c68d0314568d7d17b to your computer and use it in GitHub Desktop.
BuzzFactor - A simple heuristic for determining how personal a recruiter-message is
"""
BuzzFactor an algorithm designed to assign an integer value (1-10) to the level of "Buzziness" of a recruiter-provided job description.
- 1-3: The recruiter took time to draft a job description, and probably spent time looking at your profile.
- 4-6: The recruiter may have modified a template slightly, and most likely made some effort to correctly match you.
- 7+: The recuriter litterally copied and pasted the job description into an email and slapped your name on it because "computer" was in your resume
"""
### COPY and PASTE MESSAGE HERE
message = """
"""
lines = message.split("\n")
significantWords = []
significantWordCounts = []
for line in lines:
for word in line.split(" "):
if len(word) > 5:
if word in significantWords:
index = significantWords.index(word)
significantWordCounts[index] +=1
else:
significantWords.append(word)
significantWordCounts.append(1)
significantPairs = list(zip(significantWords, significantWordCounts))
significantPairs.sort(key=lambda x: x[1])
significantPairs.reverse()
buzzFactor = 0
exclamatoryCount = 0
adverbCount = 0
for pair in significantPairs:
if(pair[1] > 1):
buzzFactor += pair[1]/len(significantPairs)
elif "!" in pair[0]:
exclamatoryCount += 1
if exclamatoryCount > 2:
buzzFactor += exclamatoryCount/len(significantPairs)
elif "ly" in pair[0]:
adverbCount += 1
if adverbCount > 3:
buzzFactor += adverbCount/len(significantPairs)
else:
continue
normalizedBuzzFactor = int(round(buzzFactor,1) * 10)
print("This request has a " + str(normalizedBuzzFactor) + " BuzzFactor.")
if normalizedBuzzFactor < 4:
print("The recruiter took time to draft a job description, and probably spent time looking at your profile.")
elif normalizedBuzzFactor < 7:
print("The recruiter may have modified a template slightly, and most likely made some effort to correctly match you.")
else:
print("The recuriter litterally copied and pasted the job description into an email and slapped your name on it because 'computer' was in your resume")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment