Facebook will use artificial intelligence to spot users who may be at risk of suicide, telling people to talk to friends or contact a helpline if their posts show signs that they may be considering taking their own lives.

Suicide prevention services have been available on Facebook for more than 10 years, but it is now testing artificial intelligence as a way of identifying users who may be at risk.

Its algorithm will flag up posts that are likely to include thoughts of suicide, Facebook said, by using pattern recognition on previous posts that have been reported.

Reporting tools will now also be integrated into Facebook Live, so people who are watching the video will be able to report it and “reach out to the person directly”.