[METHOD] Make Your Own PAA Site With OpenAI - Complete Tutorial + FREE Python Script

Alright. So whar is your approach now to produce factual content?

I use an existing dataset or a VA to research the info for me. I use a CSV with accurate data and generate content based on that.

I also use PAA answers as the basis for generating articles for some sites.
 
This is very nice of you to share, thank you!
I am making content already with ChatGPT and I use a few different prompts for blogs that have given me great results. Articles that rank an pass the AI test. You can find a lot of them with the AIPRM chrome extention for ChatGPT. I can really recommend it.

But unfortunatly I am struggeling to understand the use of python, I am a complete noob with it. I installed Pycharm and put the script in with my own input for the articles. Also added the API key and made the input list.
I get the error: ModuleNotFoundError: No module named 'openai'
I have no idea how to fix this problem. Maybe someone can point me in the right direction?
 
This is very nice of you to share, thank you!
I am making content already with ChatGPT and I use a few different prompts for blogs that have given me great results. Articles that rank an pass the AI test. You can find a lot of them with the AIPRM chrome extention for ChatGPT. I can really recommend it.

But unfortunatly I am struggeling to understand the use of python, I am a complete noob with it. I installed Pycharm and put the script in with my own input for the articles. Also added the API key and made the input list.
I get the error: ModuleNotFoundError: No module named 'openai'
I have no idea how to fix this problem. Maybe someone can point me in the right direction?

Have you installed the OpenAI package in PyCharm?
 
I got this error @warriorsam53
"NameError: name 'df' is not defined"

That's strange, nobody has reported such an error. I'm not sure why you're getting it.

Have you modified the script? Or changed this line? df = pd.read_csv("input.csv")

If not, please check your setup. You could also try some of the modified scripts other people have posted that improved upon the original script.
 
That's strange, nobody has reported such an error. I'm not sure why you're getting it.

Have you modified the script? Or changed this line? df = pd.read_csv("input.csv")

If not, please check your setup. You could also try some of the modified scripts other people have posted that improved upon the original script.
I only modified the prompt and that's all. I will try the modified scripts.
Thanks
 
I'm getting a "SyntaxError: multiple statements found while compiling a single statement" message when trying to run the script. Any ideas?
 
I had Chat GPT make a script from scratch. Seemed like fun to try. It's working. :)
Seems to me it would be nice to share the basics here with you guys. Use your own prompt for better output!
I just don't seem to get the format as it should be here in my post....

import openai import csv # Set up OpenAI API credentials openai.api_key = "YOUR_API_KEY" # Load input CSV file with open("input.csv", "r") as input_file: csv_reader = csv.DictReader(input_file) rows = list(csv_reader) # Generate articles for each topic/context pair using GPT-3 articles = [] for row in rows: prompt = f"{row['topic']}\n\n{row['context']}\n\nWrite an article about {row['topic']}." response = openai.Completion.create( engine="text-davinci-002", prompt=prompt, max_tokens=2048, n=1, stop=None, temperature=0.5, ) article = response.choices[0].text.strip() articles.append({"topic": row["topic"], "article": article}) # Save output CSV file with open("output.csv", "w", newline="") as output_file: fieldnames = ["topic", "article"] csv_writer = csv.DictWriter(output_file, fieldnames=fieldnames) csv_writer.writeheader() for article in articles: csv_writer.writerow(article)

Chat GPT even gave extra instructions:
Here's how you can use this script:

  1. Replace YOUR_API_KEY with your OpenAI API key.
  2. Create an input CSV file called input.csv with a list of topics and contexts. The first row should be named "topic" and the second row should be named "context". Additional rows should contain the topics and contexts for each article.
  3. Run the script. It will generate an article for each topic/context pair using GPT-3, and save the resulting articles to an output CSV file called output.csv. The output CSV file will have two columns: "topic" and "article".
 
This is my SEO Minion output, not formatted like yours OP @warriorsam53 and this is where my trouble begins.

output1.JPG

Up to today, in excel, I've gotten this format to the 'cell' format by selecting the A row and going to Data > Delimiter > check the 'comma' option, uncheck the 'tab' option and then everything is prorperly celled. However if I do that and delete the unwanted rows(parent, URL and URL Title), and save again, python app still thinks there are 4+ rows in the .cvs file. Any help would be appreciated.
 
@warriorsam53 I have this error: AttributeError: partially initialized module 'openai' has no attribute 'Completion' (most likely due to a circular import)
Any help?
Thank you
 
This is my SEO Minion output, not formatted like yours OP @warriorsam53 and this is where my trouble begins.

View attachment 248876

Up to today, in excel, I've gotten this format to the 'cell' format by selecting the A row and going to Data > Delimiter > check the 'comma' option, uncheck the 'tab' option and then everything is prorperly celled. However if I do that and delete the unwanted rows(parent, URL and URL Title), and save again, python app still thinks there are 4+ rows in the .cvs file. Any help would be appreciated.

You're complicating things and making it harder for yourself. It's really simple and you don't need to use Delimiters or anything else. The output generated by SEO Minion is a CSV. Just delete the columns you don't need and save them. If that doesn't work, just copy the entire column of text into a text editor if you have to and then stick it into Excel or whatever else you're using to export the CSV.

If you follow the instructions from the original post, you'll get it to work.

@warriorsam53 I have this error: AttributeError: partially initialized module 'openai' has no attribute 'Completion' (most likely due to a circular import)
Any help?
Thank you

What version of Python are you running? What have you named your script file?
 
I am using python 3.11.2 and saved the script in a file called openai.py

Try changing the name of the file to something else. You can use some random string as the name.

If that doesn’t work, I’m not sure what the problem is. Maybe hire someone to get it to work on your setup.
 
No need to waste money on buying PAA sites. You can make your own PAA site with hundreds of posts in a few hours.

Here's an easy tutorial and python script to make your own PAA site.

I don't like combining multiple PAA questions in one post so tutorial will show you how to create an article for each PAA question.

The only thing you'll need to refine is the prompt you use to create the content with OpenAI. I've included a very basic prompt. The output with this prompt is not going to be great. The output may even be too short to be usable.

You'll need to come up with your own prompts that are tailored for your niche.

DO NOT skip this step.

Prompts are the most important part of the entire process. Take some time and come up with a great prompt that'll produce high quality content.




Step 1: Select a niche

I recommend selecting a sub-niche within a broader niche. Working with smaller niches is much easier and you can build topical authority and rank quickly. For this tutorial, I'm going to use "Yerba Mate" as an example.

If this is your first time, I recommend selecting a super small niche like the one in the example.

Step 2: SEO Minion

Step 2 is straight forward. Use a VPN server in your target country, Google the main head term and scrape the PAA using the SEO Minion Chrome extension. You can use as many levels as you like. I'm using 8 levels for this example.

Step 3: Remove Duplicates

Use Excel/Numbers/Google Sheets to remove the duplicate PAAs. SEO Minion doesn't remove the duplicates so it has to be done manually. Also, make sure that all the PAA's are related to the topic. Sometimes, the PAA's have no relation to the topic. I suggest taking the time and manually going through the questions. Remove anything that isn't relevant.

Step 4: Prepare The CSV

We need to prepare the CSV for the script. It's pretty easy to do.

This is the output from SEO Minion:

View attachment 239045


Delete all the columns except PAA Title and Text. Rename PAA title to topic. Rename Text to context.

This is how the final CSV should look:

View attachment 239046

Rename the file as "input.csv".

Step 5: Use OpenAI to Generate Content

You're now ready to generate content using the OpenAI API. You'll need to use your OpenAI API key.

Here's the Python code you need to use:

Code:
import openai
import pandas as pd

df = pd.read_csv("input.csv")

# Set OpenAI API key
openai.api_key = "YOUR_API_KEY"

results = []

for index, row in df.iterrows():
 
    prompt = f"Please write a detailed article about {row['topic']}. Use this information to write the article: {row['context']}"
    response = openai.Completion.create(engine="text-davinci-003", prompt=prompt, temperature=0.7,max_tokens=2048,top_p=0.5)
    results.append([row['topic'], response.choices[0].text])

output_df = pd.DataFrame(results, columns = ['Topic', 'Generated Text'])

output_df.to_csv('output.csv', index=False)

In its basic form, the prompt will use the PAA answer as context to write the article. Assuming that the PAA answer that Google shows is accurate, the output generated using that as context should generate more accurate content.

Once again, YOU NEED TO CHANGE THE PROMPT. Please don't use this prompt because the output will be pathetic and short. The variable for the topic is {row['topic']} and the context is {row['context']}. Use these in your own prompt any way you see fit.

You need to customize your prompts for your specific niche. Ideally, you'd want custom prompts for each article but that takes too long when you're creating bulk content.

The output will be saved as a CSV.

Step 6: Use WP All Import

Use the WP All Import plugin to upload the content to your site. There are several tutorials that go over how you can do that. You can use some plugins for images etc.




That's pretty much it. It's super easy to get started. There are several ways to improve the output you get from OpenAI but I'm not going to get into that here.

You can also use this script for other types of content or for inserting researched data into a prompt.
Thank a alot dude
 
Back
Top