The UK Ministry of Justice has been working on a project to predict violent crimes before they happen .