KarthickAdopleAI commited on
Commit
1568515
·
verified ·
1 Parent(s): cf8d6fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -497,21 +497,21 @@ class JobPotral:
497
  # Convert CSV file to a list of reviews
498
  reviews = self.csv_to_list(file_path)
499
 
500
- prompt = [
501
  {"role": "system", "content": "You are a helpful assistant."},
502
- {"role": "user", "content": f"""read and analyse to return suggestion reviews,postive reviews and negative reviews with label ***{reviews}***."""}
503
  ]
504
  # Construct the prompt for OpenAI API
505
  # Call OpenAI API with the given prompt
506
- response = self.client.completions.create(
507
  model="gpt-3.5-turbo", # You can use a different engine
508
- messages=prompt,
509
  max_tokens=200,
510
  temperature = 0,
511
  )
512
 
513
  # Extract and return the generated text
514
- self.answer += response.choices[0].text
515
 
516
  # Split the generated text into suggestion, positive, and negative reviews
517
  suggestion_reviews = self.answer.split("Suggestion Reviews:")[1].split("Positive Reviews:")[0].strip()
 
497
  # Convert CSV file to a list of reviews
498
  reviews = self.csv_to_list(file_path)
499
 
500
+ prompt_template_ = [
501
  {"role": "system", "content": "You are a helpful assistant."},
502
+ {"role": "user", "content": f"read and analyse to return suggestion reviews,postive reviews and negative reviews with label ***{reviews}***."}
503
  ]
504
  # Construct the prompt for OpenAI API
505
  # Call OpenAI API with the given prompt
506
+ response = self.client.chat.completions.create(
507
  model="gpt-3.5-turbo", # You can use a different engine
508
+ messages=prompt_template_,
509
  max_tokens=200,
510
  temperature = 0,
511
  )
512
 
513
  # Extract and return the generated text
514
+ self.answer += response.choices[0].message.content
515
 
516
  # Split the generated text into suggestion, positive, and negative reviews
517
  suggestion_reviews = self.answer.split("Suggestion Reviews:")[1].split("Positive Reviews:")[0].strip()