Update jspp.js
This commit is contained in:
parent
cc9a7d6515
commit
4aa90e68db
1 changed files with 7 additions and 4 deletions
11
jspp.js
11
jspp.js
|
@ -18,12 +18,15 @@ class JSPlusPlus {
|
||||||
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")
|
gen.require("https://cdn.jsdelivr.net/npm/@tensorflow-models/toxicity")
|
||||||
let threshold = 0.9;
|
let threshold = 0.9;
|
||||||
return toxicity.load(threshold).then(model => {
|
let t = await toxicity.load(threshold).then(model => {
|
||||||
return model.classify(sentences).then(predictions => {
|
let m = await model.classify(sentences).then(predictions => {
|
||||||
console.log(predictions)
|
let p = await predictions
|
||||||
return predictions
|
console.log(p)
|
||||||
|
return p
|
||||||
});
|
});
|
||||||
|
return m
|
||||||
});
|
});
|
||||||
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
async asyncSleep(ms) {
|
async asyncSleep(ms) {
|
||||||
|
|
Loading…
Reference in a new issue