yogeshhk / GSTFAQChatbot

Set of scripts to build a chatbot which will answer FAQ about Goods and Services Tax (GST) India.
41 stars 38 forks source link

Engine response functions #2

Closed chriskinyua closed 6 months ago

chriskinyua commented 5 years ago

Hi, kindly clarify on the logic of the functions that return responses or how they work on engine.py. I have tried making queries and the only response I get is for the first if statement where entities==None. However, my server logs indicate that the entity and intent extraction was successful.

Thank you.

yogeshhk commented 5 years ago

Can you debug by setting breakpoint just after request call in app.py (line 25) and see the flow?

chriskinyua commented 5 years ago

I'm not sure if I'm doing the right thing, but when I debug using Pycharm, I only get information on variables and not the flow of the function.

yogeshhk commented 5 years ago

Need to see, at each step, are you getting entities?, what are the? then what happens?, which "if" case it pick?s, where does it go then?.. that what needs to be seen while debugging... On Thursday, February 7, 2019, 3:36:17 PM GMT+5:30, chriskinyua notifications@github.com wrote:

I'm not sure if I'm doing the right thing, but when I debug using Pycharm, I only get information on variables and not the flow of the function.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub, or mute the thread.

chriskinyua commented 5 years ago

I have tried all I can to see the data flow but to no avail. Stilll searching.

Mean while, I've realized that the following if statement isn't being executed: if len(entities) == 1: return gstinfo_response_dict[entities[0]]

Entities and intents are being extracted and I can see from the output logs and changing if entities == None: return "Could not find out specific information about this ..." + gstinfo_response_dict["faq_link"] to if entities is not None: return "Could not find out specific information about this ..." + gstinfo_response_dict["faq_link"] works well.

Kindly assist on the second if statement,

yogeshhk commented 5 years ago

Will changing that 'if' to following work? if entities is None: return "Could not find out specific information about this ..." + gstinfo_response_dict["faq_link"]

On Thursday, February 7, 2019, 6:35:00 PM GMT+5:30, chriskinyua <notifications@github.com> wrote:  

I have tried all I can to see the data flow but to no avail. Stilll searching.

Mean while, I've realized that the following if statement isn't being executed: if len(entities) == 1: return gstinfo_response_dict[entities[0]]

Entities and intents are being extracted and I can see from the output logs and changing if entities == None: return "Could not find out specific information about this ..." + gstinfo_response_dict["faq_link"] to if entities is not None: return "Could not find out specific information about this ..." + gstinfo_response_dict["faq_link"] works well.

Kindly assist on the second if statement,

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub, or mute the thread.

chriskinyua commented 5 years ago

Changing that works. It's the second if statement that checks the length of the entities that doesn't work.

yogeshhk commented 5 years ago

I would suggest putting up this query on RASA NLU forum. On Thursday, February 7, 2019, 6:35:00 PM GMT+5:30, chriskinyua notifications@github.com wrote:

I have tried all I can to see the data flow but to no avail. Stilll searching.

Mean while, I've realized that the following if statement isn't being executed: if len(entities) == 1: return gstinfo_response_dict[entities[0]]

Entities and intents are being extracted and I can see from the output logs and changing if entities == None: return "Could not find out specific information about this ..." + gstinfo_response_dict["faq_link"] to if entities is not None: return "Could not find out specific information about this ..." + gstinfo_response_dict["faq_link"] works well.

Kindly assist on the second if statement,

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub, or mute the thread.