Perspective uses machine learning to analyse the 'toxicity' of comments left online. Jigsaw (a development arm of Google) says it can detect harassment and abuse more accurately than a keyword list - and of course faster than any human.
The API gives editors an alternative to turning off comments altogether or moderating a site manually.
Google and Jigsaw developed the tool by using millions of comments from Wikipedia and elsewhere and using human panels to state if they found the comments toxic. These findings were then use to ‘teach’ the code.
Source: The Digital Reader. For a longer article on the development of the tool, see Wired.