Example

Example of a Few-Shot Prompt for Polarity Classification

A concrete example of a few-shot prompt for polarity classification involves providing a large language model with an instruction and several demonstrations before asking it to classify a new input. Such a prompt begins with a task description, like 'Assume that the polarity of a text is a label chosen from {positive, negative, neutral}. Identify the polarity of the input.' This is followed by demonstrations pairing inputs with their correct labels, such as 'Input: The traffic is terrible during rush hours, making it difficult to reach the airport on time. Polarity: Negative' and 'Input: The weather here is wonderful. Polarity: Positive'. Finally, a new input is provided for the model to classify, for instance, 'Input: I love the food here. It's amazing! Polarity:'.

0

1

Updated 2026-04-15

Contributors are:

Who are from:

Tags

Ch.3 Prompting - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences

Ch.1 Pre-training - Foundations of Large Language Models

Related