node-fasttext-wrap
v2.0.0
Published
new facebookresearch/fastText wrapper in nodejs,base on node-fasttext
Downloads
6
Readme
node-fasttext-wrap
To import:
Training
var config = {
dim: 100,
input: "data/data_out_c3.txt",
output: "model"
}
FastText.train("supervised", config, function (success, error) {
if(error) {
console.log(error)
return;
}
console.log(success)
})
Test a model
FastText.test("model.bin", "data/data_test_c2.test", 1, function (data, error) {
if(error) {
console.log(error)
return;
}
console.log(data)
});
Predict
FastText.test("model.bin", "data/data_test_c2.txt", 1, function (data, error) {
if(error) {
console.log(error)
return;
}
console.log(data)
});
FastText.predict("model.bin", 1,['我 要 听 周杰伦 的 歌'],function (success, error) {
if(error) {
console.log(error)
return;
}
console.log(success)
});