fasttext.js - fastText.load () никогда не срабатывает - PullRequest
0 голосов
/ 23 октября 2018

Я использую fasttext.js с моим экспресс-сервером.когда я запускаю его локально, он также работает, когда я запускаю его на моем сервере - fastText.load () никогда не вызывал никаких идей?

const FastText = require('fasttext.js');

const fastText = new FastText({
    loadModel: './model_cooking.bin'
});

var sample="Our Twitter run by the band and crew to give you an inside look into our lives on the road. Get #FutureHearts now: http://smarturl.it/futurehearts";
fastText.load()
    .then(loaded => {
        console.log(`loaded ${loaded}!`);
        return fastText.predict(sample);
    })
    .then(labels=> {
        console.log("TEXT:", sample, "\nPREDICT:",labels );
        sample="LBi Software provides precisely engineered, customer-focused #HRTECH solutions. Our flagship solution, LBi HR HelpDesk, is a SaaS #HR Case Management product.";
        return fastText.predict(sample);
    })
    .then(labels=> {
        console.log("TEXT:", sample, "\nPREDICT:",labels );
        fastText.unload();
    })
    .catch(error => {
        console.error(`error ${done}!`);
        console.error(error);
    });
...