It fixes the problem. However, I have a new one for you I face it when run the command rasa interactive -m models/20190515-135859.tar.gz --endpoints endpoints.yml
and chat 1 message
my stories file is :
happy hoi_phi_giao_hang
- greet
- hoi_phi_giao_hang
- price_form
- form{“name”: “price_form”}
- form{“name”: null}
- utter_tinh_phi_giao_hang
- thank
- utter_thank
- utter_additional_help
- deny
very unhappy hoi_phi_giao_hang
- hoi_phi_giao_hang
- price_form
- form{“name”: “price_form”}
- chitchat
- utter_chitchat
- price_form
- chitchat
- utter_chitchat
- price_form
- chitchat
- utter_chitchat_2
- price_form
- form{“name”: null}
- utter_tinh_phi_giao_hang
- thank
stop but continue hoi_phi_giao_hang
- greet
- hoi_phi_giao_hang
- price_form
- form{“name”: “price_form”}
- deny
- affirm
- price_form
- form{“name”: null}
- utter_tinh_phi_giao_hang
- thank
stop and really stop path
- greet
- hoi_phi_giao_hang
- price_form
- form{“name”: “price_form”}
- deny
- deny
- action_deactivate_form
- form{“name”: null}
chitchat stop but continue path
- hoi_phi_giao_hang
- price_form
- form{“name”: “price_form”}
- chitchat
- utter_chitchat
- price_form
- deny
- affirm
- price_form
- form{“name”: null}
- utter_tinh_phi_giao_hang
- thank
- utter_thank
- utter_additional_help
- deny
stop but continue and chitchat path
- greet
- hoi_phi_giao_hang
- price_form
- form{“name”: “price_form”}
- deny
- affirm
- chitchat
- utter_chitchat
- price_form
- form{“name”: null}
- utter_tinh_phi_giao_hang
- thank
buu_cuc_gan_nhat
- buu_cuc_gan_nhat{“local_address”: “an lão hải phòng”}
- utter_buu_cuc_gan_nhat
- utter_additional_help
- deny OR thank
buu_cuc_gan_nhat
- buu_cuc_gan_nhat{“local_address”: “tp vinh”}
- utter_buu_cuc_gan_nhat
- utter_additional_help
- dang_ki
- utter_dang_ki
- utter_additional_help
- deny
buu_cuc_gan_nhat
- buu_cuc_gan_nhat{“local_address”: “hà nội”}
- utter_buu_cuc_gan_nhat
- utter_additional_help
- dang_ki
- utter_dang_ki
- utter_additional_help
- deny
buu_cuc_gan_nhat
- buu_cuc_gan_nhat{“local_address”: “hưng yên”}
- utter_buu_cuc_gan_nhat
- utter_additional_help
- affirm
dang_ki
- dang_ki
- utter_dang_ki
- utter_additional_help
- deny
kiem_tra_don happypath 1
- greet
- kiem_tra_don{“order_code”: “12380081”}
- utter_kiem_tra_don
- utter_additional_help
- deny OR thank
kiem_tra_don and chitchat2
- kiem_tra_don{“order_code”: “225730139”}
- chitchat
- chitchat
- swearing
- utter_thank
- utter_goodbye
kiem_tra_don+giuc_giao_hang
- kiem_tra_don{“order_code”: “123545564n”}
- utter_kiem_tra_don
- utter_additional_help
- giuc_giao_hang
- utter_giuc_giao_hang
- utter_additional_help
- deny
my config.yml file is
language: vi
pipeline:
- name: “nlu.tokenizers.whitespace_tokenizer.WhitespaceTokenizer”
- name: “RegexFeaturizer”
- name: “CRFEntityExtractor”
- name: “EntitySynonymMapper”
- name: “CountVectorsFeaturizer”
analyzer: ‘char’
min_df: 1
max_df: 1.0
min_ngram: 1
max_ngram: 5
- name: “EmbeddingIntentClassifier”
“epochs”: 10
policies:
- name: FallbackPolicy
- name: MemoizationPolicy
- name: KerasPolicy
“epochs”: 10
- name: FormPolicy
- name: MappingPolicy
my action file is
-- coding: utf-8 --
from typing import Dict, Text, Any, List, Union, Optional
from rasa_sdk import Tracker, Action
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.forms import FormAction
class PriceForm(FormAction):
def name(self) → Text:
“”“Unique identifier of the form”“”
return "price_form"
@staticmethod
def required_slots(tracker:Tracker) -> List[Text]:
"""A list of required slots that the form has to fill"""
return ["from_address", "destination_address", "weight"]
def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
"""A dictionary to map required slots to
- an extracted entity
- intent: value pairs
- a whole message
or a list of them, where a first match will be picked
"""
return {
"from_address": self.from_entity(entity= "from_address", intent = "hoi_phi_giao_hang"),
"destination_address": self.from_entity(entity= "destination_address", intent = "hoi_phi_giao_hang"),
"weight": self.from_entity(entity= "weight", intent = "hoi_phi_giao_hang"),
}
# USED FOR DOCS: do not rename without updating in docs
def validate_weight(
self,
value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Optional[Text]:
"""Validate cuisine value."""
return {"weight": value}
def validate_from_address(
self,
value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Optional[Text]:
"""Validate cuisine value."""
return {"from_address": value}
def validate_destination_address(
self,
value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Optional[Text]:
"""Validate cuisine value."""
return {"destination_address": value}
def submit(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[Dict]:
"""Define what the form has to do after all required slots are filled """
# utter submit template
dispatcher.utter_template("utter_submit", tracker)
return []