You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there i wanted to train a model to detect badwords, i have tried downloading brain.js to train a model. I have my badwords dataset in json file. I wanted to know if i am going the right track .
importbrainfrom"brain.js";importfsfrom"fs";consta=[];try{constdata=fs.readFileSync("BadWord.json","utf8");constparsedData=JSON.parse(data);parsedData.known_links.forEach((word)=>{a.push({input: word,output: true});});constnet=newbrain.recurrent.RNN();net.train(a,{log: true,iterations: 5000,learningRate: 0.0001});constnetData=net.toJSON();fs.writeFileSync("model.json",netData);constb=net.run("goodWord");console.log("Result of running model "+b);}catch(err){console.error(err);}
The text was updated successfully, but these errors were encountered:
Hey there i wanted to train a model to detect badwords, i have tried downloading brain.js to train a model. I have my badwords dataset in json file. I wanted to know if i am going the right track .
The text was updated successfully, but these errors were encountered: