Designing a Public Opinion Monitoring and Marketing Attribution System for Trending Events

    This article describes how to design a system that monitors public opinion around high-controversy events and attributes marketing activity. It covers problem definition, layered architecture, data modeling, burst detection, propagation graph analysis, explainable attribution scoring, engineering practices, and evaluation metrics. The system outputs an attribution confidence score with an evidence chain instead of a binary verdict, so that human reviewers can check the findings.

    High-controversy public events often share similar technical traits: long-form narratives, dense details, spread across multiple platforms, opposing emotions, and commercial actions that follow shortly after. For technical teams, the valuable part is not watching the event itself. It is turning this pattern into computable problems: how to detect events early, reconstruct propagation paths, identify abnormal coordinated behavior, and assign explainable confidence scores to “organic spread” versus “operation-driven” activity. This article discusses design methods for a public opinion monitoring and marketing attribution system built around this goal.

    A public opinion system cannot rely only on sentiment polarity. A highly controversial event contains at least six types of objects: events, content, actors, interaction relationships, time windows, and commercial signals. An event is an aggregated topic unit. Content includes long posts, short posts, comments, and quotes. Actors must be anonymized and identified by hashes. Interaction relationships form the propagation graph. Time windows serve as baselines for comparison. Commercial signals include publicly visible promotion labels, concentrated account activity, topic creation, and time proximity to commercial campaigns.

    The system should not output a simple “marketing” or “not marketing” label. It should output a marketing attribution confidence score together with an evidence chain. For example, the system might find that an event shows a large volume of template-similar content in a short period, several accounts post on a regular schedule, the topic growth curve deviates from its historical baseline, and the activity is close in time to a group of commercial actions. In that case, the marketing attribution score is 0.78, and manual review is recommended. This output keeps the technical judgment while avoiding the conversion of a probability into a factual conclusion. For compliance, the system should follow data minimization, actor anonymization, access auditing, and purpose limitation. It should avoid collecting sensitive information unrelated to event analysis.

    2. Overall Architecture: Layered Decoupling with Unified Stream and Batch Processing

    A layered architecture is recommended. The collection layer handles multi-source ingestion, rate control, and incremental snapshots. The cleaning layer handles deduplication, normalization, entity anonymization, and quality checks. The storage layer has three tiers: raw, detail, and aggregate. The compute layer uses unified stream and batch processing. Streaming handles burst detection and alerting, and batch processing handles propagation graph reconstruction and retrospective analysis. The analysis layer covers event clustering, propagation graph analysis, intent scoring, and attribution explanation. The application layer provides alerts, dashboards, evidence chain export, and review reports.

    The infrastructure can use Baidu AI Cloud’s object storage, message queue, log service, and monitoring and alerting, or equivalent components that are self-built or selected by the same standards. The key is not to tie the design to a specific product. Raw content goes to object storage to keep snapshots. Streaming data is decoupled through a message queue. Logs and metrics go to the log service and monitoring. Analysis tasks run through containerized or batch-stream scheduling. All components should support horizontal scaling, idempotent consumption, and hot-cold data tiering, so the system can handle traffic spikes during trending events.

    3. Data Model: Events, Content, Actors, and Propagation Edges

    The core design includes four tables. The event table stores the event ID, topic summary, start and end times, platform distribution, current status, and attribution score. The content table stores the content ID, event ID, anonymized actor ID, publish time, text fingerprint, semantic vector, interaction counts, and source type. The actor table stores the anonymized actor ID, account age bucket, activity bucket, historical credibility bucket, and coordinated group ID. The propagation edge table stores the source content, target content, interaction type, timestamp, and edge weight. A feature snapshot table also saves, for each time window, the growth curve, sentiment distribution, keyword distribution, and account coordination features, which supports retrospective analysis.

    The data model should emphasize traceability. Each attribution score must drill down to specific content, specific time windows, and specific feature values. Text fingerprints support exact deduplication, and semantic vectors support approximate deduplication. Interaction counts must distinguish exposure, clicks, comments, quotes, and other signals, and these signals should not be summed directly. Actor information should be anonymized as early as possible. Raw identifiers should be kept only in a controlled audit environment, with a minimum retention period.

    4. Event Detection and Burst Identification

    Event identification starts with content clustering. Keyword recall, semantic vector similarity, and propagation graph community detection can be combined. Keywords ensure recall, semantic vectors improve aggregation across different wordings, and graph communities prevent unrelated discussions from being forced together. After clustering, the system computes a growth curve for each candidate event and compares it with the historical baseline using sliding windows. Common methods include exponentially weighted moving averages, standard deviation normalization, and multi-signal fusion. Thresholds should not be fixed. They should be calibrated by platform, time of day, holidays, and account scale.

    The pseudocode is as follows:

    1. function detect_burst(series, window, baseline_window):
    2. baseline = ewma(series[baseline_window])
    3. sigma = std(series[baseline_window])
    4. observed = sum(series[window])
    5. expected = baseline * length(window)
    6. z = (observed - expected) / max(sigma * sqrt(length(window)), eps)
    7. return z > dynamic_threshold(platform, hour, holiday)

    Burst detection only answers whether something is abnormal. It does not answer why. Burst signals should therefore be passed downstream together with content, account, and propagation structure features. For long-form response events, text length, citation density, and the share of secondary creation may all rise together. The system should record these auxiliary signals instead of relying only on interaction volume.

    5. Propagation Graph and Influence Analysis

    The propagation graph uses content as nodes and reference, comment, and repost relationships as directed edges. Edge weights can combine time decay, interaction type, and the strength of cross-platform jumps. Node features include follower count bucket, account age bucket, historical activity, historical credibility, and whether the node belongs to a known coordinated group. Graph analysis outputs propagation depth, breadth, and speed, a list of key nodes, and community structure. Key nodes are not necessarily the accounts with the most followers. A bridge node that spans multiple communities and triggers secondary spread can be more important.

    When identifying suspected operation-driven activity, the system should focus on combined evidence. Multiple accounts post highly similar content in a short period. Posting times follow an unnatural pattern. Account groups repeatedly coordinate across several events. Growth curves rise sharply in a short time with a single interaction structure. Topic creation falls close in time to commercial actions. A single signal is easy to misjudge, so the system should output evidence weights rather than absolute conclusions. For example, high template similarity with a natural account distribution may only reflect imitation of a trend. Strong account coordination without commercial signals may indicate organized spread that is not necessarily marketing. The attribution score must preserve this distinction.

    6. Marketing Attribution Scoring and Explainable Output

    Marketing attribution can combine explainable rules with a calibrated model. The features include account coordination, template similarity, timing proximity, growth anomaly, narrative consistency, and commercial signal strength. Account coordination measures synchronized group actions. Template similarity measures repeated content structure. Timing proximity measures the distance between the topic’s start and commercial actions. Growth anomaly measures how far the growth curve deviates from the baseline. Narrative consistency measures whether long posts, short posts, and comments follow a fixed framework. Commercial signal strength measures publicly visible promotion labels and signs of concentrated paid distribution.

    The pseudocode is as follows:

    1. function marketing_score(event):
    2. features = {
    3. coordination: coordination_score(event.accounts),
    4. template_similarity: similarity_score(event.contents),
    5. timing_proximity: time_score(event.topic_start, event.business_signals),
    6. growth_anomaly: anomaly_score(event.volume_curve),
    7. narrative_consistency: narrative_score(event.contents),
    8. business_signal: signal_score(event.business_signals)
    9. }
    10. weights = load_calibrated_weights(event.platform, event.category)
    11. raw = dot(features, weights)
    12. score = calibrate(raw, event.platform, event.category)
    13. evidence = top_contributing_features(features, weights)
    14. return {score: score, evidence: evidence, need_review: score > review_threshold}

    Each score should come with an evidence chain. The chain shows which features contribute most, which time windows are involved, and which content clusters and account groups are involved. The manual review interface should support one-click drill-down and a view of counter-evidence, which avoids a black-box attribution. Model weights need periodic recalibration. The calibration set should include natural trends, organized spread, and commercial marketing, and evaluation should be grouped by platform and event type.

    7. Engineering Practice: Stability, Compliance, and Observability

    During trending events, data volume can spike within a short time, so engineering work should focus on three areas. First, idempotency and deduplication. Message consumption must handle redelivery, and content fingerprints combined with semantic similarity should remove duplicates so that repeated counting does not inflate anomalies. Second, rate limiting and sampling. Collection should respect platform quotas, analysis should sample low-value streams, and high-value events should be retained in full. Third, hot-cold tiering. Raw snapshots go to cold storage, detail data goes to warm storage, and aggregated metrics go to hot storage, which reduces query cost.

    For observability, the team should monitor collection latency, deduplication rate, event clustering recall, burst detection false positive rate, the distribution of attribution scores, and manual review time. Alerts should be tiered. Data quality alerts, burst detection alerts, high attribution score alerts, and compliance audit alerts are handled separately. All scores and evidence chains should be written to