Hello @Thomas Jeffery
Thanks for reaching out to us. OpenAI provides several examples and guides to help you set up your prompt according to your scenario. Here's an example prompt that you can use to analyze customer feedback and identify negative sentiment:
Given a list of customer feedback about my business, identify any negative sentiment.
Feedback:
- "I had a terrible experience at your store. The staff was rude and unhelpful."
- "Your product was defective and I had to return it twice before getting a working one."
- "I was overcharged for my purchase and it took several calls to customer service to get it resolved."
- "I love your product, but the shipping was slow and it arrived later than expected."
- "The quality of your service has gone downhill in recent months. I'm considering switching to a competitor."
Negative feedback:
- "I had a terrible experience at your store. The staff was rude and unhelpful."
- "Your product was defective and I had to return it twice before getting a working one."
- "I was overcharged for my purchase and it took several calls to customer service to get it resolved."
- "The quality of your service has gone downhill in recent months. I'm considering switching to a competitor."
In this prompt, you provide a list of customer feedback and ask OpenAI to identify any negative sentiment. You can modify the prompt to include your own customer feedback and business information.
To use this prompt with the OpenAI API, you can use the "davinci" engine and the "text" prompt format. Here's an example of how to use the API in :
import openai
openai.api_key = "YOUR_API_KEY"
def analyze_customer_feedback(feedback_list):
prompt = "Given a list of customer feedback about my business, identify any negative sentiment.\n\nFeedback:\n"
for feedback in feedback_list:
prompt += f"{feedback}\n"
prompt += "\nNegative feedback:"
response = openai.Completion.create(
engine="davinci",
prompt=prompt,
max_tokens=1024,
n=1,
stop=None,
temperature=0.5
)
negative_feedback = response.choices[0].text.split(":")[1].strip()
return negative_feedback
You can call this function and have a try.
Regards,
Yutong
-Please kindly accept the answer and vote 'Yes' if you feel helpful to support the community, thanks a lot.