@lacspace/trend-detect
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-detectUsage
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_STOPKeywords
More in Newsroom Kit
Deterministic fact-consistency checks for generated articles — extract every number, amount, percentage, date and named entity (Devanagari digits, लाख/करोड scaling, रु/NPR, %/प्रतिशत, AD + Bikram Sambat dates) and verify each appears in, or is derivable from, the sources. Catches fabricated or drifted figures without an LLM rewrite round; cross-script entity matching via @lacspace/translit. Isomorphic, deterministic.
@lacspace/feed-readerRead the feeds you follow — the read-side complement to @lacspace/rss. Parse a fetched RSS 2.0, RSS 1.0 (RDF), Atom 1.0 or JSON Feed 1.1 body into one normalized shape, autodiscover the feeds a web page advertises, and score each source's health (staleness vs its own cadence, duplicate/poisoned items, volume spikes, missing fields, fetch error rate) so a large source list prunes itself. Robots.txt respect via @lacspace/robots. Deterministic, isomorphic, zero third-party deps, bring-your-own-fetch.