-
-
Save martzcodes/79f4f88480721f75f3d5f69d36d59801 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as toxicity from "@tensorflow-models/toxicity"; | |
// ... | |
toxicity.load(threshold, []).then(model => { | |
console.log("toxicity model loaded"); | |
this.toxicityModel = model; | |
}); | |
// ... | |
return this.toxicityModel.classify(textToAnalyze).then(predictions => { | |
console.log("Predictions:", predictions); | |
this.predictions$.next(predictions); | |
this.analyzing$.next(false); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment