Skip to main content

Combining Shot Prompting with Sentiment Classification

Note
You can do more complex shot prompting to achieve interesting results. In this example, we will use shot prompt trick to have the AI model perform sentiment classification of student survey feedback, as well as classify the type of feedback (whether its about the teacher, course etc).
Tip
For these types of shot-prompting example, you will want to use a non-reasoning model such as 4o.

Description

Shot prompting can be combined with AI's ability to understand sentiments in order to analyze large amounts of text and assign a sentiment to each. Classification specifics are informed by the shot prompting provided to the chatbot.

Prompt


You are a college course feedback sentiment analyzer. Assistant will output well-formed CSV inside a text block.

User:
- "The assignments are graded very harshly."
- "I love how the professor incorporates current events into the lectures. It makes the material so relevant."
- "The class is too early in the morning for me."
- "I really appreciate the extra office hours. They help me clarify difficult concepts."
- "The course website is not user-friendly. It's hard to find the resources I need."
- "I show up for the class and bring the required material."

Assistant:
```
Comment,Sentiment,Category
"The assignments are graded very harshly.",NEGATIVE,COURSE
"I love how the professor incorporates current events into the lectures. It makes the material so relevant.",POSITIVE,PROFESSOR
"The class is too early in the morning for me.",NEGATIVE,COURSE
"I really appreciate the extra office hours. They help me clarify difficult concepts.",POSITIVE,OTHER
"The course website is not user-friendly. It's hard to find the resources I need.",NEGATIVE,COURSE
"I show up for the class and bring the required material.",NEUTRAL,OTHER
```

User:
- "The lecture on quantum mechanics was fascinating!"
- "I'm struggling to understand the latest assignment. The instructions were unclear."
- "Professor Smith explains concepts very clearly."
- "The course material is too advanced for beginners."
- "I love the interactive elements in this class. They make learning so much fun!"
- "The pacing of the lectures is too fast."
- "Group projects in this course are really helpful."
- "The textbook is very confusing and hard to follow."
- "The online resources provided are extremely useful. I use them all the time for studying."
- "Sometimes the class discussions go off-topic."
- "The professor is very approachable and helpful."
- "I wish there were more practical examples."
- "The course workload is overwhelming."
- "I appreciate the detailed feedback on assignments."
- "The exams are fair and cover the material well."
- "I don't feel engaged during the virtual lectures."
- "The guest speakers have been really inspiring."
- "There are too many readings assigned each week."
- "The lab sessions are my favorite part of the course. They provide hands-on experience."
- "I think the course could benefit from more visual aids."
- "The instructor's enthusiasm makes the class enjoyable."
- "I often feel lost during the lectures."
- "The study guides are very helpful for exam preparation."
- "The course doesn't seem well-organized."
- "I love the real-world applications discussed in class. They help me understand the material better."
- "It's difficult to keep up with the fast-paced lectures."
- "The TA's are very supportive and knowledgeable."
- "I feel like I'm not learning anything new."
- "The course has exceeded my expectations."
- "I wish the teacher would slow down during lectures. It's hard to take notes at this speed."

Assistant:
  

Given the analyzed data, create a pie chart showing the sentiment of the course feedback.
  

Now lets do a horizontal bar chart of the course feedback category
  

Analyze a dataset of student feedback with three columns: Comment, Sentiment, and Category. Distill the data into exactly three concise bullet-point insights:

Recurring Themes: Identify the most common positive themes and the most common negative pain-points. Reference representative phrases in parentheses.
Sentiment by Category: Summarize how sentiment is distributed across categories. Highlight where praise is concentrated and where dissatisfaction is most prevalent.
Actionable Takeaway: For the area with the highest negative sentiment, propose one evidence-based improvement that would most significantly enhance the student experience.
  

Sample Output

AI does a good job analyzing and graphing the data per the user requests. Below is one example of what the data visualizations might look like according to the prompts given above.