Multi-stage evidence-grounded inference architecture replacing the monolithic 9B model extraction pipeline. CPU-first specialist services handle routine extraction while the 9B vLLM model is preserved for semantic adjudication of ambiguous cases. Key components: - Capability-aware inference gateway (OpenAI-compatible + Ollama) - Endpoint registry with DB migrations and REST API - Sentence-aware document segmenter (property tests) - Deterministic financial parsing with offset integrity - Symbol resolution with ambiguity detection - Specialist service (GLiNER2, dynamic batching, K8s deployment) - Company-specific sentiment (FinBERT, calibration) - Retrieval-based novelty and duplicate detection - Confidence calibration pipeline - Deterministic routing engine (property tests) - 9B adjudication layer with VRAM gating - Stock-specific impact model (features, labels, baseline, trained) - Pipeline orchestrator (state machine, queues, leases, feature flags) - Bounded parallelism (async workers, semaphore, load shedding) - Observability (tracing, metrics, alerts) - Compatibility adapter (v3→v2 golden mapping tests) - Shadow/canary promotion framework - Active learning and fine-tuning pipeline Test results: 1,161 tests pass, ruff lint clean. All 282 spec tasks completed.
27 lines
913 B
Python
27 lines
913 B
Python
"""Deterministic financial parsing for the v3 intelligence pipeline.
|
|
|
|
This package provides regex-based detection of financial entities:
|
|
- Ticker symbols ($AAPL, AAPL)
|
|
- Currencies and money amounts ($123.45, €99, $94.9 billion)
|
|
- Percentages (4%, -2.5%)
|
|
- Basis points (25 basis points, 25bps)
|
|
- Ranges ($10-$12)
|
|
- EPS values ($1.52 per share)
|
|
- Revenue figures
|
|
- Dates and fiscal periods (Q1 2024, FY2025)
|
|
|
|
Each match returns exact character offsets, literal text, and a normalized numeric value.
|
|
"""
|
|
|
|
from services.intelligence_pipeline_v3.parsing.financial_parser import FinancialParser
|
|
from services.intelligence_pipeline_v3.parsing.models import CandidateType, ParsedCandidate, PeriodAnnotation
|
|
from services.intelligence_pipeline_v3.parsing.normalizer import normalize_value
|
|
|
|
__all__ = [
|
|
"CandidateType",
|
|
"FinancialParser",
|
|
"ParsedCandidate",
|
|
"PeriodAnnotation",
|
|
"normalize_value",
|
|
]
|