将Bing Spellchecker用于Luis.ai

发布于 2025-01-28 13:18:50 字数 1418 浏览 4 评论 0 原文

我试图提高路易斯意图的预测准确性。因为缺少一个字母会导致路易斯的意图错误时存在问题。 我使用 apteredquery 在JSON返回表格Luis中。

期望

  "query": "bouk me a fliht to kayro",
  "prediction": {
    "alteredQuery": "book me a flight to cairo",
    "topIntent": "book a flight",
    "intents": {
      "book a flight": {
        "score": 0.9480589
      }
      "None": {
        "score": 0.0332136229
      }
    },
    "entities": {}
  }
}

现实

  "query": "bouk me a fliht to kayro",
  "prediction": {
    "topIntent": "book a flight",
    "intents": {
      "book a flight": {
        "score": 0.9480589
      }
      "None": {
        "score": 0.0332136229
      }
    },
    "entities": {}
  }
}

这就是我的使用方式:

const luisConfig: LuisApplication = {
    applicationId: [APP_ID_GOES_HERE],
    endpointKey: [KEY_GOES_HERE],
    endpoint: [ENDPOINT_GOES_HERE],
};

const recognizerOptions: LuisRecognizerOptionsV2 = {
    apiVersion: 'v2',
    bingSpellCheckSubscriptionKey: [KEY_GOES_HERE];
    includeAllIntents: true,
    log: true,
    spellCheck: true,
    log: true,
    includeInstanceData: true
};

const luisRecognizer = new LuisRecognizer(luisConfig, recognizerOptions, true);

I try to improve LUIS intents prediction accuracy. Because there is an issue when missing one letter leads LUIS to a wrong intent.
I use the tutorial, but still there is no promised key like alteredQuery in the JSON returned form LUIS.

EXPECTATION:

  "query": "bouk me a fliht to kayro",
  "prediction": {
    "alteredQuery": "book me a flight to cairo",
    "topIntent": "book a flight",
    "intents": {
      "book a flight": {
        "score": 0.9480589
      }
      "None": {
        "score": 0.0332136229
      }
    },
    "entities": {}
  }
}

REALITY:

  "query": "bouk me a fliht to kayro",
  "prediction": {
    "topIntent": "book a flight",
    "intents": {
      "book a flight": {
        "score": 0.9480589
      }
      "None": {
        "score": 0.0332136229
      }
    },
    "entities": {}
  }
}

This is how I use it:

const luisConfig: LuisApplication = {
    applicationId: [APP_ID_GOES_HERE],
    endpointKey: [KEY_GOES_HERE],
    endpoint: [ENDPOINT_GOES_HERE],
};

const recognizerOptions: LuisRecognizerOptionsV2 = {
    apiVersion: 'v2',
    bingSpellCheckSubscriptionKey: [KEY_GOES_HERE];
    includeAllIntents: true,
    log: true,
    spellCheck: true,
    log: true,
    includeInstanceData: true
};

const luisRecognizer = new LuisRecognizer(luisConfig, recognizerOptions, true);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风吹过旳痕迹 2025-02-04 13:18:50

我也有同样的问题...如果直接调用API:

/luis/prediction/v3.0/apps/<xxxxx>/slots/production/predict?verbose=true&show-all-intents=false&log=true&subscription-key=<xxxxx>&mkt-bing-spell-check-key=<xxxxx>&query=gretings

响应没有对象为“更改”。

我还尝试使用更多的参数,结果相同:

https://<xxxxx>.cognitiveservices.azure.com/luis/prediction/v3.0/apps/<xxxxx>/slots/production/predict?verbose=true&show-all-intents=false&log=true&subscription-key=<xxxxx>&spellCheck=true&mkt-bing-spell-check-key=<xxxxx>&bing-spell-check-subscription-key=<xxxxx>&query=gretings

如果我用OCP-APIM-Subscription-key头直接调用Bing API,它们会正确响应:

https://api.bing.microsoft.com/v7.0/spellcheck?text=gretings

I have the same issue... if I call the API directly:

/luis/prediction/v3.0/apps/<xxxxx>/slots/production/predict?verbose=true&show-all-intents=false&log=true&subscription-key=<xxxxx>&mkt-bing-spell-check-key=<xxxxx>&query=gretings

The response have not the object "alteredQuery".

Im also try with more parameters with the same result:

https://<xxxxx>.cognitiveservices.azure.com/luis/prediction/v3.0/apps/<xxxxx>/slots/production/predict?verbose=true&show-all-intents=false&log=true&subscription-key=<xxxxx>&spellCheck=true&mkt-bing-spell-check-key=<xxxxx>&bing-spell-check-subscription-key=<xxxxx>&query=gretings

If I call directly the BING API with the Ocp-Apim-Subscription-Key header, they response correctly:

https://api.bing.microsoft.com/v7.0/spellcheck?text=gretings
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文