AMKhakbaz commited on
Commit
f58f3cd
·
verified ·
1 Parent(s): be1f406

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -547,7 +547,7 @@ def categorize_responses(df, api_key, prompt=None):
547
  Categorize responses in a DataFrame using OpenAI's GPT-based API.
548
 
549
  Args:
550
- df (pd.DataFrame): Input DataFrame with columns 'id' and 'response'.
551
  api_key (str): OpenAI API key for accessing GPT-based models.
552
  prompt (str, optional): A question or explanation of the survey question for better categorization.
553
 
@@ -566,7 +566,7 @@ def categorize_responses(df, api_key, prompt=None):
566
  categories = []
567
 
568
  # Iterate through the responses in the DataFrame
569
- for response in df.drop(columns=['id']):
570
  # Construct the prompt for the specific response
571
  full_prompt = f"{base_prompt}\n\nResponse: {response}\n\nCategory:"
572
 
 
547
  Categorize responses in a DataFrame using OpenAI's GPT-based API.
548
 
549
  Args:
550
+ df (pd.DataFrame): Input DataFrame with columns 'id' and 'p1'.
551
  api_key (str): OpenAI API key for accessing GPT-based models.
552
  prompt (str, optional): A question or explanation of the survey question for better categorization.
553
 
 
566
  categories = []
567
 
568
  # Iterate through the responses in the DataFrame
569
+ for response in df['p1']:
570
  # Construct the prompt for the specific response
571
  full_prompt = f"{base_prompt}\n\nResponse: {response}\n\nCategory:"
572