Skip to content

Instantly share code, notes, and snippets.

@georgeperry1
Last active July 12, 2019 14:44
Show Gist options
  • Save georgeperry1/5c43fd1e353d095cef1ab30265618897 to your computer and use it in GitHub Desktop.
Save georgeperry1/5c43fd1e353d095cef1ab30265618897 to your computer and use it in GitHub Desktop.
const outputData = tf.tensor2d(comments.map(comment => [
comment.intent === 'buy' ? 1 : 0,
comment.intent === 'none' ? 1 : 0,
]));
// Output: [1,0] or [0,1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment