← All packages

@lacspace/sensitivity

v1.0.0Newsroom Kit0 deps

Zero-AI first pass for a newsroom's sensitive-story gate, in Nepali and English. classify({ title, text, lang }) returns categories (election, court, death, communal, named_individual, minor, health_emergency), a confidence (certain → skip the model, unsure → ask it) and the matched terms. Bilingual lexicons with suffix-aware Devanagari matching, false-friend exclusions (death overs, climate justice, मुद्दा as 'issue', 'N वर्षका लागि'), headline/lead weighting that ignores scraped sidebar noise, harm context for minors, a person check for allegations, and policy-ruling detection for courts. On 200 real newsroom stories it settled 76% without the model. Zero-dependency.

npm i @lacspace/sensitivity

Usage

sensitivity.ts
import { classify } from "@lacspace/sensitivity";

classify({ lang: "en", title: "MP Ansari Highlights Irregularities at National Medical College", text });
// { categories: ["named_individual"], confidence: "certain", hits: [...], scores: {...}, reasons: [] }

classify({ lang: "ne", title: "राष्ट्रपतिद्वारा संघीय संसदको चालू अधिवेशन अन्त्य", text });
// { categories: [], confidence: "certain", ... }  → skip the model

classify({ lang: "en", title: "Supreme Court Orders Strict Enforcement of Plastic Bag Ban", text });
// { categories: ["court"], confidence: "unsure", reasons: ["court: policy ruling or no case/charge words"] }  → ask the model

Exports 3

CATEGORIESclassifydescribe

Keywords

newsroomcontent-moderationsensitivityclassificationnepalidevanagari

More in Newsroom Kit

@lacspace/triage

Pre-write news triage: decide which story candidates to write before spending AI tokens. Ranks by freshness decay, independent source domains (registrable-domain dedupe), trend, novelty and trust; fills per-language publish slots with category quotas; a breaking fast lane (breaking flag, or ≥3 independent sources within an hour plus trend) that jumps full slots with an hourly cap; sensitive stories need two independent sources or an official one; routine notices (bonus/right share, court notice boards) are down-ranked and grouped into roundups; stale, duplicate and would-expire-before-next-slot items are dropped. write_now / queue / drop with reasons. Deterministic, no AI, zero-dependency.

@lacspace/packfix

Targeted repair of failed AI-written story packs, instead of whole-pack rewrites. From your validator's failures it clears name false positives (descriptive Title Case phrases, names found in other-script sources via transliteration), swaps near-misspellings for the source spelling, ranks the sentences behind an 8-gram plagiarism overlap and picks the smallest set to rewrite, and neutralises judgement words (explosive, massive, shocking…) with context guards. Whatever it can't fix comes back with sentence ids, so you re-ask the model for 1–2 sentences, not the whole pack.

@lacspace/datanews

Zero-AI bilingual (English / Nepali) news stories from structured data: gold & silver prices, Nepal Rastra Bank forex rates, NEPSE market close, DHM weather forecasts and fuel prices. render(kind, data, { lang }) returns headline, deck, summary, 3-5 body paragraphs, 3 bullets, tags, category and the key numbers. Every number comes from your input, missing fields drop their sentence (never "N/A"), phrasing rotates by date, Nepali uses Devanagari numerals with lakh/crore grouping. Zero-dependency.

@lacspace/factcheck-lite

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/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.

@lacspace/feed-reader

Read 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.