Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A resume optimizer application utilizing word cloud generator by Andreas Mueller
"""
Word Cloud Resume Optimizer
By Mohamed Haris
GitHub ID: @harismohamed
"""
#install and import required libraries
!pip install python-docx
!pip install wordcloud
from docx import Document
from wordcloud import WordCloud, STOPWORDS
import matplotlib as mpl
import matplotlib.pyplot as plt
#set path for resume file
myresume="C:\\temp\\my_resume.docx"
#read the document
doc = Document(myresume)
#collect text from each paragraph
resumetext = ""
text = []
for para in doc.paragraphs:
text.append(para.text)
resumetext = '\n'.join(text)
stopwords = set(STOPWORDS)
#add custom stop words for better results
#custom stopwords may be stored in a text file
custstopwordsfile="C:\\temp\\stopwords.txt"
f=open(custstopwordsfile,'r')
custstopwords=f.read().splitlines()
f.close()
#add custom stop words to the default ones
stopwords.update(custstopwords)
#instantiate a word cloud object
resume_wc = WordCloud(
background_color='black',
stopwords=stopwords)
#adjust the image rendering area
fig = plt.figure()
fig.set_figwidth(12) # set width
fig.set_figheight(16) # set height
#generate the word cloud
resume_wc.generate(resumetext)
plt.imshow(resume_wc, interpolation='bilinear')
plt.axis('off')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment