Initial commit: CI Agent competitive-intelligence monitoring app
FastAPI + Celery + Next.js + Postgres/Redis app with company monitoring, source collection, LLM-based change analysis, enrichment, and account security (Turnstile, escalating lockout, email verification).
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
"""Lightweight, best-effort regex extractors for specific signal types the
|
||||
severity model treats specially (pricing, leadership). These are heuristics,
|
||||
not NLP - they exist to catch the common "$X/month" and "named a new CEO"
|
||||
phrasings, not to parse arbitrary text reliably. Phase 7's LLM extraction
|
||||
task is the higher-fidelity version of this; these run cheaply and
|
||||
deterministically as part of scoring, without a model call.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
||||
_PRICE_RE = re.compile(r"\$\s?\d[\d,]*(?:\.\d{2})?\s*(?:/\s*(?:month|mo|year|yr))?")
|
||||
_LEADERSHIP_TITLE_RE = re.compile(
|
||||
r"(?i)\b(Chief Executive Officer|CEO|Chief Financial Officer|CFO|Chief Technology Officer|"
|
||||
r"CTO|President|Chairman|Chairwoman|Chairperson)\b"
|
||||
)
|
||||
|
||||
|
||||
def extract_prices(text: str) -> set[str]:
|
||||
return set(_PRICE_RE.findall(text or ""))
|
||||
|
||||
|
||||
def mentions_leadership_title(text: str) -> bool:
|
||||
return bool(_LEADERSHIP_TITLE_RE.search(text or ""))
|
||||
Reference in New Issue
Block a user