From 73bc4e610f92e28cc13ae52c653eb52b7aae4037 Mon Sep 17 00:00:00 2001 From: Hunter2807 <46440327+Hunter2807@users.noreply.github.com> Date: Thu, 13 May 2021 13:51:31 +0530 Subject: [PATCH 1/2] Added an indexing to the `response` in line 45 The line 45 would error out cz `response` is a tuple, and a tuple does not have any attribute named `text`... --- examples/learning_feedback_example.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/learning_feedback_example.py b/examples/learning_feedback_example.py index bc0b6b314..b8c1df2c7 100644 --- a/examples/learning_feedback_example.py +++ b/examples/learning_feedback_example.py @@ -42,14 +42,13 @@ def get_feedback(): ) print('\n Is "{}" a coherent response to "{}"? \n'.format( - response.text, + response[0].text, input_statement.text )) if get_feedback() is False: print('please input the correct one') correct_response = Statement(text=input()) bot.learn_response(correct_response, input_statement) - print('Responses added to bot!') # Press ctrl-c or ctrl-d on the keyboard to exit except (KeyboardInterrupt, EOFError, SystemExit): From e83fffe3478f02a4610c36c62e678753900aef59 Mon Sep 17 00:00:00 2001 From: Hunter2807 <46440327+Hunter2807@users.noreply.github.com> Date: Thu, 13 May 2021 13:53:56 +0530 Subject: [PATCH 2/2] Update learning_feedback_example.py --- examples/learning_feedback_example.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/learning_feedback_example.py b/examples/learning_feedback_example.py index b8c1df2c7..506489136 100644 --- a/examples/learning_feedback_example.py +++ b/examples/learning_feedback_example.py @@ -49,6 +49,7 @@ def get_feedback(): print('please input the correct one') correct_response = Statement(text=input()) bot.learn_response(correct_response, input_statement) + print("Learnt") # Press ctrl-c or ctrl-d on the keyboard to exit except (KeyboardInterrupt, EOFError, SystemExit):