Skip to content

About

A processor for legislative texts via SpaCy, to produce a graph of responsibilities per important entity

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

SpaCy Law Property Graph

The SpaCy Law Property Graph is an integrated system consisting of three interoperable tools:

  1. Legislative Text Parser — converts legislative documents (PDF) into structured JSON.
  2. GraphGenerator — extracts semantic relationships between legal entities and builds Knowledge Graphs.
  3. GraphViewerApp — visualizes the resulting graphs and presents dynamic checklists for exploration.

Together, these tools automate the complex process of legal text analysis and compliance verification.


Workflow Overview

Step 1 — Document Processing

  • Input: legislative document (PDF).
  • Output: lawObject.json.
  • Performed by Legislative Text Parser.

Step 2 — Relationship Extraction

  • Input: lawObject.json, entities.txt.
  • Process: syntactic and semantic analysis using spaCy and RapidFuzz.
  • Output: relationships.json, triplets.csv, graph.graphml, merged.graphml.
  • Performed by GraphGenerator.

Step 3 — Visualization and Exploration

  • Input: merged.graphml, relationships.json, paragraphs.json.
  • Process: interactive exploration of entities, relations, and relevant legal snippets.
  • Output: graphical and textual views.
  • Performed by GraphViewerApp.

Installation Summary

Each tool can be run independently or as part of a complete pipeline.

Tool Language Core Dependencies
Legislative Text Parser Java Swing, Maven, JSON
GraphGenerator Python spaCy, RapidFuzz, NetworkX
GraphViewerApp Python NetworkX, Tkinter

Example End-to-End Execution

# 1. Extract structured text
open LegislativeTextParser in your prefered IDE and run.

# 2. Generate relationships and graphs
python engine.py
python graphml_exporter.py
python merge_graphml_nodes.py

# 3. View checklist
open GraphViewer in your prefered IDE and run.

Output Files

File Description
lawObject.json Structured legislative text
entities.txt Entity definitions
paragraphs.json Paragraph text segments
relationships.json Extracted semantic relationships
triplets.csv Relationship table
graph.graphml / merged.graphml Knowledge Graphs ready for visualization

License

This project is developed as part of an academic thesis at the Department of Computer Science, University of Ioannina.
Use for research and educational purposes is permitted.

About

A processor for legislative texts via SpaCy, to produce a graph of responsibilities per important entity

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages