Scanned Case Law
Free Law Project scans case law reporters to complete and update CourtListener's collection. This page explains how that text is made, what it looks like, and what its limits are.
Overview
Many decisions are only published, or only get their official citations and page numbers, in printed books. To add them to CourtListener, we are scanning those books and converting the scans into structured text.
Other collections of scanned case law are usually described as "the OCR of scanned books." We built this pipeline ourselves, so we can say exactly how the text was made:
- Every page is read by three different OCR engines, which vote on the result.
- The text is reviewed by people before it is published.
- A separate model tags the parts of each case, like the parties, the court, and the judges.
How the Text Is Made
Each book goes through these steps:
Scanning. Our scanning team scans the volume and uploads it.
Page completeness review. We read the printed page numbers and check for missing, repeated, or unreadable pages. Staff review and approve each volume.
Layout detection. A machine learning tool called Blackletter finds the regions of each page, such as headnotes, footnotes, block quotes, and where each decision starts and ends.
Removal of editorial material. Content created by the publisher, like headnotes and key numbers, is redacted so it does not reach the text. Staff review the redactions. The syllabus written by the court is kept. To learn more, see why there are redactions in the case law scans.
OCR by three engines. Three OCR engines read each volume independently: dots.mocr, Surya OCR 2, and Mistral OCR.
Voting. The blocks of text from the three engines are aligned and put in reading order, and then the engines vote. If all three agree on a block, we keep it. If two agree, the majority wins. If none agree, the block is voted word by word.
Human text review. Places where the engines disagree, and other doubts, are reviewed by volunteers. The text of each decision is approved before it moves on.
Tagging. A model labels the parts of each decision: the parties, docket number, court, dates, attorneys, judges, disposition, and the author of each opinion.
Import. The approved text and its tags are merged into one XML file per decision, which is imported into CourtListener.
The code for this pipeline is open source.
Where to Find It
Scanned decisions appear on CourtListener like any other decision. In the Case Law APIs and the bulk data, you can identify and use them as follows:
The
sourcefield of the cluster and the docket says "scanning project". On clusters, this is the letterS, which can be combined with other letters when the decision was merged with one we already had.The
xml_scanfield of the opinion holds the XML of that opinion.The
filepath_xml_scanfield of the cluster holds the path to the XML of the whole decision, including its head matter and all of its opinions. To download it, see the help on file download fields.The
html_with_citationsfield of the opinion is generated fromxml_scan, and is still the best field for most purposes.The
extracted_by_ocrfield of the opinion is true.Cluster fields like
headmatter,syllabus,attorneys,disposition,other_dates, andhistoryare filled in from the head matter. When a scanned decision is merged with one we already had, we keep the values that were already there.
The XML Format
The XML follows the same general shape as the data from Harvard's Caselaw Access Project. Here is a complete, short decision:
<?xml version="1.0" encoding="utf-8"?>
<casebody firstpage="142" lastpage="142" scan-id="15349" opinion-id="67" schema="2">
<citation>388 So. 3d 142</citation>
<parties><party>James STHUBIN, Appellant,</party> <separator>v.</separator> <party>The STATE of Florida, Appellee.</party></parties>
<docketnumber>No. 3D22-0093</docketnumber>
<court>District Court of Appeal of Florida, Third District.</court>
<decisiondate>Opinion Filed October 25, 2023</decisiondate>
<history>An Appeal from the Circuit Court for Miami-Dade County, Cristina M. Miranda, Judge. Lower Tribunal No. F19-17802</history>
<attorneys>Jarlens B. Princilis, for appellant.</attorneys>
<attorneys>Ashley Moody, Attorney General, and Sandra Lipman, Senior Assistant Attorney General, for appellee.</attorneys>
<judges>Before LOGUE, C.J., and SCALES and GORDO, JJ.</judges>
<opinion type="majority">
<author>PER CURIAM.</author>
<p><disposition>Affirmed</disposition>. State v. Shearod, 992 So. 2d 900, 903 (Fla. 2d DCA 2008) ("The existence of contradictory, conflicting testimony or evidence 'does not warrant a judgment of acquittal because the weight of the evidence and the witnesses' credibility are questions solely for the jury.'") (quoting Fitzpatrick v. State, 900 So. 2d 495, 508 (Fla. 2005)).</p>
</opinion>
</casebody>
The root element is casebody. Its attributes are:
schema: the version of the format, which is currently2.firstpageandlastpage: the printed pages where the decision starts and ends.scan-idandopinion-id: our internal identifiers for the scanned volume and the decision.
Head Matter
These elements come first, before any opinion. Some of them can appear more than once:
| Element | Contents |
|---|---|
citation |
A citation of the decision. There is one element for each citation printed in the book. |
parties |
The names of the parties. It contains party elements, with separator elements between them (for example, "v."). |
docketnumber |
The docket number. |
court |
The name of the court. |
decisiondate |
The date of the decision, as printed. |
otherdate |
Other dates, like the date of argument. |
history |
The procedural history. |
attorneys |
The attorneys in the case. |
judges |
The judges who heard the case. |
disposition |
The outcome, like "Affirmed". |
heading |
A heading printed in the book. |
syllabus |
A paragraph of the syllabus written by the court. |
Some of these elements, like disposition, judges, and heading, can also appear inside the text of an opinion, as in the example above.
Opinions
After the head matter there is one opinion element for each writing in the decision. Its type attribute can be majority, plurality, unanimous, concurrence, dissent, concurring-in-part-and-dissenting-in-part, rehearing, remittitur, on-the-merits, or on-motion-to-strike-cost-bill.
Inside an opinion you will find:
| Element | Contents |
|---|---|
author |
The line naming the judge who wrote the opinion. |
p, blockquote, heading |
Paragraphs, block quotes, and headings. |
table, tr, td |
Tables. |
ul, ol, li |
Lists. |
em, strong, sup |
Italic, bold, and superscript text. |
page-number |
The start of a printed page. For example, <page-number label="123">*123</page-number> marks where page 123 begins. This is often called star pagination. |
footnotemark |
A reference to a footnote in the text. |
footnote |
A footnote, at the end of the opinion that refers to it. Its label attribute matches the footnotemark. |
figure, img |
A picture printed in the decision, like a photograph, a map, or a diagram. |
Images
Pictures are embedded directly in the XML as <img src="data:image/jpeg;base64,..."> inside a figure element. Here is an example of a decision with images.
The images are kept in html_with_citations too, so both fields can be very large. If you do not need the text fields, use field selection to leave them out of your API requests.
Known Limitations
It is still OCR. Three engines and human review remove most errors, but some typos remain. If you find one, please let us know.
Only the pagination of the scanned book is included. The
page-numberelements refer to the reporter we scanned. Page numbers from parallel reporters are not included.Formatting is approximate. Italics and bold are kept where the OCR engines found them, and bold is dropped from the head matter.
Paragraph breaks are not perfect. Occasionally a paragraph that continues across a column or a page is split in two.
The scanned PDFs are not available yet. For now we only publish the text. The
filepath_pdf_scanfield of the cluster is reserved for the PDFs, but cannot be used to download them.