microsoft-cognitive - 禁用标点符号中断符 LUIS.ai

标签 microsoft-cognitive azure-language-understanding

我正在使用 Microsoft 认知服务的语言理解服务 API,LUIS.ai .

每当 LUIS 解析文本时,始终会在标点符号周围插入空白标记。

根据 documentation,此行为是故意的.

"English, French, Italian, Spanish: token breaks are inserted at any whitespace, and around any punctuation."

对于我的项目,我需要保留没有这些标记的原始查询字符串,因为为我的模型训练的一些实体将包含标点符号,并且从已解析的实体中去除额外的空格很烦人而且有点老套。

此行为的示例:

enter image description here

有没有办法关闭它?这将节省相当多的精力。

谢谢!!

最佳答案

不幸的是,目前无法禁用它,但好消息是返回的预测将处理原始字符串,而不是您在示例标记过程中看到的标记化字符串。

how to understand the JSON response 的文档中您可以看到示例输出保留了原始“查询”字符串,并且提取的实体在原始字符串中具有从零开始的字符索引(“startIndex”、“endIndex”)字符串;这将允许您处理索引而不是解析的实体短语。

{
"query": "Book me a flight to Boston on May 4",
"intents": [
  {
    "intent": "BookFlight",
    "score": 0.919818342
  },
  {
    "intent": "None",
    "score": 0.136909246
  },
  {
    "intent": "GetWeather",
    "score": 0.007304534
  }
],
"entities": [
  {
    "entity": "boston",
    "type": "Location::ToLocation",
    "startIndex": 20,
    "endIndex": 25,
    "score": 0.621795356
  },
  {
    "entity": "may 4",
    "type": "builtin.datetime.date",
    "startIndex": 30,
    "endIndex": 34,
    "resolution": {
      "date": "XXXX-05-04"
    }
  }
]

关于microsoft-cognitive - 禁用标点符号中断符 LUIS.ai,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38749246/

相关文章:

azure - 如何获得检测到的实体的置信度得分?

azure - LUIS 端点 key

botframework - Web 应用程序机器人创建 (Azure) - 没有可见的 LUIS 应用程序

azure - 无法在 LUIS 中配置端点 key

json - 在 Swift Playground 中通过 POST 发送图像

c++ - 使用 C++ REST SDK 将图像从 OpenCV 3 发送到 Cognitive Face API

ios - 使用前置摄像头拍摄时未检测到人脸

c# - 如何通过提供 Windows.Media.FaceAnalysis DetectedFace 列表使用 Microsoft Cognitive 服务检测人脸属性?

microsoft-cognitive - Azure 表单识别器 - 模型版本控制

botframework - 路易斯 Api 'FewLabels' 问题