有没有办法检查Wit.ai意向响应的信心?

问题描述

我正在尝试在HTML页面中检查API响应的可信度。 如果置信度为0 {转到此页} 如果置信度为1 {转到此页} 我可以检查其他事情,但不能检查意图信心,我该怎么做?

fetch(`https://api.wit.ai/message?q=${transcript}`,{
    headers: {
        Authorization: `Bearer ${token}`,'Content-Type': 'application/json',},}).then(res => res.json())
.then(function (data){
    if (data.intents[0].value==[0]) {
        console.log("intent 1")
        //throw "Error";
    }
    else if (data.text==="pay"){
        console.log("works")
    }
    else {
        if(data.intents==="checkout"){
            console.log("intent 2");
        }
    }
})

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)