GenHaxGenHax

NER for Court Cases

Named entity recognition to classify government and person entities in U.S. criminal court records

Built by 2 people (SCALES Team) · June 2024 · AI Knowledge

Rule-Based ClassificationNamed Entity RecognitionFeature EngineeringMachine LearningPythonNatural Language ProcessingPublic Safety & JusticeGeorgia TechNorthwestern UniversityNSFEvanston

What it does

This solution tags entities in U.S. court case records as either government or person to support criminal justice research. Working with national case data from PACER spanning 2002 to 2020, the team built models to identify which parties in court proceedings are individuals versus government entities. The system helps researchers studying resource allocation for courts, prison conditions, and other criminal justice topics by making it easier to understand who is involved in cases and their outcomes. The team sampled 100,000 observations from a dataset of 3.4 million records provided by the challenge sponsor.

How we built it

The team developed three approaches to entity classification. First, they created a rule-based model using twelve ordered rules based on patterns like presence of formal titles, phrases such as 'department of' or 'city of', and token counts. A Decision Tree model applied to these rule-based labels achieved 99% accuracy with 0.6% false negatives. Second, they tested GLiNER_medium-v2.1, a zero-shot model from HuggingFace, on a 2,000-record sample, which matched the rule-based target 59% of the time. Third, they began work on a custom spaCy small English language pipeline trained with labeled examples of formal government titles and person suffixes, though computational limitations prevented full development. The team tokenized text, analyzed token length patterns, created binary features, and used the extra_info field to classify edge cases like John Doe entries.

Impact

The solution addresses weak national data collection across U.S. state criminal justice systems, where the country spends approximately $264 billion annually. By properly tagging entities involved in court cases, the work supports research efforts focused on court resource allocation and evaluating prison conditions. The models help identify who was involved in cases and case outcomes, information that is currently difficult to obtain across fragmented state systems.

Built with

PythonspaCyGLiNERHuggingFaceDecision TreePACER

Slides

Scales - PresentationofFindings.pdfOpen

Questions and answers

What data did the team work with?

The team used webscraped court dockets from PACER covering national U.S. cases from 2002 to 2020. They sampled 100,000 observations from the sponsor's 3.4 million record dataset, with features including name, extra_info, suit subtype, and case IDs.

How accurate was the rule-based approach?

The Decision Tree model using rule-based labels achieved 99% accuracy with 91% recall. False negatives, where an entity was misidentified as a person when it was actually government, occurred about 0.6% of the time.

What were the main classification rules?

The team created twelve ordered rules including detection of formal titles like secretary, officer, judge, or D.A. in name or extra_info fields, presence of phrases like 'u.s.', 'department of', or 'city of', and analysis of token counts, with 2-3 token names more likely to be individuals without formal titles.

Related solutions

In the news

From the GenHax blog and press room.

All news →

Host a challenge like this

Bring a real problem. GenHax brings the builders, mentors and AI tools, and you get working solutions like this one.

Run a challenge with GenHax

Is this your work?

Sign in to complete your public profile, show your skills next to this solution, or choose to hide your name.

Sign in to your profile