Using OpenAI and Python to Enhance Your Resume: A Step-by-Step Guide

Here’s the story of a success story that only required a few hours of work

Piero Paialunga
Towards Data Science

--

Image made by author using Midjourney

A couple of days ago, I came back from work and started playing video games.

Playing video games is a great distraction for me, and as I am so incredibly bad, I really don’t focus on the game; I just start thinking. I let my mind go everywhere. Mostly, I think of the things I love, like artificial intelligence.

So while I was doing my mission on PS4 (again, I was losing, of course), I was thinking that a lot of NLP tasks like token classification, next-word predictions (text generation), sentiment analysis, text classification, and many other tasks can now basically be solved in seconds.

For example, ChatGPT is a crazy-good chatbot that has been trained to answer questions from whatever domain in a conversational way. It can summarize text, answer questions, write code, do impressions, write songs, write recipes…

The trend is to build smaller, more scalable, and open-source code that can be used instead of ChatGPT and with a free API, so the point is not even specifically ChatGPT. The point is that there are these so-called "large language models" that are trained on a huge quantity of texts, and with such computational power, they probably overcome all the smaller approaches with smaller datasets that you can build on your laptop.

What I mean is that if you have to summarize a text (that is not a medically unknown, super difficult one) or understand if a review is good or bad, there is no reason to develop your model because OpenAI's free model can probably do that in seconds.

So I was thinking, "What is a task that would require a lot of work and we can now do it in seconds?" Well, for example, writing a resume.

Of course, nobody can write a resume for us from scratch because they don’t know our careers, but there are services online where you can use AI to improve your resume. These services are usually not free, and I think that now they are obsolete because there is OpenAI that is indeed free and can do the job probably better than all the other models around unless those are Meta, Google, or Microsoft models. 😅

So I decided that I was going to use Streamlit to build a web app where everyone could upload their resume and Artificial Intelligence (as we will see, more specifically, OpenAI) will improve their resume in seconds.

The app, in my mind, worked like this:

Image by author

Very simple right?

A few hours of work, and this is the result:

Now, this looks like a startup that has been up for months, but the truth is that nowadays, it just took me a few hours, some basic Python, and the magic of Open AI’s GPT-3 to produce that!

I am a nerd, and if people show me this without the code, I’m not going to believe it, so let me explain what I did in more detail in the next chapter!

0. Some considerations

Before we start, there are some things we need to consider to make this discussion more complete.

One fair assumption:

First of all, the world of HR and recruiters is a challenging one for a lot of reasons. For example, the job market is dynamic and it’s always evolving. AI works with trained models. This means that once the model is trained, the information it gets and its performance are related to a possibly outdated dataset it has been trained on.

For this reason, I would say that this model works as a grammar check and a beautifier of your text MORE THAN as a specialist that actually reviews your resume and finds a way to improve it.

One safety question:

Is it even safe to submit personal data to software?

Well…yes and no.

In this article, I am not inviting you to submit anything different than your work experience which is not exactly a secret as everyone with a LinkedIn page can see them. If you still feel sketchy about this, remember that there is always the option to run my code locally, so no web app is actually used and you keep all the information of your CV for yourself.

I wouldn’t recommend adding personal information about your address, number of telephone or email in a AI resume improver.

One ethical question:

There are a few general ethical considerations to keep in mind when using AI to improve your resume.

  • Building a dataset that is not biased is an extremely tricky concept as we could all be, somehow, in our own way biased: the only thing that we can try to do is to build a dataset that is as less biased as possible. This applies to this case as well. A blind and uncontrolled use of Artificial Intelligence in the hiring process, both in terms of hiring or building your CV, is something that is extremely risky as the Machine Learning decision algorithm can commit biased errors in all the decision stages and throughout all the parts of your resume. (read more here)
  • It’s important to be transparent about the use of AI in your resume. If you use AI to generate content or optimize formatting, we need to make sure to disclose that in your resume. This is something that we should all do in our jobs. Sometimes it is easy to forget about disclosing it properly because these technologies are so connected to our lives, but it is still something that needs to be reminded. There are also tools that can be used to see if a text is written by AI or not (read more here)
  • Lastly, remember that you are just using a Language Model. All the model is really doing is predicting, in a fancy way, the “next word” based on billions of texts around the world. You know yourself better than a computer so dig in, enhance your positive sides, give yourself credit and then use a Language Model to improve your resume 😊

Now that we are all on board, let’s start with the code 💻

1. Github!

First of all, there is nothing secret here! Everything is public and on Github! 👇

I will now describe everything that is there and that is necessary to produce the results.

1.1. Constants.py

Let’s start with the simple things

constants.py is a file that contains... constants.

It gets the keys of our template resume, the temperature of the OpenAI model, and the prompt that we are using to improve our resume. This is what they call “prompt engineering."

Note!!! You need to change the OPENAIKEY using your open AI key. It is not public and you shouldn’t share one, that’s why I named it fake_key. Get a key here https://openai.com/api/

You can change the prompt engineering just by changing this constants.py file. Ain’t that easy? 🙃

1.2 utils.py

utils.py is a file that helps us extract the content from the .txt file and extract the summary part out of it. Just an honest guy that does the work he’s paid for.

1.3 cv_parser.py

cv_parser.py does something that is indeed similar to utils.py, and I actually wasn’t sure if I should split the code into two.py files. It is again nothing more than a toolbox; what it does is deal with the templates and the results file (respectively, the start and the end of the process) and parse the work experiences into the section of texts. It is kind of like the work that utilities do, but more related to the task... I probably should have put them in the same file but I like order 😂

1.4 ai_improver.py

ai_improver.py does the proper AI part. It improves both the resume summary and each of the work experiences that are listed by connecting itself to OpenAI using the OpenAI key. It also uses all the prompts we built and put in the constants. py file

1.5 app.py

This is what we run to run the app. We run it using

streamlit run app.py

and it does…everything.

This is where all the roads are connected. The script does the following steps:

  • It takes file from a upload file and parse them using utils.py and cv_parser.py.
  • It does the AI part using ai_improver.py. ai_improver.py uses the constants.py file too.
  • It allows you to download the AI improved resume with a download button.

1.6 main.py

main.py does exactly what app.py does, but locally (no streaming).

Run it using

python main.py

2. Results!

Let’s give a proper look at the results I got.

My input summary was the following:

“I’m a Physicist that has developed strong skills in Data Science and Deep Learning.Master’s Degree in Physics Of Complex Systems and Big Data (grade: 110/110 cum laude).Currently working as a Research Assistant with the Aerospace Engineering and Engineering Mechanics Department of the University of Cincinnati while pursuing the PhD. The goal of my research is finding ways to optimize engineering experiments using Machine Learning and Data Science.Technical writer for Towards Data Science about trending Machine Learning applications and techniques to real world problems (60k+ monthly views). Course Creator and Teacher for Teens in AI. Developer of Image Processing I and Signal Processing I courses.”

The AI model outputs this as a more appealing and interesting summary for a recruiter:

I have an extensive background in Physics, with a Master’s Degree in Physics Of Complex Systems and Big Data (grade: 110/110 cum laude). I have also developed strong skills in Data Science and Deep Learning. I am currently working as a Research Assistant with the Aerospace Engineering and Engineering Mechanics Department of the University of Cincinnati while pursuing my PhD. My research focuses on finding ways to optimize engineering experiments using Machine Learning and Data Science. Additionally, I am a technical writer for Towards Data Science, where I write about trending Machine Learning applications and techniques for solving real-world problems (60k+ monthly views). I am also a Course Creator and Teacher for Teens in AI and a developer of Image Processing I and Signal Processing I courses. My experience and knowledge in these areas have enabled me to develop a unique set of skills that are highly sought after in the industry.

I’m not going to lie... It does sound better to me.

It is certainly smoother (and this was predictable as I’m not an English native speaker), and it sounds more exciting. It is slightly longer, though, and that might be a problem as we want to save space in our resume.

Let’s see a review of one work experience. For example, one of them was:

Using Machine Learning to create surrogate modeling and increase the efficiency of Mechanical Engineering experiments. Hands on research in Traditional and Deep Machine Learning.

And the AI corrected it into:

Leveraging Machine Learning to create surrogate modeling and optimize Mechanical Engineering experiments. Experienced in both Traditional and Deep Machine Learning, with a proven track record of successful research.

….sometimes I have the feeling it is just a little too brave. 😂

I would still say that it does improve the quality of the text. And in this case, it also kept things short, which is a plus!

3. Some takeaways!

In this article, I shared my experience using OpenAI’s GPT-3 model to create a resume improvement web app. Here are the key takeaways from my experience:

  1. The Open AI model is a tool that can perform a wide range of NLP tasks, including token classification, text generation, sentiment analysis, and text classification. It is so helpful that a lot of the previous models are basically outdated at this point.
  2. The concept behind the app is to download a template, fill it out with your resume, upload it back, and let the AI analyzes it for you.
  3. It’s very easy to create a web app to improve your CV. It took only a few hours of code and some basic Python coding.
  4. This makes me think that the possibilities for AI-powered applications are huge, and with tools like GPT-3 and Streamlit becoming more accessible, even non-coders (or not-so-skilled coders) can create impressive results in just a few hours of work.

Finally, this whole experience has demonstrated once again the incredible power of AI and its potential to transform the way we work and live. But maybe we already knew that 🙃

4. Conclusions

If you liked the article and you want to know more about machine learning, or you just want to ask me something, you can:

A. Follow me on Linkedin, where I publish all my stories
B. Subscribe to my newsletter. It will keep you updated about new stories and give you the chance to text me to receive all the corrections or doubts you may have.
C. Become a referred member, so you won’t have any “maximum number of stories for the month” and you can read whatever I (and thousands of other Machine Learning and Data Science top writers) write about the newest technology available.

--

--

PhD in Aerospace Engineering at the University of Cincinnati. Machine Learning Engineer @ Gen Nine, Martial Artist, Coffee Drinker, from Italy.