首页 > 解决方案 > 需要一个“文本”参数来解析小鸭 rasa x

问题描述

我正在尝试在本地运行小鸭。所以在这篇文章的帮助下,我安装了堆栈,然后

克隆小鸭代码

git clone https://github.com/facebook/duckling.git

下载 zoneinfo 并更新exe/ExampleMain.hs中的参考

  let defaultPath = "duckling/exe/zoneinfo/"
  let fallbackPath = "exe/zoneinfo/"

使用构建

stack build

然后使用

stack exec duckling-example-exe

现在,如果我在邮递员中使用请求类型 POST 和以下内容点击http://localhost:8000/parse

{
    "text": "tommorow",
    "locale": "de_DE",
    "tz": "Europe/Berlin",
    "dims": [
        "time"
    ],
    "reftime": 1616571265000
}

表明422 bad input

Need a 'text' parameter to parse

如果我再次点击相同的请求,它会显示200 OK

quack!

有什么帮助吗?

标签: rasa-xnamed-entity-extractionduckling

解决方案


我看到您正在尝试将请求作为 JSON 发送,但是,“http://localhost:8000/parse”端点希望输入作为“表单编码”数据发送。

请参阅此图像以获取示例快照 - https://i.stack.imgur.com/Cqdz4.png


推荐阅读