从外部应用程序请求时,Wit.ai bot无法识别预定义的实体位置值

时间:2017-07-01 11:44:07

标签: node.js wit.ai

使用get / message从外部节点应用程序请求时,Wit.ai bot无法识别预定义的实体位置值。 (它显示意图,不显示位置值)。与post / converse相同:非常低的置信度0,2-0,4,实体未被识别。

在heroku上部署的服务器。 在机智故事中进行测试时,机器人识别工作正常。 机智不承认实体的原因是什么?

我正在使用Fetch发出请求:

app.post('/', function(req, res) {
    const message = req.body.message
    const sessionId = req.body.sessionId
    fetch(witUrl+'/message?v=20170611&session_id='+sessionId+'&q='+message, {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json',
            'Accept': 'application/json',
            'Authorization': 'Bearer XXXXXXXXXXXXXXXXXXXXX'
        }
    })
        .then(r=> r.json())
        .then(j =>
    res.send(j)
    )
    .catch(e=> console.log('error in fetch with wit',e))

});

谢谢,

0 个答案:

没有答案