Skip to main content

A SpaCy pipeline and models for long-from legal text.

Project description


Automatic enrichment of unstructured legal text using rules-based and predictive techniques

Project Name


Project Keywords

Natural language processing; machine-learning; unstructured text data

Problem Space

Automatic enrichment of unstructured legal texts, with an emphasis on judgments and other long-form legal material (e.g. academic articles, reports etc). Enrichment of contracts is already well-served and therefore does not fall within the scope of this project.

Project Description

There is no shortage of commercial, closed-source software that uses natural language processing and computational linguists to provide insight into unstructured legal texts, such as contracts, credit agreements and leases.

The purpose of Blackstone is to apply similar techniques, technologies and strategies to other types of unstructured legal texts, particularly judgments, in order to generate an open-source model that can be used and extended by others.

Phase 1

The initial focus of the project will be to develop a model that is capable of automatically identifying the following fundamental entity types that are peculiar to legal writing:

Case titles - e.g. Regina v Smith

Neutral citations - e.g. [2019] EWCA Crim 345

Regular citations - e.g. [2015] AC 345 or [2015] 2 Cr App R 7

Primary legislation - e.g. Criminal Justice Act 2003

Secondary legislation - e.g. The Wine (Amendment) Regulations 2019

Regnal years - e.g. 8 & 9 Geo. 6, c. 4

Phase 2

The second phase of the project will focus on extending the model developed in Phase 1 to identify the following:

Instances in which the author appears to postulate an axiom of the law (e.g. It is a well-established principle that...) Instances of ratio in judgments Instances in which earlier authority is being subjected to "judicial consideration" going beyond mere citation (e.g. where an earlier authority is subject to positive or negative judicial consideration)



XML archive of law reports published by ICLR dating back to 1865 and raw text of unreported judgments dating back to 2000.


Python 3.6+

Core Libraries

spaCy and Pandas

Other tools

Prodigy for model refinement and testing, Jupyter for experiments.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blackstone-0.1.0.tar.gz (11.7 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page