The same legal concept rarely arrives as the same string.
Across jurisdictions, charge descriptions can vary in abbreviations, wording, statute references, formatting, and local naming conventions. A purely lexical matcher misses semantic equivalence; a purely generative system makes auditability and consistency harder.
Use cheaper deterministic evidence first, then escalate ambiguity.
I designed the workflow as stages rather than one monolithic classifier: Sentence-BERT similarity, RapidFuzz matching, cosine-based candidate ranking, supervised ensemble signals, attribute-aware re-ranking, and LLM review only for hard cases.
Use human-labeled history without replacing the retrieval layer.
The second version adds Random Forest, Gradient Boosting, SVM, Naive Bayes, and MLP models trained on 2021–2024 human-labeled charges. Five-by-five cross-validation tests stability before the ensemble is applied only to newly arriving charges.
Similarity is not enough when meaning depends on attributes.
Candidate matches are re-ranked using predicted attributes such as firearm involvement, violence, drugs, and property. This gives the system another way to reject a superficially similar but substantively wrong category.
Confidence should change the workflow.
The most useful confidence score was not one shown on a dashboard. It was the one that determined whether the system auto-accepted a match, surfaced a candidate for review, or escalated to a stronger model. In this setting, confidence became an orchestration primitive.