DEV Community

Pulsebit News Sentiment API
Pulsebit News Sentiment API

Posted on

Your Pipeline Is 11.0h Behind: Catching Business Sentiment Leads with Pulsebit

Your Pipeline Is 11.0h Behind: Catching Business Sentiment Leads with Pulsebit

We recently discovered a striking anomaly: a 24-hour momentum spike of +0.750 related to business sentiment. This spike, led by English press coverage, reveals that we’re witnessing a notable uptick in discussions surrounding a recent MBA launch of a locally-sourced food business, as reported by the Cornell Chronicle. With only one article contributing to this cluster, it raises the question: how did our pipeline miss this significant shift in sentiment?

Your model missed this by 11.0 hours. The leading language was English, and the dominant entity here is the MBA program launching a locally-sourced food initiative. If your pipeline isn't equipped to handle multilingual sources or detect emerging themes quickly, you risk being significantly behind the curve when it comes to capturing crucial business insights.

English coverage led by 11.0 hours. Ca at T+11.0h. Confidenc
English coverage led by 11.0 hours. Ca at T+11.0h. Confidence scores: English 0.90, Spanish 0.90, French 0.90 Source: Pulsebit /sentiment_by_lang.

Here’s the code we used to catch this anomaly in real-time. First, we filter for English-language articles focusing on the business topic with a score of +0.278 and a confidence of 0.90. The API call looks like this:

Left: Python GET /news_semantic call for 'business'. Right:
Left: Python GET /news_semantic call for 'business'. Right: returned JSON response structure (clusters: 3). Source: Pulsebit /news_semantic.

import requests

url = "https://api.pulsebit.io/v1/articles"
params = {
    "topic": "business",
    "lang": "en",
    "score": 0.278,
    "confidence": 0.90,
    "momentum": 0.750
}

response = requests.get(url, params=params)
articles = response.json()
Enter fullscreen mode Exit fullscreen mode

Next, we pass the cluster reason string back through our sentiment analysis to score the narrative framing itself. This gives us critical insight into how the themes are perceived. The input for this step is:

meta_sentiment_input = "Clustered by shared themes: mba, launches, locally-sourced, food, recent."
sentiment_response = requests.post("https://api.pulsebit.io/v1/sentiment", json={"text": meta_sentiment_input})
sentiment_score = sentiment_response.json()
Enter fullscreen mode Exit fullscreen mode

By utilizing this approach, we can effectively capture and evaluate the sentiment around emerging business themes in real-time.

Now, let’s explore three specific builds we can implement with this pattern.

  1. Geo-Filtered Alerts: Set up an alert for momentum spikes in the business sector, using a geographic filter for regions that are primarily English-speaking. This way, you can catch momentum shifts as they happen, allowing you to respond quickly.

Geographic detection output for business. Hong Kong leads wi
Geographic detection output for business. Hong Kong leads with 2 articles and sentiment +0.82. Source: Pulsebit /news_recent geographic fields.

   params = {
       "topic": "business",
       "lang": "en",
       "momentum": 0.750
   }
Enter fullscreen mode Exit fullscreen mode
  1. Meta-Sentiment Dashboard: Create a dashboard that visualizes sentiment scores for clustered themes. By continuously feeding back the cluster reason strings into our sentiment analysis, you can keep a pulse on how narrative framing affects public perception.

  2. Forming Theme Analysis: Investigate forming themes with a specific focus on the terms ‘business’, ‘google’, and ‘after’. By scoring these terms against mainstream topics like ‘mba’ and ‘launches’, you can identify potential opportunities or threats in the sentiment landscape.

Implementing these builds will give you a smarter, more responsive pipeline that captures sentiment shifts before they become mainstream news.

Ready to get started? Visit pulsebit.lojenterprise.com/docs. You can copy, paste, and run this code in under 10 minutes to start capturing these insights yourself.

Top comments (0)