Created
July 12, 2019 14:33
-
-
Save georgeperry1/1f1b98eb9b4e16bc6e8355d77e9f9c9a to your computer and use it in GitHub Desktop.
encode.comment-analysis.js
This file contains hidden or 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 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