How To
Aug 8, 2023

Use ChatGPT for AI Lead Scoring

If you have hundreds of leads flowing in, you'll have the daunting task of going through them all and picking the ones that actually have value.

It is a data-driven process requiring you to consider leads’ demographic details, behavioral data, engagement levels, etc., to assess lead quality. While you can always turn to a CRM system for lead scores, why not create our own make-do lead scoring model?

And since everyone seems to be experimenting with ChatGPT and similar AI bots, how about we also add to the mix the NLP (Natural Language Processing) model of ChatGPT?

So, let’s use Gigasheet, a no-code big data spreadsheet, and ChatGPT API to build our own data-driven lead scoring model with natural language processing capabilities.

Pre-Requisites for Gigasheet-ChatGPT Lead Scoring Model

Before we can create a working lead scoring model, here are some things you will need:

1. Gigasheet Account

First of all, you must register your account with Gigasheet. It is a cloud-based spreadsheet designed explicitly to handle big data. We will use it to upload and process our lead scoring dataset.

Gigasheet can process up to 1 billion rows per sheet without any hassle. Its intuitive UI allows you to create filters, sort and group data, apply if-else conditions, and do more in just a few clicks.

Besides, Gigasheet is free-to-use, and you can create your free account here.

2. Lead Scoring Dataset

Next, you must have a dataset with details of your leads. We are using a lead scoring dataset from Kaggle. It has details of leads for an online course seller. Here we have our dataset opened in Gigasheet:

AI Lead scoring dataset opened in Gigasheet.

As you can see, the dataset has columns for details like prospect ID, occupation, lead origin, conversion status, website visits, time spent on the site, pages viewed, etc. We can use this information to score leads and assess their probability of converting into paying customers.

3. OpenAI API Key

Finally, you will need the OpenAI GPT API key. You can register yourself on the OpenAI Platform to create your own keys. The API key will let us connect OpenAI’s GPT model with our dataset in Gigasheet, enabling us to use its NLP model to score leads.

New accounts get a free $5 credit, and you will be charged every time your connected application sends requests to the GPT servers using the API. If you need help creating API keys, we have explained the process of registering and creating keys here.

Creating the Gigasheet-ChatGPT Lead Scoring Model

Now, we can begin creating our DIY lead scoring model powered by ChatGPT.

After registering on Gigasheet , log in to your account and drag and drop your dataset to get started. And follow these steps:

1. Write A Prompt for Scoring Leads

You are all well aware of how ChatGPT works. You enter a prompt, and the bot replies. We still need to write a prompt when using the API. But the process here is a bit different.

First, log in to the OpenAI Platform and head over to the Playground section. Make sure the mode is selected as Chat and the model is gpt-3.5-turbo.

OpenAI API Platform.

Now, in the System section, explain what role the GPT model needs to play, i.e., to score leads based on leads’ available behavioral data.

In the User section, we will write our prompt as shown below.

A prompt written in OpenAI platform.

The prompt instructs the GPT model to consider different factors and user actions to score leads. These scoring parameters are derived from details stored in our lead scoring dataset.

You will notice that there’s a repetition of expression= column. That’s because we will later tweak this prompt a bit in Gigasheet. What we’ll do is reference the exact column that contains the value corresponding to the user action.

Finally, click the View Code button, select curl from the drop-down menu, and click the Copy.


ChatGPT prompt copied as a cURL request for AI lead scoring

2. Create Custom ChatGPT Enrichment in Gigasheet

Data enrichment, as you know, is the process of enriching existing data with additional information, mostly from third-party sources. Gigasheet has built-in enrichments for email format validation, IP verification, address identifiers, etc.

But it also has custom enrichments. So, apart from the pre-built ones, you can enrich your data from any source you like as long as you have valid API keys.

To create our custom ChatGPT enrichment, we will head over to the menu bar, click Functions tab > Enrichments > Custom Enrichment.

Gigasheet's custom enrichment.

Paste the curl in the CURL REQUEST section. Also, replace the phrase $OPENAI_API_KEY with your OpenAI API Key. Click Next.

curl pasted in Gigasheet's custom enrichment pop-up dialog box.

Now, we are in the ADD SHEET VALUES section, where we can modify the prompt to refer values to columns in our dataset. Go to the user prompt part of curl, and replace the word column in the prompt with the column reference.

Simply highlight the word column, select the respective column from the dataset, and click Insert Column Reference. Repeat the process for every factor to be considered for lead scoring and click Test.

Column references added to the prompt to create AI lead scoring

Next, you will see the SELECT RESPONSE FIELD section. Here, we can select the columns you want to add to your spreadsheet. We only need the response for the lead scores, which is the column named choices/0/message/content. Simply tick the column and hit Apply.

Confirm that you want to proceed by clicking Run. Wait for Gigasheet to complete the operation.

ChatGPT custom enrichment being finalized.

3. Explore Your Enriched Dataset

Once the enrichment is successful, you will see a new column added to your dataset in Gigasheet. It contains the lead score and reasoning behind the score, as we instructed in our prompt. We can even edit the name of this new column for easier exploration.

Custom enrichment adds a new column to the dataset with response based on the prompt, enabling AI Lead Scoring

That is not all. We have a lot of exploratory features in Gigasheet that we can use to gain more granular insights from our data. For instance, we can use the Split Column function to extract lead scores from the ChatGPT response column. Then, use the Group function to group leads with similar scores and analyze their characteristics and behaviors. Need a hand performing advanced transformations or analysis? Try Gigasheet's AI co-pilot, AI Spreadsheet Assistant.

Fast-track Your Data Analytics with Gigasheet

That’s just one of the many useful enrichment ideas you can execute using Gigasheet. You can enrich your data from any platform as long as you have valid keys and curl. The possibilities are endless. Check out more custom enrichments in our no-code enrichment round-up.

When working with Gigasheet, there’s no need to have an expertise in coding or working with databases. Instead, you explore big data like a regular spreadsheet tool. And here’s the best part – Gigasheet is free! Sign up and give it a try.

The ease of a spreadsheet with the power of a database, at cloud scale.

No Code
No Database
No Training
Sign Up, Free

Similar posts

By using this website, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.