我可以使用以下命令从终端使用rasa。
rasa nlu train
rasa nlu shell现在我想做同样的事情,我的python代码。我该怎么做呢?
我有我的nlu.md和config.yml。我看到了这个链接https://legacy-docs.rasa.com/docs/nlu/0.15.1/python/,但它使用了我没有的demo-rasa.json。
发布于 2020-02-28 17:39:32
仅供参考,这些文档是针对旧版本的rasa的-我建议使用最新版本(或者至少是>1.0),并在https://rasa.com/docs/rasa/上查看新文档
你的问题在论坛上有一些答案,例如:https://forum.rasa.com/t/training-models-from-a-python-script-python-api-in-the-new-rasa-1-0/12482
https://forum.rasa.com/t/python-api-for-nlu-interpreter-and-agent/22710
为了训练一个模型,它看起来像这样:
from rasa.train import train_nlu
model_directory = <model output dir>
config_file = <path to config file>
nlu_data = <path to NLU training folder or file>
train_nlu(
config=config_file,
nlu_data=nlu_data,
output=model_directory
)https://stackoverflow.com/questions/60369986
复制相似问题