Graph-Native Infrastructure for Context and Accountable AI Systems
Python agent-memoryaiai-governanceai-infrastructureartificial-intelligencecontext-engineeringcontext-graphsdata-engineeringdecision-intelligencedeveloper-toolsexplainable-aigenerative-aigraph-ragknowledge-graphllmontologyprovenancepythonreasoningsemantic-search
fix(cli): align extract command with semantic extractor APIs
Sameer63052706188c8808
diff --git a/semantica/cli.py b/semantica/cli.pyindex 3169a5a2..69987c1d 100644--- a/semantica/cli.py+++ b/semantica/cli.py@@ -854,17 +854,46 @@ def extract(p = Path(input_path)text = p.read_text(encoding="utf-8") if p.exists() else input_pathtry:- from .semantic_extract import SemanticAnalyzer+ from .semantic_extract import (+ NERExtractor,+ RelationExtractor,+ TripletExtractor,+ EventDetector,+ SemanticAnalyzer,+ )+kwargs: Dict[str, Any] = {- "text": text, "mode": mode, "method": method,- "min_confidence": confidence,+ "text": text,+ "method": method,}+if model:kwargs["model"] = model+if temporal:kwargs["temporal"] = True- analyzer = SemanticAnalyzer(config=cli_ctx.config.to_dict())- result = analyzer.extract(**kwargs)++ config = cli_ctx.config.to_dict()++ if mode == "triplets":+ extractor = TripletExtractor(config=config)+ result = extractor.extract(text)++ elif mode == "relations":+ extractor = RelationExtractor(config=config)+ result = extractor.extract(text)++ elif mode == "ner":+ extractor = NERExtractor(config=config)+ result = extractor.extract(text)++ elif mode == "events":+ extractor = EventDetector(config=config)+ result = extractor.extract(text)++ else:+ analyzer = SemanticAnalyzer(config=config)+ result = analyzer.analyze(text)except ImportError as exc:raise click.ClickException(f"Extract module not available: {exc}") from excjson_out = _is_json(cli_ctx, local_json) or fmt == "json"