Christian Caron, PhD
Sentiment Analysis of Hacker News Posts
This analysis examines the emotional tone of top-ranked stories on Hacker News, a popular social news platform focused on technology, startups, and programming. Using the AFINN sentiment lexicon, I assigned each story title a numeric score based on the emotional weight of its words. Positive words like "breakthrough" or "improve" increase the score, while negative words like "crash" or "failure" decrease it. Neutral words contribute nothing.
Tone of Top Hacker News Stories
The histogram below shows how sentiment scores are distributed across thousands of top Hacker News headlines. Most posts cluster around a sentiment score of zero, meaning they are emotionally neutral. This pattern aligns with Hacker News’s content focus, which often includes technical topics, product releases, and factual reporting that tends to avoid emotionally charged language.
​
That said, a smaller number of headlines lean strongly positive or negative. These tend to reflect news involving excitement (e.g., product breakthroughs) or controversy (e.g., layoffs, regulation, or public backlash). Still, the overall takeaway is that neutral sentiment dominates the platform’s headline tone.
Distribution of Sentiment Scores

The Impact of Story Sentiment on Engagement
The interactive scatterplot below explores the relationship between a post’s sentiment score and its engagement, measured by the number of comments (or "descendants"). Each point represents a single Hacker News article. The green line represents a LOESS (locally estimated scatterplot smoothing) curve. LOESS is a flexible, non-linear method that fits smooth lines through data by averaging nearby points.
​
The gentle U-shaped relationship between sentiment and engagement suggest that posts with strongly positive or negative sentiment tend to attract more comments than neutral ones. In other words, emotionally charged headlines—whether uplifting or provocative—appear to generate higher engagement from the Hacker News community.
​
Still, the relationship is modest, and many neutral posts also receive significant attention, especially when covering timely or technically relevant topics.