-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form filling is not getting passed, even-through I use the correct code, how did you handle it ? #1
Comments
Thank you for this. It helped me. I am dropping it once again should anyone need it. Define the INIT stateINIT = 0 Define the CHOOSE_COFFEE stateCHOOSE_COFFEE = 1 Define the ORDERED stateORDERED = 2 Define the policy rulespolicy = { Create the list of messagesmessages = [ Call send_message() for each messagestate = INIT |
Asking Contextual Questions Define the statesINIT=0 Define the policy rules dictionarypolicy_rules = { Define send_messages()def send_messages(messages): Send the messagessend_messages([ |
Handle Negative Feedback Define respond()def respond(message, params, prev_suggestions, excluded): Initialize the empty dictionary and listsparams, suggestions, excluded = {}, [], [] Send the messagesfor message in ["I want a mid range hotel", "no that doesn't work for me"]: |
DataCamp Answers Define policy()def policy(intent): |
Pending Actions II Define send_message()def send_message(pending, message): Define send_messages()def send_messages(messages): Send the messagessend_messages([ |
Pending State Transitions DataCamp Answers Define the statesINIT=0 Define the policy rulespolicy_rules = { Define send_messages()def send_messages(messages): Send the messagessend_messages([ |
Putting it all together Define chitchat_response()def chitchat_response(message): |
Putting It All Together II Define send_message()def send_message(state, pending, message):
Define send_messages()def send_messages(messages): Send the messagessend_messages([ |
This is the code I used, its very similar to your but still, I am not getting passed in the exercise, could you please help me in explaining to me what went wrong.
`
Define the INIT state
INIT = 0
Define the CHOOSE_COFFEE state
CHOOSE_COFFEE = 1
Define the ORDERED state
ORDERED = 2
Define the policy rules
policy = {
(INIT, "order"): (CHOOSE_COFFEE, "ok, Colombian or Kenyan?"),
(INIT, "none"): (INIT, "I'm sorry - I'm not sure how to help you"),
(CHOOSE_COFFEE, "specify_coffee"): (ORDERED, "perfect, the beans are on their way!"),
(CHOOSE_COFFEE, "none"): (CHOOSE_COFFEE, "I'm sorry - would you like Colombian or Kenyan?"),
}
Create the list of messages
messages = [
"I'd like to become a professional dancer",
"well then I'd like to order some coffee",
"my favourite animal is a zebra",
"kenyan"]
Call send_message() for each message
state = INIT
for message in messages:
state = send_message(policy, state, message)
`
The text was updated successfully, but these errors were encountered: