← All packages

@lacspace/trend-detect

v1.0.0Newsroom Kit0 deps

Burst / trending-topic detection over your own stream of items — score entities and terms by how far their recent frequency departs from a rolling baseline (z-score + growth), per category, English + Nepali, with stopword filtering. Rank a writer queue by what's actually rising. No platform scraping, deterministic, isomorphic.

npm i @lacspace/trend-detect

Usage

trend-detect.ts
import { detectTrends } from "@lacspace/trend-detect";

const trends = detectTrends(items, { windowHours: 24, baselineHours: 168, minCount: 3, topK: 20 });
// items: { text, at, category?, terms?, id? }[]
// → [{ term: "flood", recent: 12, baseline: 1.2, z: 6.4, growth: 5.5, score: 34.1, category, items }]

Exports 3

detectTrendsEN_STOPNE_STOP

Keywords

trendingburst-detectionz-scoretopicsnewsroomrankingnepali

More in Newsroom Kit