Skip to content

Instantly share code, notes, and snippets.

@georgeperry1
Created July 12, 2019 14:33
Show Gist options
  • Save georgeperry1/1f1b98eb9b4e16bc6e8355d77e9f9c9a to your computer and use it in GitHub Desktop.
Save georgeperry1/1f1b98eb9b4e16bc6e8355d77e9f9c9a to your computer and use it in GitHub Desktop.
encode.comment-analysis.js
const encodeData = data => {
const sentences = data.map(comment => comment.text.toLowerCase());
const trainingData = use.load()
.then(model => {
return model.embed(sentences)
.then(embeddings => {
return embeddings;
});
})
.catch(err => console.error('Fit Error:', err));
return trainingData
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment