Bot not running in command line using Python script

I am using rasa-core v0.12.3. I have trained a simple bot using interactive learning and I have the trained model under the models directory. But I have to test it in command line using a Python script. I followed this code, but it didn’t work as expected.

But when I try to do it, it loads but after typing anything I get the following error:

Bot loaded. Type a message and press enter (use ‘/stop’ to exit): hi /usr/local/lib/python3.5/dist-packages/sklearn/preprocessing/ DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use array.size > 0 to check that an array is not empty. if diff: Exception in thread Thread-2: Traceback (most recent call last): File “/usr/lib/python3.5/”, line 914, in _bootstrap_inner File “/usr/lib/python3.5/”, line 862, in run self._target(*self._args, **self._kwargs) File “/usr/local/lib/python3.5/dist-packages/rasa_core/channels/”, line 321, in on_message_wrapper on_new_message(message) File “/usr/local/lib/python3.5/dist-packages/rasa_core/”, line 317, in handle_message return processor.handle_message(message) File “/usr/local/lib/python3.5/dist-packages/rasa_core/”, line 86, in handle_message self._predict_and_execute_next_action(message, tracker) File “/usr/local/lib/python3.5/dist-packages/rasa_core/”, line 305, in _predict_and_execute_next_action action, policy, confidence = self.predict_next_action(tracker) File “/usr/local/lib/python3.5/dist-packages/rasa_core/”, line 168, in predict_next_action probabilities, policy = self._get_next_action_probabilities(tracker) File “/usr/local/lib/python3.5/dist-packages/rasa_core/”, line 478, in _get_next_action_probabilities tracker, self.domain) File “/usr/local/lib/python3.5/dist-packages/rasa_core/policies/”, line 291, in probabilities_using_best_policy if (result.index(max_confidence) == AttributeError: ‘NoneType’ object has no attribute ‘index’

I have created the following script:

P.S. I get the same error even if I use RasaNLUInterpreter() instead of NaturalLanguageInterpreter.create()