Jurisprudence search based on facts similarity using NLP and ML techniques. - Ruiz, Rodrigo Amorim (2021)
Part of a lawyers job is to understand the clients problem, to textually describe its facts and to apply the sources of law. To support a new legal case, a handful of past judgments on similar cases are typically employed by the lawyers, but finding them is currently a time-consuming procedure. To address this problem, we built a machine learning model responsible for classifying similarity between two facts descriptions. This similarity metric measures how much (from 0 to 1) a legal decision may be used to support another. We trained different model architectures combining several state-of-the-art natural language processing and machine learning techniques using an extracted dataset from the Superior Court of Justice website of past judgments, which enabled the dynamic construction of facts description pairs when one case cites another as a reference. The final best architecture employs TF-IDF for encoding and reducing dimensionality of our input documents, a Siamese Neural Network (SNN) with a Multilayer Perceptron (MLP) for feature extraction and a final layer, another MLP, responsible for concatenating and classifying the features into the similarity metric, achieving 85.98% accuracy, 83.89% precision and 89.06% recall. Such a model would enable the lawyer to compare a case facts description with several judgments of the jurisprudence and start their search on the most similar ones.