Learn Before
Example

Example of In-Context Learning for Sentiment Classification

A practical application of in-context learning involves providing a Large Language Model with several examples of text classified by sentiment directly in the prompt. For instance, a prompt might first provide examples like 'I had an amazing day at the park!' (Positive), 'The service at the restaurant was terrible.' (Negative), and 'I think it's going to rain today.' (Neutral). Based on these demonstrations, the model can then successfully classify a new text, such as 'This movie was a fantastic journey through imagination.', as 'Positive'.

0

1

Updated 2026-04-29

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.2 Generative Models - Foundations of Large Language Models