Pretrial detention challenges the presumption of innocence, requiring courts in countries such as Brazil and Italy to justify the deprivation of liberty based on specific legal factors. However, the volume and complexity of judicial decisions make manual analysis of the underlying reasoning difficult. We propose a factor-guided extraction pipeline combining Large Language Models (LLMs) and Knowledge Graphs (KGs) to extract, structure, and visualize critical legal factors from appeal cases in the Supreme Court. Building on datasets from both countries, we employ LLMs to generate summaries constrained by an expert-defined factor schema. These summaries are mapped into KGs to visualize the relationships between legal factors and judgment outcomes. We evaluated this approach against a raw-text baseline using qualitative expert review and quantitative metrics. Results demonstrate that factor-guided prompting significantly improves extraction quality, achieving higher semantic similarity (LabSE scores ≈ 0.47 vs. 0.28) compared to unguided methods. Structurally, the KGs reveal convergent reasoning complexity across the two legal systems, despite distinct topological signatures. These findings suggest that integrating LLMs with structured legal knowledge enhances the interpretability of judicial reasoning, offering a robust, scalable tool for legal analytics.
Pont et al. (Sat,) studied this question.