Scoring a Review by Counting Cues
Add up positive minus negative hits.
Scoring a Review by Counting Cues is a free NLP Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the NLP Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
The Core Idea
To judge a review, count positive cue words, count negative ones, and compare. This simple score already captures a lot of the feeling.
Tokenize First
Split the review into words before counting. Each token becomes one thing you can check against your positive and negative lists.
tokens = review.lower().split()Count the Hits
Loop over the tokens and tally matches. Every word in the positive set adds to pos; every negative word adds to neg.
pos = sum(t in positive for t in tokens)
neg = sum(t in negative for t in tokens)Subtract for a Score
The overall score is positive hits minus negative hits. A larger number means a happier review, and a negative one means complaints.
score = pos - negTurn Score Into a Label
Map the number to a verdict. A score above zero is positive, below zero is negative, and exactly zero is neutral.
label = "positive" if score > 0 else "negative" if score < 0 else "neutral"A Worked Example
For I love this but the price is bad, you get one positive and one negative hit, so the score is zero, a neutral verdict.
Wrap It in a Function
Bundle the steps into a reusable function so you can score any review with a single call instead of repeating the logic.
def score_review(text):
toks = text.lower().split()
return sum(t in positive for t in toks) - sum(t in negative for t in toks)Strengths of Counting
This method is fast, needs no training data, and is easy to explain. That transparency makes it a great first baseline for any project.
It Ignores Word Order
Counting treats text as a loose bag, so it cannot tell good not from not good. Losing order is its biggest blind spot.
Repeated Cues Add Up
Saying great, great, great counts three times and rightly pushes the score higher, since strong feeling often repeats key words.
When Counting Falls Short
Mixed reviews and subtle wording can produce a misleading zero. That is your signal a learned model may serve you better later.
Quick Check
Trace the logic on a short sentence.
Recap
You scored reviews by counting cues: tokenize, tally, subtract, then label by sign. It is fast and clear but ignores word order. Next we fix negation traps. ✅
Frequently asked questions
Is the “Scoring a Review by Counting Cues” lesson free?
Yes — the full text of “Scoring a Review by Counting Cues” is free to read here on the web, and the NLP Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the NLP Academy course, upgrade to CoddyKit PRO.
What will I learn in “Scoring a Review by Counting Cues”?
Add up positive minus negative hits. You practise NLP Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start NLP Academy?
No prior experience is required. NLP Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Scoring a Review by Counting Cues” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this NLP Academy lesson?
Yes. Every NLP Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- What Is Sentiment Analysis?
- Building a Positive and Negative Word List
- Scoring a Review by Counting Cues
- Handling Negation and Edge Cases