diff --git a/jspp.js b/jspp.js index 201d3a2..9b42bb7 100644 --- a/jspp.js +++ b/jspp.js @@ -18,18 +18,17 @@ class JSPlusPlus { gen.require("https://cdn.jsdelivr.net/npm/@tensorflow/tfjs") gen.require("https://cdn.jsdelivr.net/npm/@tensorflow-models/toxicity") let threshold = 0.9; - let toxic = false toxicity.load(threshold).then(model => { model.classify(sentences).then(predictions => { predictions.forEach(classified => { if (classified.label == "toxicity") { - toxic = classified.results.match + var toxic = classified.results.match } }); }); }); - return toxic + return toxic } async asyncSleep(ms) {