Sentiment Analysis Demo


title: "Sentiment Analysis Demo" date: "2026-03-17" description: "A proof-of-concept interactive demo showing keyword-based sentiment analysis embedded in MDX." tags:

  • demo
  • nlp
  • interactive relatedEssays:
  • machines-of-loving-grace

This is a proof-of-concept demonstrating that interactive React components can be embedded directly within MDX content pages. The portfolio's content pipeline compiles MDX at build time while preserving client-side interactivity.

Try it out

How It Works

This demo uses a simple keyword-matching approach to classify text sentiment. It maintains two word lists -- positive terms (like "great," "amazing," "wonderful") and negative terms (like "terrible," "awful," "horrible") -- and counts occurrences of each in your input.

  • Positive: More positive keywords than negative
  • Negative: More negative keywords than positive
  • Neutral: Equal counts (including zero of each)

Limitations

Keyword-based sentiment analysis is intentionally naive. It cannot understand context, sarcasm, or nuance. The sentence "This is not great" would be classified as Positive because it contains "great" -- the negation is invisible to keyword matching.

Real sentiment analysis uses transformer models that understand token relationships and contextual meaning. This demo validates the MDX-to-React pipeline, not the state of NLP.