Statistics of Polish law courts

VS
deep neural networks
educational experiment
logo

about project

In July 2022 I intensely trained for Google TensorFlow Developer Certificate exam (practical 5 hour test in creating AI models of deep learning). This required of me gaining much experience in data processing beforehand. I proceeded on the assumption that it would be easier for me to work with the records I was best familiar with. As the Polish attorney at law with years of trial experience, I chose the data of Polish judicial system. This project is a "by-product" of my training.

What is this project about? It is an experiment for educational purposes. It presents selected data of the Polish judiciary. Based on this data, an artificial intelligence model can be trained directly in a browser. Then you can see what predictions such AI makes. Predictions are made about the length of court proceedings and the distribution of appellate court rulings. I hope that interacting with the project will be entertaining for you, as well as expand your knowledge of justice statistics and machine learning.

Why models are trained directly in the browser? For educational purposes. In result you are delivered live experience of adjusting the algorithm to the selected data. This is more exciting than making predictions with already trained model. If you would like to discuss details or give me any suggestions about the project I invite you to communicate with me through social media.

Tadeusz Mięsowicz

predict the average duration of legal proceedings

Based on datasets from the Ministry of Justice, the average duration of court proceedings in 2022 is predicted. To begin with, you can read explanations related to collected data. Training and prediction can be performed both for a specific category of proceedings and for all types of court proceedings. The categories of cases presented below were selected by me (there are others). These are typical civil and business proceedings involving plaintiffs and defendants.

predicting data based on one type of historical data

In this case we make predictions on the basis of a specific kind of historical data, the hitherto average durations of legal proceedings. This method, although experimentally exciting, may lead to some distortions of the picture. Taken alone, the general tendency of durations in question is not fully diagnostic about the future. Instead, one can produce models that take into account a wider number of variables in predicting the duration of legal proceedings. Training such models in a browser is completely inefficient.

types of data under analysis

Data categories are determined by the types of case repertories.

SO rep. C

The average duration (in months) of proceedings in civil cases before district courts.

SR rep. C

The average duration (in months) of proceedings in civil cases before regional courts.

SO rep. GC

The average duration (in months) of proceedings in business cases before district courts.

SR rep. GC

The average duration (in months) of proceedings in business cases before regional courts.

In toto

The average duration (in months) of all kinds of legal proceedings before common courts.

Available historical data (2011-2021)

The diagram below shows the data used to train AI.

201220142016201820205101520
SO rep. CSR rep. CSO rep. GCSR rep. GCIn totomonths
first quarter of 2022 – historical data

Partial historical data available from 2022.

  • SO rep. C

    10.75 months

  • SR rep. C

    16.82 months

  • SO rep. GC

    20.06 months

  • SR rep. GC

    20.53 months

  • In toto

    5.52 months

choose the category of data to be used for training & prediction

Press the suitable button to make your choice.

20132014201520162017201820192020202188.599.51010.5
train AI and predict

The training lasts 500 epochs, i.e. the cycle of corrections of the model’s accuracy. The entire training should not take more than 5 minutes. The resulting prediction of duration for 2022 will be given automatically afterword.

AI training on your mobile

Because the computing workload I recommend not to train the model with phones, especially the older ones.

Number of epochs500

0%
prediction result

After AI is trained you will see the result of its work.

201320142015201620172018201920202021510152025

The prediction for the entire 2022

No prediction yet

0510−0.500.5

First quarter of 2022 – historical data

10.75 months

0510−0.500.5

The analysis of data concerning handling the appeals by common courts permits to discover a correlation between the number of appeals brought before courts and the number of rulings of a particular kind. Let's see how machine learning will deal with these correlations. On the basis of data sets from the Ministry of Justice related to appeals, the annual number of specific substantive rulings of the courts of second instance are predicted. On top of this, the annual number of pending cases left for future years are predicted. In other words, on the basis of the annual number of appeals brought, AI predicts the annual number of rulings belonging to each category of decision (such as dismissal of appeals).

Regression

From the point of view of machine learning in the analysed case, we are dealing with regression. What is regression? To make things simple, the idea of regression is forecasting the continuous values of some variables on the basis of other continuous variables. That is, determining the value of a variable or variables using our knowledge of other variables. In our example, AI will infer the annual distribution of court’s rulings by their kinds from the annual number of appeals brought.

types of data under analysis

Data categories are determined by the types of case repertories.

Ca

The data concerning the yearly number of appeals and kinds of appellate rulings in civil cases before district courts.

Ga

The data concerning the yearly number of appeals and kinds of appellate rulings in business cases before district courts.

ACa

The data concerning the yearly number of appeals and kinds of appellate rulings in civil cases before appeals courts.

types of rulings - variables

Check out the data.

Appeals brought

Cases brought before appeal courts

Denied

Annual number of judgments denying appeals.

Changed

Annual number of judgments allowing appeals.

Sent back to I

Annual number of judgments resulting sending back case to the first instance.

Returned

Annual number of appeals not decided on the merits due to failure to complete formal requirements.

Rejected

Annual number of appeals not decided on the merits due to lack of formal case handling capabilities.

Discontinued

Annual number of pending appeals terminated during the course of proceedings before the court of second instance for formal reasons.

Other

Annual number of cases concluded with other rulings.

Pending

Annual number of cases not decided in a given year and remaining to be decided in subsequent years.

choose the category of data to be used for training & prediction

Press the suitable button to make your choice.

20122014201620182020010k20k30k40k
DeniedChangedSent back to IReturnedRejectedDiscontinuedOtherPending
undecided appeals by years

Check out the data.

2015202020k40k60k80k100k
Appeals broughtPending
overview of rulings

The comparison of proportions of all types of rulings in the beginning and in the end of the period under analysis.

2011

54.4%18.5%16.6%5.44%2.03%1.58%1.47%0%
DeniedChangedPendingSent back to IOtherRejectedDiscontinuedReturned

2021

36.9%35.3%15.4%6.79%2.46%1.83%1.38%0%
DeniedPendingChangedRejectedSent back to IOtherDiscontinuedReturned
cases completed vs undecided

2011

Cases completed vs undecided against the total number of appeals brought in a particular year.

Appeals brought020k40k60k80k100k120k

57274

FinishedPending020k40k60k80k100k120k

47784

9482

83.4%16.6%
FinishedPending
cases completed vs undecided

2021

Cases completed vs undecided against the total number of appeals brought in a particular year.

Appeals brought020k40k60k80k100k120k

112361

FinishedPending020k40k60k80k100k120k

72697

39664

64.7%35.3%
FinishedPending
substantive decisions

2011

Cases in which the court ruled on their substance.

Appeals brought020k40k60k80k100k120k

57274

DeniedChangedSent back to IOther020k40k60k80k100k120k

31161

10592

3118

1164

67.7%23%6.77%2.53%
DeniedChangedSent back to IOther

46035

substantive decisions

2021

Cases in which the court ruled on their substance.

Appeals brought020k40k60k80k100k120k

112361

DeniedChangedSent back to IOther020k40k60k80k100k120k

41419

17291

2760

2052

65.2%27.2%4.34%3.23%
DeniedChangedSent back to IOther

63522

train AI and predict

The training lasts 200 epochs, i.e. the cycle of corrections of the model’s accuracy. The entire training should not take more than 5 minutes. The resulting prediction will be made automatically afterwards. Use the slider to select the hypothetical annual number of appeals brought in for which the prediction will occur.

AI training on your mobile

Because the computing workload I recommend not to train the model with phones, especially the older ones.

Number of epochs200

Appeals in: 83724

0%
prediction result

After AI is trained you will see the result of its work.

DeniedChangedSent back to IOther020k40k60k80k100k
100%
no prediction yet
020k40k60k80k100k−0.500.5
Pending0
020k40k60k80k100k−0.500.5
Appeals in: 83724

created by Tadeusz Mięsowicz | 2022 | All right reserved