Perspective does this pretty well for English languages and some limited other languages (uses Google perspective API) it can be buggy with only single swear words though as it sometimes detects the wrong language.
Another note is that it only flags post and does not remove them. You could feel free to fork and add the removal feature however.