Created
February 7, 2018 04:43
-
-
Save engelmav/89f983ccf6dbd69a7c27865126a165dc to your computer and use it in GitHub Desktop.
Revisions
-
engelmav renamed this gist
Feb 7, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
engelmav created this gist
Feb 7, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ from rasa_nlu.model import Interpreter, RasaNLUConfig from rasa_core import utils import logging def test_loop(user_messages): for message in user_messages: result = interpreter.parse(message) logger.info("test message: `{}`, result: {} with confidence {}".format(message, result['intent']['name'], result['intent']['confidence'])) logger = logging.getLogger(__name__) utils.configure_colored_logging(loglevel="INFO") model_path = './models/nlu/default/jokerbot' nlu_config_path = './nlu_model_config.json' interpreter = Interpreter.load(model_path, RasaNLUConfig(nlu_config_path)) test_greetings = [ u"hey doucheface!", u"hey asshole!", u"hi guy", u"hello sir", u"what's up dude?", u"good morning" ] test_loop(test_greetings) test_joke_reqs = [ "tell me a marriage joke", "tell me a joke", "give me a joke about marriage", "tell me something about marriage", "tell me a joke about holy matrimony", "tell me something funny about marriage", "what's a joke about marriage?", "what's something funny?" ] test_loop(test_joke_reqs)