- greet
- utter_greet
- inform
- utter_ask_location
- inform{"location": "italy"}
- slot{"location": "italy"}
- action_weather
- slot{"location": "italy"}
- goodbye
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 characters
| from rasa_nlu.converters import load_data | |
| from rasa_nlu.config import RasaNLUConfig | |
| from rasa_nlu.model import Trainer | |
| from rasa_nlu.model import Metadata, Interpreter | |
| def train_nlu(data, config, model_dir): | |
| training_data = load_data(data) | |
| trainer = Trainer(RasaNLUConfig(config)) | |
| trainer.train(training_data) |
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 characters
| {'intent': | |
| {'name': 'inform', | |
| 'confidence': 0.7305611468844833}, | |
| 'entities': [{'start': 28, 'end': 37, 'value': 'bercelona', 'entity': 'location', 'extractor': 'ner_crf'}], 'intent_ranking': | |
| [{'name': 'inform', 'confidence': 0.7305611468844833}, | |
| {'name': 'greet', | |
| 'confidence': 0.15934033175706844}, | |
| {'name': 'goodbye', | |
| 'confidence': 0.11009852135844819}], | |
| 'text': 'I am planning my holiday to Bercelona. I wonder what is the weather out there.'} |
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 characters
| slots: | |
| location: | |
| type: text | |
| intents: | |
| - greet | |
| - goodbye | |
| - inform | |
| entities: | |
| - location | |
| templates: |
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 characters
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import unicode_literals | |
| from rasa_core.actions.action import Action | |
| from rasa_core.events import SlotSet | |
| class ActionWeather(Action): | |
| def name(self): | |
| return 'action_weather' |
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 characters
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import unicode_literals | |
| import logging | |
| from rasa_core.agent import Agent | |
| from rasa_core.policies.keras_policy import KerasPolicy | |
| from rasa_core.policies.memoization import MemoizationPolicy |
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 characters
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| from __future__ import unicode_literals | |
| import logging | |
| from rasa_core.agent import Agent | |
| from rasa_core.channels.console import ConsoleInputChannel | |
| from rasa_core.interpreter import RegexInterpreter |
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 characters
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| from __future__ import unicode_literals | |
| import logging | |
| from rasa_core.agent import Agent | |
| from rasa_core.channels.console import ConsoleInputChannel | |
| from rasa_core.interpreter import RegexInterpreter |
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 characters
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| from __future__ import unicode_literals | |
| import logging | |
| from builtins import str | |
| from flask import Blueprint, request, jsonify |
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 characters
| from rasa_core.channels import HttpInputChannel | |
| from rasa_core.agent import Agent | |
| from rasa_core.interpreter import RasaNLUInterpreter | |
| from rasa_slack_connector import SlackInput | |
| nlu_interpreter = RasaNLUInterpreter('./models/nlu/default/weathernlu') | |
| agent = Agent.load('./models/dialogue', interpreter = nlu_interpreter) | |
| input_channel = SlackInput('xoxp-777777777777-888888888-99999999999-41b6e1110fccfc98225b125fa288988d', #app verification token |