Created
April 4, 2018 20:56
-
-
Save irony/1dff90d57c97cba65b7abc3af21338a7 to your computer and use it in GitHub Desktop.
LSTM
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
const brain = require('brain.js') | |
const net = new brain.recurrent.LSTM() | |
net.train([ | |
{ input: 'Inside Chi’s nursery', output: { kardashian: 1 } }, | |
{ input: 'Why I dyed my hair pink', output: { kardashian: 1 } }, | |
{ input: 'Feeling Blue (wearing @kkwbeauty powder contour in medium & dark contour kit as eye shadow, & a new lip coming soon)', output: { kardashian: 1 } }, | |
{ input: 'I will be interviewed by @JudgeJeanine on @FoxNews at 9:00 P.M. Enjoy!', output: { trump: 1 } }, | |
{ input: 'Dem Memo: FBI did not disclose who the clients were — the Clinton Campaign and the DNC. Wow!', output: { trump: 1 } }, | |
{ input: 'Thank you to the great men and women of the United States @SecretService for a job well done!', output: { trump: 1 } } | |
]) | |
console.log(net.run('Whether we are Republican or Democrat, we must now focus on strengthening Background Checks!')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment