我遵循了Justina Petraityte提供的weather rasa chatbot,您可以找到GitHub存储库here。但是我的聊天机器人从未意识到我要提供给他的意图,这必须是位置,并且我不知道如何处理这种情况,只要它在调用天气API时会产生错误,因此是空的。

例如,我试图询问意大利的天气,但是如您所见here。即使在data.json中,它也不会将意大利视为意图。

例如 :

Image where we can see an example where he doesn't recognizes the intent

因此,无法识别意图时该怎么办?我们是否应该将其保存到stories.md?

域文件内容:

action_factory: null
action_names:
- utter_greet
- utter_goodbye
- utter_ask_location
- action_weather
actions:
- utter_greet
- utter_goodbye
- utter_ask_location
- actions.ActionWeather
config:
  store_entities_as_slots: true
entities:
- location
intents:
- greet
- goodbye
- inform
slots:
  location:
    initial_value: null
    type: rasa_core.slots.TextSlot
templates:
  utter_ask_location:
  - text: In what location?
  utter_goodbye:
  - text: Talk to you later.
  - text: Bye bye :(
  utter_greet:
  - text: Hello! How can I help?
topics: []


Rasa Core版本:

(MoodbotEnv) mike@mike-thinks:~/Programing/Rasa_tutorial/moodbot4$ pip list :
...
rasa-core (0.9.0a3)
rasa-nlu (0.12.3)


Python版本:

(MoodbotEnv) mike@mike-thinks:~/Programing/Rasa_tutorial/moodbot4$ python -V
Python 3.5.2


操作系统 :

Linux 16.04

最佳答案

每个意图至少要有2-10个示例
您拥有的培训示例越多越好。

我建议针对每个意图使用Tensorflow,Spacy,CRF后端组合和5-10个示例,对我来说效果非常好!
将此用作您的config.yml

pipeline:
- name: "intent_featurizer_count_vectors"
- name: "intent_classifier_tensorflow_embedding"
  batch_size: 64
  epochs: 1500
- name: "nlp_spacy"
- name: "tokenizer_spacy"
- name: "ner_crf"


这是一个指南,指导您如何构建以前的版本,完成测试后,需要更改配置文件以切换到TF后端。

遵循这本烹饪书,使用RASA NLU使用python构建内部聊天机器人:
Step by step (cookbook) to build your chatbot

关于python - 如果Rasa无法识别意图,该怎么办?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50465699/

10-12 22:05