想要在Rasa_Nlu中使用Duckling。在其中使用小鸭的先决条件是什么

时间:2019-08-25 12:40:53

标签: rasa-nlu

我在rasa_nlu的config.yml文件中使用Duckling Pipeline。并且我也已经启动了8080端口服务器,但是当我运行rasa_nlu.evaluate时出现错误2019-08-25 16:27:00错误rasa_nlu.extractors.duckling_http_extractor-无法连接到小鸭HTTP服务器。确保小鸭服务器正在运行,并且在配置中设置了正确的主机和端口。可以在github上找到有关如何运行服务器的更多信息:https://github.com/facebook/duckling#quickstart

Error: HTTPConnectionPool(host='0.0.0.0', port=8000): Max retries exceeded with url: /parse (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001E393E68978>: Failed to establish a new connection: [WinError 10049] The requested address is not valid in its context'))

我已经在本地主机和端口8080中启动Duckling Server,并且它正在运行。 http://0.0.0.0:8000/。但错误提示

Failed to connect Duckling server

Config.yml文件

language: "en"

pipeline:
- name: "DucklingHTTPExtractor"
  # url of the running duckling server
  url: "http://0.0.0.0:8000"
  # dimensions to extract
  dimensions: ["time"]
- name : "nlp_spacy"

预期结果是:-当用户输入“明天”时。我应该明天约会。例如-如果今天是25-08-2019。 SO输出应为26-08-2019

1 个答案:

答案 0 :(得分:0)

尝试使用localhost而不是“ 0.0.0.0”

const IOS_STATUS_BAR_HEIGHT = 40;
async function removeIosStatusBar(imageFileName) {
  return new Promise((resolve, reject) => {
    const image = PNG.sync.read(readFileSync(imageFileName));
    let {width, height} = image;
    height -= IOS_STATUS_BAR_HEIGHT;
    const dst = new PNG({width, height});
    fs.createReadStream(imageFileName)
      .pipe(new PNG())
      .on('error', error => reject(error))
      .on('parsed', function () {
        this.bitblt(dst, 0, IOS_STATUS_BAR_HEIGHT, width, height, 0, 0);
        dst
          .pack()
          .pipe(fs.createWriteStream(imageFileName))
          .on('error', error => reject(error))
          .on('finish', () => resolve(imageFileName));
      });
  });
}