Update jspp.js
This commit is contained in:
parent
5419286c37
commit
d4f7ba6de8
1 changed files with 2 additions and 2 deletions
4
jspp.js
4
jspp.js
|
@ -16,11 +16,11 @@ class JSPlusPlus {
|
||||||
// labels to include.
|
// labels to include.
|
||||||
const gen = new JSPlusPlus.General
|
const gen = new JSPlusPlus.General
|
||||||
gen.require("https://cdn.jsdelivr.net/npm/@tensorflow/tfjs")
|
gen.require("https://cdn.jsdelivr.net/npm/@tensorflow/tfjs")
|
||||||
gen.require("https://cdn.jsdelivr.net/npm/@tensorflow-models/toxicity")
|
const t = gen.require("https://cdn.jsdelivr.net/npm/@tensorflow-models/toxicity")
|
||||||
let threshold = 0.9;
|
let threshold = 0.9;
|
||||||
let toxic = false
|
let toxic = false
|
||||||
|
|
||||||
toxicity.load(threshold).then(model => {
|
t.toxicity.load(threshold).then(model => {
|
||||||
model.classify(sentences).then(predictions => {
|
model.classify(sentences).then(predictions => {
|
||||||
predictions.forEach(classified => {
|
predictions.forEach(classified => {
|
||||||
if (classified.label == "toxicity") {
|
if (classified.label == "toxicity") {
|
||||||
|
|
Loading…
Reference in a new issue