New tool allows to judges to predict repeat offences