Week 11 • Friday

Block 110: Mini-Project: Sentiment Analysis Tool

Build a complete NLP pipeline from raw text to predictions.

Concepts

Code Examples

See exercise below.

Exercise

Build a sentiment analysis pipeline: (a) with TF-IDF + Logistic Regression, (b) with Hugging Face pipeline. Compare accuracy on a labelled dataset (IMDb or similar). Report which is better and why. Wrap the better model into a simple function analyze_sentiment(text) → {'label': ..., 'confidence': ...}.

Homework

Reflection: Write a 'NLP workflow cheat sheet' — the 8 steps from raw text to a working model.