predicts toxicity present in a sentence using tensorflow.js
Bundle model can be used via script tag in hedder:
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/toxicity"></script>
Model can be loaded in javascript like this:
toxicity.load(/*variables*/)
.then(model=>{
//do predictions with model
})
Some pretrained tfjs models can be found here
Most of the code is taken from here