如何从 Watson Assistant 中将变量提取到文本文件中?

How to extract variables into a text file from Watson Assistant?

我希望能够将上下文变量存储到文本文件中。 我正在使用此代码:

"context" : {
    "number_extract" : "<? input.text.extract('[\d]+',0) ?>"
}

提取变量并存储在上下文变量中。但现在我希望能够从 Watson Assistant 中提取它,例如将其存储到文本文件或任何其他格式中。这可能还是有其他方法?

是的,您可以将变量的上下文存储在 text files or in a database. Watson Assistant allows to make programmatic calls from within a dialog 中。然后调用的代码负责将提取的信息写入文件或数据库。

我写了一个tutorial that uses the extracted information to store it in a database or to search in that database with extracted search terms。代码在GitHub,大家可以看看是怎么做的