# Promoting for sentiment analysis

**URL:** <https://community.openai.com/t/promoting-for-sentiment-analysis/540090>\
**Category:** Prompting\
**Tags:** gpt-35-turbo, chatgpt, api\
**Created:** [December 3, 2023, 7:16am UTC](https://community.openai.com/t/promoting-for-sentiment-analysis/540090 "2023-12-03T07:16:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasonwxz111](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/jasonwxz111/32/168329_2.png) [@jasonwxz111](https://community.openai.com/u/jasonwxz111)\
**Post date:** [December 3, 2023, 7:16am UTC](https://community.openai.com/t/promoting-for-sentiment-analysis/540090/1 "2023-12-03T07:16:59Z")

</div>

To use the chatgpt prompt to perform a sentiment analysis function, how to write this prompt?  
prompt = f"“”  
what is the sentiment of the following product review,  
which is delimited with triple backticks?  
Review text: ‘’‘{review}’‘’  
“”"  
response = get\_complention(prompt)  
print(response)

---

<div class="post-metadata">

**Author:** ![jr.2509](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@jr.2509](https://community.openai.com/u/jr.2509)\
**Post date:** [December 3, 2023, 9:59am UTC](https://community.openai.com/t/promoting-for-sentiment-analysis/540090/3 "2023-12-03T09:59:34Z")

</div>

Hi Jason - although the task is obvious, I would give the model choices to draw from for more consistent responses. In your prompt, you can just add: Choose from: good, bad, neutral. (or whatever categorization you had in mind).

For this type of task, finetuned models come in really handy. Depending on the specific circumstances there may be nuances to the sentiment analysis that GPT models can’t differentiate without training.

---

<div class="post-metadata">

**Author:** ![raymondyeh](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/raymondyeh/32/266374_2.png) [@raymondyeh](https://community.openai.com/u/raymondyeh)\
**Post date:** [December 3, 2023, 11:12pm UTC](https://community.openai.com/t/promoting-for-sentiment-analysis/540090/4 "2023-12-03T23:12:31Z")

</div>

It seems like you might be reading the output programmatically, if that is your use case, you might want to [write a function](https://platform.openai.com/docs/guides/function-calling) instead, that will ensure the output can be processed by your program all the time.
