Sentiment Classification

A prompt template to classify text into Positive, Negative, or Neutral using OpenPrompt. Reusable for multiple sentences and suitable for demonstration in practicals.

I want to classify the sentiment of text using OpenPrompt.
Create a prompt template for sentiment classification.
The application should:

  • Take an input sentence or paragraph
  • Classify the sentiment as Positive, Negative, or Neutral
  • Use a clear and reusable prompt template
  • Make it easy to apply to multiple sentences without retraining
  • Include an example input and expected output
  • Use only OpenPrompt and a pre-trained language model
  • Provide a professional, well-commented Python implementation
Avatar

Model: