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

Hi, nice one. can you make it so that it does not try to pull content again from the ones already processed? Just in case you have to start over again to prevent duplicates.

Like

Check if row already has an output column

{ skip that topic.}

else this is a new topic
{process it}
Try this


Python:
import openai
import pandas as pd
from tqdm import tqdm

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

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

results = []
errors = []

for index, row in tqdm(df.iterrows(), total=len(df)):
    if not pd.isna(row['output']):
        # Skip this row if it already has an output column
        continue

    prompt = f"Please write a detailed article about {row['topic']}. Use this information to write the article: {row['context']}"
    try:
        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])
    except Exception as e:
        errors.append([row['topic'], row['context'], str(e)])
        continue

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

# Merge the original input dataframe with the output dataframe based on the 'Topic' column
merged_df = pd.merge(df, output_df, on='Topic', how='left')

# Save the merged dataframe to a new CSV file
merged_df.to_csv('output.csv', index=False)

if len(errors) > 0:
    # Log any errors that occurred during the script
    error_df = pd.DataFrame(errors, columns=['Topic', 'Context', 'Error'])
    error_df.to_csv('errors.csv', index=False)
The updated code uses the pd.isna() function to check whether the "output" column of a given row is empty. If the "output" column is not empty, the script skips that row and moves on to the next one. This ensures that the script doesn't attempt to generate an article for a row that has already been processed.
After all the articles have been generated, the script merges the original input dataframe with the generated articles dataframe based on the "Topic" column. This allows the script to preserve any existing columns in the input CSV file, including the "output" column if it already exists. The merged dataframe is then saved to a new CSV file called "output.csv".
 
Sorry guys for disturbing you with my stupid question : where do I start from ?

I've already installed Python with Pycharm and started learning.
I'm also familiar with OpenAi.

How do I connect the CSV file with the Python code that warriorsam53 provided ?

I've been watching many Youtube videos but I don't seem to find anything to help me get started implementing this method.
 
Sorry guys for disturbing you with my stupid question : where do I start from ?

I've already installed Python with Pycharm and started learning.
I'm also familiar with OpenAi.

How do I connect the CSV file with the Python code that warriorsam53 provided ?

I've been watching many Youtube videos but I don't seem to find anything to help me get started implementing this method.

There's chatGPT for this kind of questions, just feed him code and explain what you need to do, and he will help you
 
Sorry guys for disturbing you with my stupid question : where do I start from ?

I've already installed Python with Pycharm and started learning.
I'm also familiar with OpenAi.

How do I connect the CSV file with the Python code that warriorsam53 provided ?

I've been watching many Youtube videos but I don't seem to find anything to help me get started implementing this method.

You’ll need to place the CSV in the same folder as the script. Make sure you follow the instructions to name and format the CSV correctly.
 
There's chatGPT for this kind of questions, just feed him code and explain what you need to do, and he will help you
Thanks for the suggestion, I thought about it yesterday but chatGPT stopped working, at least for me - this is I'm seeing when I load their usual page : " This challenge page was accidentally cached by an intermediary and is no longer available."
 
You’ll need to place the CSV in the same folder as the script. Make sure you follow the instructions to name and format the CSV correctly.

You’ll need to place the CSV in the same folder as the script. Make sure you follow the instructions to name and format the CSV correctly.
Okay, at this point I think it's better for me to keep learning the basics in Python so that I can at least understand how things work since I'm not getting how I should proceed.

As you said that I need to place the CSV in the same folder as the script, then how do I use the folder?
 
Okay, at this point I think it's better for me to keep learning the basics in Python so that I can at least understand how things work since I'm not getting how I should proceed.

As you said that I need to place the CSV in the same folder as the script, then how do I use the folder?

Dont get me wrong but I really think that you should pause this thread for a period, study basic Python (as you said) and then come back. This method and code requires instaling, compiling, debuging, modifying etc etc... and if you are stuck at the csv and folders, I dont see how you can do the rest.
 
Okay, at this point I think it's better for me to keep learning the basics in Python so that I can at least understand how things work since I'm not getting how I should proceed.

As you said that I need to place the CSV in the same folder as the script, then how do I use the folder?

I’m not sure what you mean by using the folder.

Since you’re using PyCharm, you just browse to the folder using the left sidebar in PyCharm, select an interpreter and run the script.
 
Dont get me wrong but I really think that you should pause this thread for a period, study basic Python (as you said) and then come back. This method and code requires instaling, compiling, debuging, modifying etc etc... and if you are stuck at the csv and folders, I dont see how you can do the rest.
I totally get what you mean and believe me, the idea of taking my time to learn and come back when I have some knowledge in Python has crossed my mind many times.

But there's something else that's telling me that I can make this PAA method to work if I keep looking to put all necessary pieces of informaton together.

And what's motivating me even more is a domain that own, in money making niche . I created a site on it last year and was making some $$ with adsense from Reddit .

Indexing was a big problem for me and at some point I lost interest and stopped posting and sharing on Reddit. But recently, I started posting again and noticed everything I post is getting indexed in Google the same day, that's why I'd love to see if I can still get hundreds of posts to index since that's the main problem others are facing these day.
 
I totally get what you mean and believe me, the idea of taking my time to learn and come back when I have some knowledge in Python has crossed my mind many times.

But there's something else that's telling me that I can make this PAA method to work if I keep looking to put all necessary pieces of informaton together.

And what's motivating me even more is a domain that own, in money making niche . I created a site on it last year and was making some $$ with adsense from Reddit .

Indexing was a big problem for me and at some point I lost interest and stopped posting and sharing on Reddit. But recently, I started posting again and noticed everything I post is getting indexed in Google the same day, that's why I'd love to see if I can still get hundreds of posts to index since that's the main problem others are facing these day.

If you follow the instructions from the first post exactly how I’ve written them, you should be able to get it to work.

Another option is paying someone a few dollars to show you how to get it working via screen share. I’m sure someone in the HAF section or Fiverr can help you.
 
If you follow the instructions from the first post exactly how I’ve written them, you should be able to get it to work.

Another option is paying someone a few dollars to show you how to get it working via screen share. I’m sure someone in the HAF section or Fiverr can help you.
That's awesome, The Fiverr route will be my last option in case I'm not able to figure it out myself.

I've decided to dedicate 2 days (today and tomorrow) to this thread and hopefully the to know how to get the script produce content for me.

Anyways, thank you very much warriorsam53 for the patience and time to put in replying to my stupid questions.
 
What is your suggestion about publishing those content?
Should I publish all contents at a time or I should start with a little amount then increase it with time?
 
What is your suggestion about publishing those content?
Should I publish all contents at a time or I should start with a little amount then increase it with time?
I always schedule them over a few months. But that’s just a personal preference. Some people post everything in one day.
 
Guys, how do you add this to the sitemap and robots.txt for indexing?

I have these pages in the cache, but I do not see them in the index.
 
Do you guys just do it as separate articles (posts) on the site or form it through a plugin, for example DW Question Answer?
 
Back
Top