RAP Scanner


Turn a California criminal-history record into structured data, with a source for every value.

From RAP sheet to usable case record


A RAP sheet is the California Department of Justice's record of a person's arrests, court cases, and sentences. RAP Scanner reads these dense, inconsistently formatted PDFs and handles the slow, error-prone work an attorney would otherwise do by hand — extracting each conviction, charge, disposition, and sentence into a structured case file that legal aid teams use for record-clearance work.

RAP sheets are printed in a terse, teletype-era format, arrive as scans of variable quality, and layer later court and custody events over earlier ones. RAP Scanner reads them deterministically, using explicit, inspectable rules. The same input produces the same result, and every value can be traced to the line that produced it.

4

Phases from PDF to structured record

~23

Fields captured per charge before interpretation

800+

Explicit parsing and interpretation rules

100%

Of output values trace back to a source line

Scope

RAP Scanner structures the record. The Access Project's Clean Slate Engine uses that structured information to analyze eligibility under California record-clearance laws. An attorney reviews the results before anything is filed.

The pipeline

Four phases


Phase 1OCR

Text extraction

AWS Textract converts the PDF to text and preserves the page structure.

Phase 2Rules

Parse

The parser turns the OCR text into structured rows, one per charge or event, while preserving the wording on the sheet.

Phase 3Rules

Interpret each row

Rules separate statute codes, identify courts and counties, and read custody and probation terms from the sentence text.

Phase 4Rules

Connect the record

Rules link later court actions to earlier convictions, merge duplicate case entries, trace probation history, and identify dismissed counts.

OutputOutputs

Send to review

The cases populate the client's Clean Slate Engine profile, with a review document and a color-highlighted copy of the RAP sheet.

An optional AI assist can be enabled for a small number of unresolved fields. It fills blank fields only and never replaces a value produced by the rules. See AI & privacy.

The parser

How the parser reads a RAP sheet


The parser works through the OCR text from top to bottom. It recognizes the recurring labels and sections used on California RAP sheets, then copies the relevant text into defined fields. Parsing runs locally after OCR and uses the same ordered rules each time.

Structure

Names and aliases

The subject's legal name and aliases appear at the top of the record. The parser groups them so later entries can be tied to the same person.

Court and custody blocks

Each COURT: or CUSTODY: block records an event cycle with a date, location, and case number. Prison and juvenile custody entries are kept distinct.

Counts and later events

Each CNT: marks a charge. Later dated lines may record a dismissal, reduction, probation revocation, or sentence change. The parser links those events to the count they affect.

Steps

The parser cleans common OCR noise, reads the name and alias lines, splits the record into court and custody blocks, reads each block's date, location, and case number, and then extracts its counts and later events. It keeps convictions, relief, wardships, and limited contextual entries while excluding arrest-only and administrative material. Each retained count or event becomes its own row.

Example

This illustrative court block shows how a conviction moves from OCR text to transcription and then interpretation. It does not depict a real person.

Conviction Dismissed Custody sentence
Raw OCR textWhat the sheet says
COURT :
NAM: : 002
20040907 CASC MCEL CAJON
CNT 001
#C243209DV
273.5 (A) PC-INFLICT
  CORPORAL INJ:SPOUSE
DISPO: DISMISSED
CNT 002
SEE COMMENT FOR CHARGE
TOC:N
*DISPO: CONVICTED
CONV STATUS : MISDEMEANOR
SEN: 003 YEARS PROB,
  020 DAYS JAIL, FINE
COM: CNT 02 CHRG-242
  (A) (1) PC
DCN T6011582980437000
Parsed rowPhase 2 · transcription
group_type        COURT
block_type        count
case_number       C243209DV
date              9/7/04
location          CASC MCEL CAJON
count_no          002
section_desc      SEE COMMENT FOR CHARGE
disposition       CONVICTED
conviction_type   MISDEMEANOR
sentence          003 YEARS PROB,
                  020 DAYS JAIL, FINE
comment           CNT 02 CHRG-242
                  (A) (1) PC
InterpretedPhases 3 and 4
county_1             San Diego
courthouse_1         El Cajon
conviction_date_iso  2004-09-07
code_1               PC
section_1            242 (A)(1)
description_1        BATTERY
conviction_type_1    MISDEMEANOR
custody_period_1     20 days jail
probation_granted    Yes, 3 years
What changed

Count 001 was dismissed, so it is excluded from the conviction output. Count 002 says only "SEE COMMENT FOR CHARGE." Phase 2 preserves that wording and the related comment. Later rules identify 242 (A)(1) PC from the comment, map MCEL CAJON to the El Cajon courthouse, and read three years of probation and 20 days in jail from the sentence. Each change is recorded with its rule and source.

How each field is read


Each field has its own rules, based on patterns found across California RAP sheets. The rules account for common OCR errors while preserving the source text for review.

Dates

Eight-digit date strings are cleaned and converted into standard dates. The original text remains available for comparison.

20180822 8/22/18 "20.20.0115" 20200115

Statute citations

A charge is separated into its section, code, and description. Joined statutes stay together, and qualifiers such as ATTEMPTED are preserved.

484/488 PC-THEFT/PETTY THEFT section 484/488 · code PC description THEFT/PETTY THEFT

Dispositions

The rules recognize about 50 disposition terms, including common OCR versions of words such as "convicted." These terms determine which counts represent convictions, dismissals, or relief.

CONVICTED · CONVICK · CONYICT · C0NVICT treated as a conviction

Custody and sentence

Sentence text is split into prison, jail, probation, and fine terms, with the duration of each stored separately.

"036 MO PROB, 020 DAYS JAIL" probation 36 months · jail 20 days

Case numbers

Spaces, dashes, and leading symbols are removed for matching. The rules also account for common OCR substitutions when the same case appears elsewhere.

"# C 24-3209 DV" C243209DV

Courts and counties

The location text is compared with a maintained directory of California courts and common OCR variations, then mapped to a courthouse and county.

CAST / CASP / CASV CASC "MCEL CAJON" El Cajon · San Diego

Complex records

Handling changes across a record


The most difficult records contain related events separated by years, pages, or OCR errors. The rules connect those entries and preserve the current status of each conviction.

Later court actions

A later entry may revoke probation, change a sentence, dismiss a conviction, or reduce a felony. The scanner links that entry to the affected count and updates the final case history.

Dismissals and reductions

The scanner recognizes set-asides and dismissals under statutes such as Penal Code 1203.4, as well as reductions under Proposition 47, Proposition 64, and Penal Code 17(b). It records the legal basis when the sheet provides enough information to identify it.

Multiple counts and repeated cases

Each count remains separate. When a case appears in more than one block, the scanner combines the entries into the most complete record while preserving count-level details. Sentencing enhancements are separated from the underlying charge.

OCR errors and wrapped text

The scanner repairs recognized OCR errors, rejoins wrapped charge and comment lines, and removes form text that has been attached to a case entry.

Maintained reference tables

Court names, statute information, sentencing enhancements, and wobbler status live in reviewable reference tables. They can be updated as the law and court practices change.

Traceability

Every row has a permanent ID. Each interpreted value is stored with the rule and source text that produced it. A reviewer can trace a final value from the case file to the rule, the source line, and the page of the RAP sheet.

Integration and outputs

Built into the Clean Slate Engine


RAP Scanner is built into the Clean Slate Engine. A user uploads a RAP sheet, and the extracted cases populate on the client's profile for review and eligibility analysis. The scanner also generates a RAP Summary and a highlighted copy of the record.

Clean Slate Engine case file

Identifiable convictions are loaded onto the client profile for review and analysis.

RAP Summary

A Word document summarizes the client's case history, missing information, extraction warnings, and any entries that need closer review.

Highlighted RAP sheet

The original PDF is returned with color-coded highlights showing convictions, dismissals, reductions, and custody notes. Reviewers can compare the extracted data directly with the source page.

A reviewer can edit any field in the web app.

AI and privacy

Rules first, with optional AI for unresolved fields


Criminal-history records contain sensitive personal information. AWS Textract performs the initial OCR. After that step, the standard parsing and interpretation process runs locally through explicit rules. The optional AI assist is off by default.

Rule-based process

Default
  • Provides the source of truth for extracted and interpreted values.
  • Produces the same output from the same input.
  • Runs locally after OCR.
  • Stores the source text and rule behind each value.

Optional AI assist

Off by default
  • Uses Anthropic's Claude only when a rule leaves a field blank or uncertain.
  • Fills blank fields and never replaces a rule-derived value.
  • Applies a confidence threshold to each limited task.
  • Logs each request and response for review.
Personal information

When the AI assist is enabled, names are replaced with placeholders and case numbers receive temporary labels such as CASE_1. The mapping stays in memory. Dates are reduced or removed when the task does not require them. Statute text and legal terms remain so the system can interpret the entry. The exact content sent with each request is logged for review.

Verification

How accuracy is checked


Hand-labeled benchmark

A reviewer labels a curated set of about 50 RAP sheets against the source PDFs. The scanner's results are compared with those labels, with extra weight given to fields such as the charge and case number.

Regression checks

A fixed set of reference sheets is run again after code changes. Unexpected differences are flagged for review. When a rule change is intentional, the expected results are updated and documented.

Automated tests

More than 800 tests cover parsing and post-processing. They run without cloud services or API keys, so the rule-based behavior can be checked independently.

The rules, source links, benchmark, regression checks, automated tests, and attorney review make each result verifiable before use.

Illustrative examples do not depict real people or records. RAP Scanner structures RAP-sheet data. Eligibility is determined separately and reviewed by an attorney before filing.

Our Mission

The Access Project was founded in 2019 to improve access to high-quality legal services to people of limited means. Through creative use of technology and innovative program design, we leverage the resources and enthusiasm of law firm volunteers to complement and support the work of legal services organizations.