@petitchevalroux/vector-bow-one-hot
v1.13.0
Published
Vectorize bag of words with one hot
Downloads
22
Maintainers
Readme
#vector-bow-frequency Vectorize bag of words with words one hot
Usage
const Corpus = require("@petitchevalroux/corpus"),
corpus = new Corpus(),
VectorBowOneHot = require("@petitchevalroux/vector-bow-one-hot");
corpus.addBow(["one", "two", "three"])
.then(() => {
const vectorBowOneHot = new VectorBowOneHot();
return vectorBowOneHot.getVector(["one", "three", "one", "four"], corpus);
})
.then(vector => {
console.log(vector); // [1,0,1]
});