New Delhi:A University of Southern California-led study shows moral rhetoric on Twitter may signal whether a protest will turn violent.

Using a deep neural network—an advanced machine learning technique—to detect moralized language, scientists analysed 18 million tweets posted during the 2015 Baltimore protests for Gray, 25, who died as police took him to jail.

They then investigated the association between moralized tweets and arrest rates—a proxy for violence.

The number of hourly arrests made during the protests corresponded with the number of moralized tweets posted in previous hours.

In fact, tweets with moral rhetoric nearly doubled on days when protesters and police clashed.