Review classifier return result using symbols,"+", "-", and "NA"

Hi there,

Based on the Review classifier sample, I am able to tag my list of reviews with a given list of tags, and the result is a list of bullet points containing either positive or negative points that I provided. Now, I want the result bullet points to use symbols, “+”, “-”, and “NA” instead. I provided the instructions as below.

‘You will be presented with user reviews and your job is to provide a set of tags from the following list. Provide your answer in bullet point form, use symbol "+" to represent a positive tag, use symbol "-" to represent a negative tag. If neither positive nor negative is chosen, use "NA" to represent the result. Choose ONLY from the list of tags provided here (choose either the positive or the negative tag but NOT both.):\n’

The result is still a list of tags like before the change. How to achieve my desired result? Thank you

Welcome to the forum.

What model and settings are you using?

I would give it a quick one-shot example personally.

I followed the sample, OpenAI Platform

If I use the same system message as the sample, I get exactly the same result as the sample. I changed the system message content with the instruction I provided above, and I got same result, no change. I am using gpt-3.5-turbo

Here you go… I added this to your system prompt. I think this is what you want?

If it is positive, prepend the bullet point with a + and if it is negative, prepend the bullet with -

Example:

+ Easy to use
- Poor overall quality



ETA: Fixed prepend/append typo…

1 Like

Thank you. If neither the positive tag nor negative tag is chosen from a specific pair of tags, is it possible to add “NA” in the bullet point, indicating that the review does not talk about this particular aspect?

The reason that I would like the result to use symbols, “+”, “-” and “NA”, instead, is that I would like to calculate the statistics of the reviews. To find out with a given set of reviews, towards a particular aspect, how many reviews are positive, how many are negative, and how many does not discuss this aspect

From the playground preset example.

Modify system:

You will be presented with user reviews and your job is to provide a set of tags from the following list. Provide your answer in output format. Choose ONLY from the list of tags provided here:

(…)

add to system:

\ output format
X - tag

where
X = {“good”: “+”, “bad”: “-”, “neutral”: “n/a”}

results:

+ Easy to use
+ Comfortable to sleep on
- Not durable
- Loses air overnight
- Difficult to transport
- Difficult to store

(result not compatible with markdown, in code block we get diff)

1 Like

Thank you. I am new with the APIs. Where should I implement the change? Do I modify the system message content?

for the linked playground share. I gave you a replacement paragraph for the start of system.

Then scroll down to the bottom of system, and put a blank line, then add the output format definition (that is referred to in the first paragraph)


Before the output format heading, I used two backslashes (\\) that the forum turned into one, but you can use whatever commenting technique brings the AI’s attention to that section.

Breaking a system prompt into different labeled sections for their different purposes can be a useful technique.

I got it. Thank you so much for the help

1 Like