Machine-learning algorithms flag suspected problems like bullying, self-harm or suicide and then alert school officials.