import asyncio, json from services.mongo_service import MongoService async def get(): m = MongoService() r = await m.get_result("cli_2856225a") if r: print("=== COUNTERFACTUALITY SUMMARY ===") print(json.dumps(r.get("counterfactuality", {}), indent=2)) cfclaims = r.get("claim_counterfactualities", []) print(f"\n=== PER-CLAIM ({len(cfclaims)} total) ===") for c in cfclaims[:10]: t = c.get("counterfactual_type", "?") s = c.get("counterfactual_score", 0) txt = (c.get("text") or "")[:80] print(f" [{t}] score={s} {txt}") print(f"\n=== SCORES ===") print(json.dumps(r.get("scores", {}), indent=2)) claims = r.get("claims", []) print(f"\n=== CLAIMS ({len(claims)} total) ===") for c in claims[:5]: t = c.get("type", "?") conf = c.get("confidence", 0) v = c.get("verdict", "?") txt = (c.get("text") or "")[:80] print(f" [{t}] conf={conf} verdict={v} -> {txt}") print(f"\n=== KEYWORDS ===") print(r.get("keywords", [])) print(f"\n=== CITATION GAPS ===") print(r.get("citation_gaps", [])) else: print("No results found") await m.close() asyncio.run(get())