├── .gitignore ├── .vscode ├── launch.json └── tags ├── README.md ├── _config.yml ├── chatbot_ui ├── css │ ├── animate.css │ ├── chatbot.css │ ├── notify.min.css │ └── style.css ├── images │ ├── bot.png │ ├── chat.png │ ├── chatbot.svg │ ├── chatuser.svg │ ├── logo.png │ ├── send.png │ └── user.png ├── index.html ├── js │ ├── app.js │ ├── axios.min.js │ ├── index.js │ ├── vue-router.js │ ├── vue-simple-notify.min.js │ └── vue.js ├── license.txt ├── node_modules │ └── .bin │ │ ├── mime │ │ ├── oc │ │ └── opencollective ├── package-lock.json ├── package.json ├── plugins │ └── remarkable-bootstrap-notify │ │ ├── .bower.json │ │ ├── .gitignore │ │ ├── Gruntfile.js │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bootstrap-notify.js │ │ ├── bootstrap-notify.min.js │ │ ├── bower.json │ │ ├── composer.json │ │ ├── dist │ │ ├── bootstrap-notify.js │ │ └── bootstrap-notify.min.js │ │ ├── jshintrc.json │ │ ├── package.js │ │ ├── package.json │ │ └── test_meteor.js ├── scss │ └── style.scss ├── vue-router.js └── webserver.js ├── clofusbot ├── README.MD ├── __init__.py ├── __init__.pyc ├── __pycache__ │ ├── __init__.cpython-34.pyc │ ├── __init__.cpython-36.pyc │ ├── policy.cpython-34.pyc │ ├── policy.cpython-36.pyc │ ├── rasa.cpython-34.pyc │ └── rasa.cpython-36.pyc ├── policy.py ├── policy.pyc ├── projects │ └── simpletalk │ │ ├── README.MD │ │ ├── config_spacy.yml │ │ ├── domain.yml │ │ ├── graph.png │ │ ├── intents │ │ └── small_talk.json │ │ ├── models │ │ ├── dialogue │ │ │ ├── domain.json │ │ │ ├── domain.yml │ │ │ ├── policy_0_MemoizationPolicy │ │ │ │ ├── featurizer.json │ │ │ │ └── memorized_turns.json │ │ │ ├── policy_1_ClofusBotPolicy │ │ │ │ ├── featurizer.json │ │ │ │ ├── keras_arch.json │ │ │ │ ├── keras_policy.json │ │ │ │ └── keras_weights.h5 │ │ │ ├── policy_metadata.json │ │ │ └── stories.md │ │ └── nlu │ │ │ ├── clofusbot │ │ │ ├── domain.json │ │ │ ├── domain.yml │ │ │ ├── featurizer.json │ │ │ ├── keras_arch.json │ │ │ ├── keras_policy.json │ │ │ ├── keras_weights.h5 │ │ │ ├── memorized_turns.json │ │ │ └── policy_metadata.json │ │ │ └── default │ │ │ └── current │ │ │ ├── crf_model.pkl │ │ │ ├── intent_classifier.pkl │ │ │ ├── intent_classifier_sklearn.pkl │ │ │ ├── metadata.json │ │ │ └── training_data.json │ │ └── stories │ │ └── stories.md ├── rasa.py └── rasa_core.log ├── config └── config.dev.js ├── docs ├── arabicdemo.html └── index.html ├── index.html ├── lib ├── auth.js ├── configuration.js ├── cors.js ├── executecommand.js ├── gencode.js ├── generateTrainingData.js └── mongooseConnect.js ├── models ├── account.js ├── agents.js ├── oauth.js └── stories.js ├── package.json ├── process.json ├── resources └── screenshot.png ├── routes ├── agents.js ├── conversations.js └── stories.js └── server.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | chatbot_ui/node_modules/ 3 | clofusbot/projects/ -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | 8 | { 9 | "type": "node", 10 | "request": "launch", 11 | "name": "chatbot ui", 12 | "program": "${workspaceFolder}/server.js" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /.vscode/tags: -------------------------------------------------------------------------------- 1 | !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ 2 | !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ 3 | !_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ 4 | !_TAG_PROGRAM_NAME Exuberant Ctags // 5 | !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ 6 | !_TAG_PROGRAM_VERSION 5.8 // 7 | Action ../clofusbot/rasa.py /^from rasa_core.actions import Action$/;" kind:namespace line:12 8 | ActionSuggest ../clofusbot/rasa.py /^class ActionSuggest(Action):$/;" kind:class line:21 9 | Activation ../clofusbot/policy.py /^ Masking, LSTM, Dense, TimeDistributed, Activation$/;" kind:namespace line:20 10 | Activation ../clofusbot/policy.py /^ from keras.layers import LSTM, Activation, Masking, Dense$/;" kind:namespace line:15 11 | Agent ../clofusbot/rasa.py /^from rasa_core.agent import Agent$/;" kind:namespace line:13 12 | ClofusBotPolicy ../clofusbot/policy.py /^class ClofusBotPolicy(KerasPolicy):$/;" kind:class line:12 13 | ClofusBotPolicy ../clofusbot/rasa.py /^from clofusbot.policy import ClofusBotPolicy$/;" kind:namespace line:10 14 | ConsoleInputChannel ../clofusbot/rasa.py /^from rasa_core.channels.console import ConsoleInputChannel$/;" kind:namespace line:14 15 | Dense ../clofusbot/policy.py /^ Masking, LSTM, Dense, TimeDistributed, Activation$/;" kind:namespace line:20 16 | Dense ../clofusbot/policy.py /^ from keras.layers import LSTM, Activation, Masking, Dense$/;" kind:namespace line:15 17 | KerasPolicy ../clofusbot/policy.py /^from rasa_core.policies.keras_policy import KerasPolicy$/;" kind:namespace line:8 18 | LSTM ../clofusbot/policy.py /^ Masking, LSTM, Dense, TimeDistributed, Activation$/;" kind:namespace line:20 19 | LSTM ../clofusbot/policy.py /^ from keras.layers import LSTM, Activation, Masking, Dense$/;" kind:namespace line:15 20 | Masking ../clofusbot/policy.py /^ Masking, LSTM, Dense, TimeDistributed, Activation$/;" kind:namespace line:20 21 | Masking ../clofusbot/policy.py /^ from keras.layers import LSTM, Activation, Masking, Dense$/;" kind:namespace line:15 22 | MemoizationPolicy ../clofusbot/rasa.py /^from rasa_core.policies.memoization import MemoizationPolicy$/;" kind:namespace line:17 23 | RasaNLUInterpreter ../clofusbot/rasa.py /^from rasa_core.interpreter import RasaNLUInterpreter$/;" kind:namespace line:16 24 | RasaNLUModelConfig ../clofusbot/rasa.py /^ from rasa_nlu.config import RasaNLUModelConfig$/;" kind:namespace line:35 25 | Sequential ../clofusbot/policy.py /^ from keras.models import Sequential$/;" kind:namespace line:16 26 | Sequential ../clofusbot/policy.py /^ from keras.models import Sequential$/;" kind:namespace line:18 27 | SlotSet ../clofusbot/rasa.py /^from rasa_core.events import SlotSet$/;" kind:namespace line:15 28 | TimeDistributed ../clofusbot/policy.py /^ Masking, LSTM, Dense, TimeDistributed, Activation$/;" kind:namespace line:20 29 | Trainer ../clofusbot/rasa.py /^ from rasa_nlu.model import Trainer$/;" kind:namespace line:36 30 | __init__.py ../clofusbot/__init__.py 1;" kind:file line:1 31 | absolute_import ../clofusbot/policy.py /^from __future__ import absolute_import$/;" kind:namespace line:1 32 | absolute_import ../clofusbot/rasa.py /^from __future__ import absolute_import$/;" kind:namespace line:1 33 | argparse ../clofusbot/rasa.py /^import argparse$/;" kind:namespace line:6 34 | choices ../clofusbot/rasa.py /^ choices=["train-nlu", "train-dialogue", "test-bot", "respond"],$/;" kind:variable line:126 35 | config ../clofusbot/rasa.py /^ from rasa_nlu import config$/;" kind:namespace line:37 36 | description ../clofusbot/rasa.py /^ description='starts the bot')$/;" kind:variable line:122 37 | division ../clofusbot/policy.py /^from __future__ import division$/;" kind:namespace line:2 38 | division ../clofusbot/rasa.py /^from __future__ import division$/;" kind:namespace line:2 39 | help ../clofusbot/rasa.py /^ help="what the bot should do - e.g. run or train?")$/;" kind:variable line:127 40 | help ../clofusbot/rasa.py /^ help="input message you want to process")$/;" kind:variable line:137 41 | help ../clofusbot/rasa.py /^ help="what the project you want to load")$/;" kind:variable line:132 42 | load_data ../clofusbot/rasa.py /^ from rasa_nlu.training_data import load_data$/;" kind:namespace line:34 43 | load_model ../clofusbot/rasa.py /^def load_model(project="simpletalk"):$/;" kind:function line:87 44 | logger ../clofusbot/policy.py /^logger = logging.getLogger(__name__)$/;" kind:variable line:10 45 | logger ../clofusbot/rasa.py /^logger = logging.getLogger(__name__)$/;" kind:variable line:19 46 | logging ../clofusbot/policy.py /^import logging$/;" kind:namespace line:6 47 | logging ../clofusbot/rasa.py /^import logging$/;" kind:namespace line:7 48 | message ../clofusbot/rasa.py /^ message = parser.parse_args().message$/;" kind:variable line:160 49 | model_architecture ../clofusbot/policy.py /^ def model_architecture(self, input_shape, output_shape):$/;" kind:member line:13 50 | name ../clofusbot/rasa.py /^ def name(self):$/;" kind:member line:22 51 | nargs ../clofusbot/rasa.py /^ nargs='?',$/;" kind:variable line:131 52 | nargs ../clofusbot/rasa.py /^ nargs='?',$/;" kind:variable line:136 53 | parser ../clofusbot/rasa.py /^ parser = argparse.ArgumentParser($/;" kind:variable line:121 54 | policy.py ../clofusbot/policy.py 1;" kind:file line:1 55 | print_function ../clofusbot/policy.py /^from __future__ import print_function$/;" kind:namespace line:3 56 | print_function ../clofusbot/rasa.py /^from __future__ import print_function$/;" kind:namespace line:3 57 | process_input ../clofusbot/rasa.py /^def process_input(agent, serve_forever=True, message='Hi'):$/;" kind:function line:92 58 | project ../clofusbot/rasa.py /^ project = "simpletalk"$/;" kind:variable line:144 59 | project ../clofusbot/rasa.py /^ project = parser.parse_args().project$/;" kind:variable line:140 60 | rasa.py ../clofusbot/rasa.py 1;" kind:file line:1 61 | respond ../clofusbot/rasa.py /^def respond(project="simpletalk", message=""):$/;" kind:function line:109 62 | run ../clofusbot/rasa.py /^ def run(self, dispatcher, tracker, domain):$/;" kind:member line:25 63 | task ../clofusbot/rasa.py /^ task = parser.parse_args().task$/;" kind:variable line:139 64 | task ../clofusbot/rasa.py /^ task = parser.parse_args().task$/;" kind:variable line:149 65 | testbot ../clofusbot/rasa.py /^def testbot(project="simpletalk", serve_forever=True):$/;" kind:function line:99 66 | train_dialogue ../clofusbot/rasa.py /^def train_dialogue(project="simpletalk"):$/;" kind:function line:47 67 | train_nlu ../clofusbot/rasa.py /^def train_nlu(project='simpletalk'):$/;" kind:function line:33 68 | train_online ../clofusbot/rasa.py /^def train_online(project="simpletalk"):$/;" kind:function line:69 69 | unicode_literals ../clofusbot/policy.py /^from __future__ import unicode_literals$/;" kind:namespace line:4 70 | unicode_literals ../clofusbot/rasa.py /^from __future__ import unicode_literals$/;" kind:namespace line:4 71 | utils ../clofusbot/rasa.py /^from rasa_core import utils$/;" kind:namespace line:11 72 | warnings ../clofusbot/rasa.py /^import warnings$/;" kind:namespace line:8 73 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Clofus® Chat Bot Platform 2 | Clofus® Chat Bot Platform is a web application built using latest frameworks and database such as nodejs, expressjs, vuejs, mongodb etc., on top of Rasa NLU and Rasa Core. 3 | Clofus® Chat Bot Platform provides a web application to quickly and easily be able to create agents, define intents, entities and stories, It also provides some convenience features for Rasa NLU, like training your models testing chat interface, multi domain support. 4 | 5 | ## Demo 6 | [Live Chat Demo](https://clofus.github.io/clofus-chatbot/) 7 | 8 | 9 | ## Goal 10 | The goal of this project is to build an opensource chat platform better than proprietary Google DialogFlow, Alexa etc., using machine learning multi turn story conversations without using any proprietary API 11 | 12 | 13 | ## Differentiator 14 | - Training data stored in Mongo DB 15 | - UI for managing training data both NLU and Stories 16 | - This is the only project I found to have support for multi domain conversation using rasa core and rasa NLU 17 | - Has integrated chat interface 18 | - Has integrated train/start/stop server 19 | - Built on top of modern frameworks such as express, vuejs and mongodb 20 | 21 | ### Prerequisites 22 | 23 | [Rasa NLU](https://github.com/golastmile/rasa_nlu) - Version Master branch 24 | 25 | [Rasa Core](https://github.com/golastmile/rasa_nlu) - Version Master branch 26 | 27 | [Mongodb](https://www.mongodb.com) - Used for storing training data (entities, intents, synonyms, stories etc.) 28 | 29 | [Node.js/npm](https://nodejs.org/en/) - Serves Clofus Chat Bot UI for both training and chat interface) 30 | 31 | 32 | ## Setup project 33 | ``` 34 | git clone https://github.com/clofus/clofus-chatbot.git 35 | 36 | npm install 37 | 38 | (cd chatbot_ui && npm install) 39 | ``` 40 | 41 | ## Start server 42 | - node server.js 43 | 44 | ## Browser Demo Link 45 | - http://localhost:9090/#/ 46 | 47 | 48 | ## Screenshot 49 | 50 | ![Screenshot1](https://github.com/clofus/clofus-chatbot/blob/master/resources/screenshot.png) 51 | 52 | 53 | ## Contribution 54 | We are open to Contributions from everyone to this project inorder to make this a open chat bot platform that works 100% offline without any proprietary API 55 | 56 | 57 | ## For Support & more information 58 | Visit us at [https://clofusinnovations.com](https://clofusinnovations.com) 59 | 60 | Visit us at [https://clofus.com](https://clofus.com) 61 | 62 | For any queries email me at karthikbalu.meng@gmail.com 63 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal -------------------------------------------------------------------------------- /chatbot_ui/css/chatbot.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | .container{ 8 | background-color: #fff!important; 9 | /* width: 100%; */ 10 | padding: 0 200px !important; 11 | margin-right: auto; 12 | margin-left: auto; 13 | } 14 | .content-bot{ 15 | background-color: transparent !important; 16 | } 17 | .body-data{ 18 | margin: 0px !important; 19 | background-color: #b5e7f3 !important; 20 | font-family: 'Source Sans Pro', sans-serif; 21 | } 22 | .boxicons{ 23 | font-size: 50px !important; 24 | padding: 0% 5% 0% 5%; 25 | color: #11b5dc; 26 | } 27 | .boxfonts{ 28 | font-size: 25px; 29 | font-family: 'Source Sans Pro', sans-serif; 30 | /* padding: 0% 5% 0% 5%; */ 31 | color: black; 32 | } 33 | .inside-content{ 34 | border: 1px solid #cfcbcb; 35 | border-radius: 5px; 36 | background-color: #fff !important; 37 | /* border: 1px solid #cfcbcb; */ 38 | 39 | padding: 0px !important; 40 | /* border-right: 1px solid #cfcbcb; */ 41 | /* border-left: 1px solid #cfcbcb; */ 42 | } 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | .job-title{ 66 | /* border-bottom: 1px solid #f1f1f1; */ 67 | background-color: white; 68 | border-radius: 3px; 69 | padding: 1px; 70 | text-align: center; 71 | } 72 | .des-content{ 73 | padding-bottom: 2%; 74 | } 75 | .form-control{ 76 | display: inline-block; 77 | width: 87%; 78 | height: 34px; 79 | padding: 6px 12px; 80 | font-size: 14px; 81 | line-height: 1.42857143; 82 | color: #555; 83 | background-color: #fff; 84 | background-image: none; 85 | border: 1px solid #ccc; 86 | border-radius: 4px; 87 | -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075); 88 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075); 89 | -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s; 90 | -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; 91 | transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; 92 | } 93 | 94 | 95 | 96 | .btn-readmore{ 97 | border: 1px solid #b7b5b5; 98 | padding: 2px 4px; 99 | border-radius: 4px; 100 | /* margin-bottom: 10px; */ 101 | float: right; 102 | cursor: pointer; 103 | color: #000; 104 | background-color: #f1f1f1; 105 | } 106 | .btn-primary { 107 | color: #fff; 108 | background-color: #337ab7; 109 | border-color: #2e6da4; 110 | } 111 | .button-ok{ 112 | padding: 10px; 113 | text-align: center; 114 | margin: 20px; 115 | } 116 | .before-bot{ 117 | text-align: center; 118 | display: none; 119 | /* border-top : 1px solid #f1f1f1; */ 120 | /* min-height: 400px; */ 121 | background-color: aliceblue; 122 | border-radius: 10px; 123 | width: 70%; 124 | margin-right: 15%; 125 | margin-left: 15%; 126 | } 127 | .btn-hr{ 128 | display: inline-block; 129 | padding: 6px 12px; 130 | margin-bottom: 0; 131 | font-size: 14px; 132 | font-weight: 400; 133 | line-height: 1.42857143; 134 | text-align: center; 135 | white-space: nowrap; 136 | vertical-align: middle; 137 | -ms-touch-action: manipulation; 138 | touch-action: manipulation; 139 | cursor: pointer; 140 | -webkit-user-select: none; 141 | -moz-user-select: none; 142 | -ms-user-select: none; 143 | user-select: none; 144 | background-image: none; 145 | border: 1px solid #0000; 146 | border-radius: 4px; 147 | } 148 | 149 | .speaker{ 150 | position: absolute; 151 | right: 77px; 152 | top: 297px; 153 | } 154 | .recorder{ 155 | position: absolute; 156 | left: 77px; 157 | top: 297px; 158 | border: 2px solid #bb3221; 159 | border-radius: 50%; 160 | padding: 20px; 161 | /* left: -165px; 162 | top: 250px; */ 163 | } 164 | 165 | .hidedetails{ 166 | overflow: hidden; 167 | max-height: 200px; 168 | } 169 | .full-details{ 170 | /* width: 250px; */ 171 | min-height: auto; 172 | white-space: nowrap; 173 | overflow: hidden; 174 | text-overflow: ellipsis; 175 | } 176 | 177 | @media screen and (max-width: 767px){ 178 | .container { 179 | background-color: #fff!important; 180 | /* width: 100%; */ 181 | padding: 0 10px !important; 182 | margin-right: auto; 183 | margin-left: auto; 184 | } 185 | } 186 | 187 | /* APllication form */ 188 | 189 | .application-form-content{ 190 | /* border: 1px solid #cfcbcb; */ 191 | border-radius: 5px; 192 | background-color: #fff !important; 193 | /* border: 1px solid #cfcbcb; */ 194 | padding: 0px !important; 195 | margin-top: 40px; 196 | /* border-right: 1px solid #cfcbcb; */ 197 | /* border-left: 1px solid #cfcbcb; */ 198 | } 199 | .bt-hold{ 200 | margin: 20px; 201 | text-align: center; 202 | } 203 | .btn-submit{ 204 | padding: 10px 20px; 205 | border-radius: 5px; 206 | cursor: pointer; 207 | } 208 | .form-input{ 209 | display: block; 210 | margin-top: 10px; 211 | width: 87%; 212 | height: 25px; 213 | padding: 6px 12px; 214 | font-size: 14px; 215 | line-height: 1.42857143; 216 | color: #555; 217 | background-color: #fff; 218 | background-image: none; 219 | border: 1px solid #ccc; 220 | border-radius: 4px; 221 | -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075); 222 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075); 223 | -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s; 224 | -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; 225 | transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; 226 | } 227 | 228 | /* Job-List */ 229 | .job-list-content{ 230 | padding: 1px !important; 231 | margin-top: 40px; 232 | border-radius: 5px; 233 | } 234 | .list-one{ 235 | margin: 20px -10px 5px -10px; 236 | border-radius: 5px; 237 | padding: 2px 0px 2px 0px; 238 | background-color: white; 239 | } 240 | .list-one:hover{ 241 | background-color: #e9fffe; 242 | } 243 | /* article{ 244 | border-bottom: 1px solid #cfcbcb; 245 | } */ 246 | 247 | .btn-apply{ 248 | border: 1px solid #f1f1f1; 249 | padding: 10px 15px; 250 | border-radius: 4px; 251 | float: right; 252 | cursor: pointer; 253 | color: white; 254 | background-color: #11b5dc; 255 | text-decoration: none; 256 | font-weight: bold; 257 | 258 | } 259 | .btn-apply:hover{ 260 | background-color: white; 261 | color: #11b5dc; 262 | border: 1px solid #11b5dc; 263 | } 264 | 265 | .jobdetailspan{ 266 | margin: 2px 0px 2px 0px; 267 | text-transform: capitalize; 268 | font-size: 17px; 269 | } 270 | 271 | .submitbutton{ 272 | border: 1px solid #f1f1f1; 273 | padding: 10px 15px; 274 | border-radius: 4px; 275 | color: white; 276 | background-color: #11b5dc; 277 | margin-bottom: 20px; 278 | font-weight: bold; 279 | } 280 | .submitbutton:hover{ 281 | background-color: white; 282 | color: #11b5dc; 283 | border: 1px solid #11b5dc; 284 | } 285 | button:disabled, 286 | button[disabled]{ 287 | border: 1px solid #ffffff; 288 | background-color: #a9a9a9; 289 | color: #ffffff; 290 | } 291 | .jobheader{ 292 | border-bottom: 1px solid #f1f1f1; 293 | padding-bottom: 10px; 294 | text-transform: capitalize; 295 | padding-left: 10px; 296 | } 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | .jobdet{ 305 | background-color: aliceblue; 306 | border-radius: 10px; 307 | } 308 | .chatreadmore{ 309 | margin-top: 10px; 310 | border: 1px solid #f1f1f1; 311 | padding: 8px 13px; 312 | border-radius: 4px; 313 | color: white; 314 | background-color: #11b5dc; 315 | margin-bottom: 20px; 316 | font-weight: 300; 317 | float: right; 318 | cursor: pointer; 319 | } 320 | .chatreadmore:hover{ 321 | background-color: white; 322 | color: #11b5dc; 323 | border: 1px solid #11b5dc; 324 | } 325 | .custom-form{ 326 | display: inline-block; 327 | width: calc(100% - 50px); 328 | height: 34px; 329 | padding: 6px 12px; 330 | font-size: 14px; 331 | line-height: 1.42857143; 332 | color: #555; 333 | background-color: #fff; 334 | background-image: none; 335 | border: 1px solid #ccc; 336 | border-radius: 4px; 337 | -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075); 338 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075); 339 | -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s; 340 | -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; 341 | transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; 342 | } 343 | 344 | 345 | -------------------------------------------------------------------------------- /chatbot_ui/css/notify.min.css: -------------------------------------------------------------------------------- 1 | #vue-simple-notify .veh-notify{font-family:Avenir,Helvetica,Arial,sans-serif;background:#fff;border-left:4px solid;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);margin:18px 15px 2px;padding:15px 15px 5px 15px}#vue-simple-notify .veh-dismissable{float:right;font-family:inherit;font-weight:600;margin:0 -10px 0 0;padding:4px;font-size:12px;color:hsla(0,0%,39%,.42);cursor:pointer}#vue-simple-notify .veh-dismissable:hover{color:#646464}#vue-simple-notify .veh-type{font-weight:600;color:#2c3e50}#vue-simple-notify .veh-message{font-weight:400;color:#2c3e50}#vue-simple-notify .veh-list-enter-active,.veh-list-leave-active{transition:all .5s}#vue-simple-notify .veh-list-enter,.veh-list-leave-to{opacity:0;-webkit-transform:translateX(-90px);transform:translateX(-90px)} -------------------------------------------------------------------------------- /chatbot_ui/images/bot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/chatbot_ui/images/bot.png -------------------------------------------------------------------------------- /chatbot_ui/images/chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/chatbot_ui/images/chat.png -------------------------------------------------------------------------------- /chatbot_ui/images/chatbot.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 10 | 11 | 14 | 16 | 19 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /chatbot_ui/images/chatuser.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 30 | 32 | 34 | 35 | 36 | 37 | 39 | 41 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /chatbot_ui/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/chatbot_ui/images/logo.png -------------------------------------------------------------------------------- /chatbot_ui/images/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/chatbot_ui/images/send.png -------------------------------------------------------------------------------- /chatbot_ui/images/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/chatbot_ui/images/user.png -------------------------------------------------------------------------------- /chatbot_ui/js/axios.min.js: -------------------------------------------------------------------------------- 1 | /* axios v0.18.0 | (c) 2018 by Matt Zabriskie */ 2 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){var t=new s(e),n=i(s.prototype.request,t);return o.extend(n,s.prototype,t),o.extend(n,t),n}var o=n(2),i=n(3),s=n(5),u=n(6),a=r(u);a.Axios=s,a.create=function(e){return r(o.merge(u,e))},a.Cancel=n(23),a.CancelToken=n(24),a.isCancel=n(20),a.all=function(e){return Promise.all(e)},a.spread=n(25),e.exports=a,e.exports.default=a},function(e,t,n){"use strict";function r(e){return"[object Array]"===R.call(e)}function o(e){return"[object ArrayBuffer]"===R.call(e)}function i(e){return"undefined"!=typeof FormData&&e instanceof FormData}function s(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function u(e){return"string"==typeof e}function a(e){return"number"==typeof e}function c(e){return"undefined"==typeof e}function f(e){return null!==e&&"object"==typeof e}function p(e){return"[object Date]"===R.call(e)}function d(e){return"[object File]"===R.call(e)}function l(e){return"[object Blob]"===R.call(e)}function h(e){return"[object Function]"===R.call(e)}function m(e){return f(e)&&h(e.pipe)}function y(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function w(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function g(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function v(e,t){if(null!==e&&"undefined"!=typeof e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,o=e.length;n 6 | * @license MIT 7 | */ 8 | e.exports=function(e){return null!=e&&(n(e)||r(e)||!!e._isBuffer)}},function(e,t,n){"use strict";function r(e){this.defaults=e,this.interceptors={request:new s,response:new s}}var o=n(6),i=n(2),s=n(17),u=n(18);r.prototype.request=function(e){"string"==typeof e&&(e=i.merge({url:arguments[0]},arguments[1])),e=i.merge(o,{method:"get"},this.defaults,e),e.method=e.method.toLowerCase();var t=[u,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n},i.forEach(["delete","get","head","options"],function(e){r.prototype[e]=function(t,n){return this.request(i.merge(n||{},{method:e,url:t}))}}),i.forEach(["post","put","patch"],function(e){r.prototype[e]=function(t,n,r){return this.request(i.merge(r||{},{method:e,url:t,data:n}))}}),e.exports=r},function(e,t,n){"use strict";function r(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function o(){var e;return"undefined"!=typeof XMLHttpRequest?e=n(8):"undefined"!=typeof process&&(e=n(8)),e}var i=n(2),s=n(7),u={"Content-Type":"application/x-www-form-urlencoded"},a={adapter:o(),transformRequest:[function(e,t){return s(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(r(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)?(r(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};a.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(e){a.headers[e]={}}),i.forEach(["post","put","patch"],function(e){a.headers[e]=i.merge(u)}),e.exports=a},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(2),o=n(9),i=n(12),s=n(13),u=n(14),a=n(10),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(15);e.exports=function(e){return new Promise(function(t,f){var p=e.data,d=e.headers;r.isFormData(p)&&delete d["Content-Type"];var l=new XMLHttpRequest,h="onreadystatechange",m=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in l||u(e.url)||(l=new window.XDomainRequest,h="onload",m=!0,l.onprogress=function(){},l.ontimeout=function(){}),e.auth){var y=e.auth.username||"",w=e.auth.password||"";d.Authorization="Basic "+c(y+":"+w)}if(l.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,l[h]=function(){if(l&&(4===l.readyState||m)&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in l?s(l.getAllResponseHeaders()):null,r=e.responseType&&"text"!==e.responseType?l.response:l.responseText,i={data:r,status:1223===l.status?204:l.status,statusText:1223===l.status?"No Content":l.statusText,headers:n,config:e,request:l};o(t,f,i),l=null}},l.onerror=function(){f(a("Network Error",e,null,l)),l=null},l.ontimeout=function(){f(a("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",l)),l=null},r.isStandardBrowserEnv()){var g=n(16),v=(e.withCredentials||u(e.url))&&e.xsrfCookieName?g.read(e.xsrfCookieName):void 0;v&&(d[e.xsrfHeaderName]=v)}if("setRequestHeader"in l&&r.forEach(d,function(e,t){"undefined"==typeof p&&"content-type"===t.toLowerCase()?delete d[t]:l.setRequestHeader(t,e)}),e.withCredentials&&(l.withCredentials=!0),e.responseType)try{l.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){l&&(l.abort(),f(e),l=null)}),void 0===p&&(p=null),l.send(p)})}},function(e,t,n){"use strict";var r=n(10);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";var r=n(11);e.exports=function(e,t,n,o,i){var s=new Error(e);return r(s,t,n,o,i)}},function(e,t){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e}},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=n(2);e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(o.isURLSearchParams(t))i=t.toString();else{var s=[];o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)?t+="[]":e=[e],o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),s.push(r(t)+"="+r(e))}))}),i=s.join("&")}return i&&(e+=(e.indexOf("?")===-1?"?":"&")+i),e}},function(e,t,n){"use strict";var r=n(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,s={};return e?(r.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;"set-cookie"===t?s[t]=(s[t]?s[t]:[]).concat([n]):s[t]=s[t]?s[t]+", "+n:n}}),s):s}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(n){var o=r.isString(n)?e(n):n;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t){"use strict";function n(){this.message="String contains an invalid character"}function r(e){for(var t,r,i=String(e),s="",u=0,a=o;i.charAt(0|u)||(a="=",u%1);s+=a.charAt(63&t>>8-u%1*8)){if(r=i.charCodeAt(u+=.75),r>255)throw new n;t=t<<8|r}return s}var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.prototype=new Error,n.prototype.code=5,n.prototype.name="InvalidCharacterError",e.exports=r},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,i,s){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,n){"use strict";function r(){this.handlers=[]}var o=n(2);r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){o.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t,n){"use strict";function r(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var o=n(2),i=n(19),s=n(20),u=n(6),a=n(21),c=n(22);e.exports=function(e){r(e),e.baseURL&&!a(e.url)&&(e.url=c(e.baseURL,e.url)),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=o.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]});var t=e.adapter||u.adapter;return t(e).then(function(t){return r(e),t.data=i(t.data,t.headers,e.transformResponse),t},function(t){return s(t)||(r(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}var o=n(23);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e,t=new r(function(t){e=t});return{token:t,cancel:e}},e.exports=r},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}}])}); 9 | //# sourceMappingURL=axios.min.map -------------------------------------------------------------------------------- /chatbot_ui/js/index.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | $('#toggle').click(function(){ 3 | $('#target').toggleClass('active'); 4 | }); 5 | }); -------------------------------------------------------------------------------- /chatbot_ui/js/vue-simple-notify.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VueSimpleNotify=t():e.VueSimpleNotify=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var s=n[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=1)}([function(e,t,n){"use strict";t.a={name:"VueSimpleNotify",props:{items:{type:Array,default:null,required:!0},delay:{type:Number,default:500}},data:function(){return{notifications:[]}},mounted:function(){this.normalizeParams(),this.display(this)},methods:{normalizeParams:function(){this.items.map(function(e,t){return e.index=t,e.dismissable=void 0===e.dismissable||e.dismissable,e.type=void 0!==e.type?e.type:"Error",e.color=void 0!==e.color?e.color:"#dc3232",e.message=void 0!==e.message?e.message:"",e})},display:function(e){this.clear(),this.items.forEach(function(t,n){setTimeout(function(){e.notifications.push(t)},e.delay*n+1)})},dismiss:function(e){this.notifications.splice(e,1),this.$emit("onDismiss",e)},clear:function(){this.notifications=[]}},watch:{items:function(){this.normalizeParams(),this.display(this)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2);n.d(t,"VueSimpleNotify",function(){return i.a}),t.default=i.a},function(e,t,n){"use strict";function i(e){n(3)}var s=n(0),o=n(5),r=n(4),a=i,c=r(s.a,o.a,!1,a,null,null);t.a=c.exports},function(e,t){},function(e,t){e.exports=function(e,t,n,i,s,o){var r,a=e=e||{},c=typeof e.default;"object"!==c&&"function"!==c||(r=e,a=e.default);var u="function"==typeof a?a.options:a;t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),s&&(u._scopeId=s);var f;if(o?(f=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=f):i&&(f=i),f){var l=u.functional,d=l?u.render:u.beforeCreate;l?(u._injectStyles=f,u.render=function(e,t){return f.call(t),d(e,t)}):u.beforeCreate=d?[].concat(d,f):[f]}return{esModule:r,exports:a,options:u}}},function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition-group",{attrs:{id:"vue-simple-notify",name:"veh-list",tag:"div"}},e._l(e.notifications,function(t){return n("div",{key:t.index},[n("div",{staticClass:"veh-notify",style:{color:t.color}},[t.dismissable?n("div",{staticClass:"veh-dismissable",on:{click:function(n){e.dismiss(t.index)}}},[e._v("✕\n ")]):e._e(),e._v(" "),n("p",[n("span",{staticClass:"veh-type"},[e._v(e._s(t.type)+":")]),e._v(" "),n("span",{staticClass:"veh-message"},[e._v(e._s(t.message))])])])])}))},s=[],o={render:i,staticRenderFns:s};t.a=o}])}); -------------------------------------------------------------------------------- /chatbot_ui/license.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | -------------------------------------------------------------------------------- /chatbot_ui/node_modules/.bin/mime: -------------------------------------------------------------------------------- 1 | ../mime/cli.js -------------------------------------------------------------------------------- /chatbot_ui/node_modules/.bin/oc: -------------------------------------------------------------------------------- 1 | ../opencollective/dist/bin/opencollective.js -------------------------------------------------------------------------------- /chatbot_ui/node_modules/.bin/opencollective: -------------------------------------------------------------------------------- 1 | ../opencollective/dist/bin/opencollective.js -------------------------------------------------------------------------------- /chatbot_ui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chatbot_ui", 3 | "version": "1.0.0", 4 | "description": "Chatbot ui for Rasa NLU/Core", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Ashwin", 10 | "license": "ISC", 11 | "dependencies": { 12 | "bootstrap-vue": "^2.0.0-rc.9", 13 | "express": "^4.16.3", 14 | "vue": "^2.5.16", 15 | "vue-router": "^3.0.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /chatbot_ui/plugins/remarkable-bootstrap-notify/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "remarkable-bootstrap-notify", 3 | "main": "bootstrap-notify.js", 4 | "version": "3.1.3", 5 | "homepage": "http://bootstrap-notify.remabledesigns.com/", 6 | "authors": [ 7 | "mouse0270 " 8 | ], 9 | "description": "This is a simple plugin that turns standard Bootstrap alerts into \"Growl-like\" notifications.", 10 | "keywords": [ 11 | "remarkable", 12 | "bootstrap", 13 | "jquery", 14 | "notify", 15 | "notification", 16 | "notifications", 17 | "growl", 18 | "message", 19 | "notice" 20 | ], 21 | "dependencies": { 22 | "jquery": ">=1.10.2", 23 | "bootstrap": ">=2.0.0" 24 | }, 25 | "license": "MIT", 26 | "ignore": [], 27 | "_release": "3.1.3", 28 | "_resolution": { 29 | "type": "version", 30 | "tag": "3.1.3", 31 | "commit": "c6a3e3acafda0815cce3703103499b6262500cd7" 32 | }, 33 | "_source": "https://github.com/mouse0270/bootstrap-notify.git", 34 | "_target": "^3.1.3", 35 | "_originalSource": "remarkable-bootstrap-notify", 36 | "_direct": true 37 | } -------------------------------------------------------------------------------- /chatbot_ui/plugins/remarkable-bootstrap-notify/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /chatbot_ui/plugins/remarkable-bootstrap-notify/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | // Project configuration. 3 | grunt.initConfig({ 4 | pkg: grunt.file.readJSON('package.json'), 5 | uglify: { 6 | options: { 7 | compress: { 8 | drop_console: true 9 | }, 10 | preserveComments: 'some' 11 | }, 12 | default: { 13 | files: { 14 | 'bootstrap-notify.min.js': ['bootstrap-notify.js'] 15 | } 16 | } 17 | }, 18 | jshint: { 19 | options: { 20 | jshintrc: 'jshintrc.json' 21 | }, 22 | default: { 23 | src: 'bootstrap-notify.js' 24 | } 25 | }, 26 | exec: { 27 | 'meteor-test': 'node_modules/.bin/spacejam test-packages ./' 28 | } 29 | }); 30 | 31 | grunt.loadNpmTasks('grunt-contrib-uglify'); 32 | grunt.loadNpmTasks('grunt-contrib-jshint'); 33 | grunt.loadNpmTasks('grunt-exec'); 34 | 35 | grunt.registerTask('test', ['jshint', 'exec:meteor-test']); 36 | grunt.registerTask('default', ['uglify']); 37 | }; 38 | -------------------------------------------------------------------------------- /chatbot_ui/plugins/remarkable-bootstrap-notify/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Robert McIntosh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /chatbot_ui/plugins/remarkable-bootstrap-notify/README.md: -------------------------------------------------------------------------------- 1 | # Bootstrap Notify 2 | This is a simple plugin that turns standard Bootstrap alerts into "Growl-like" notifications. 3 | 4 | ## Bower Officially Supported 5 | I would like to thank [Błażej Krysiak](https://github.com/IjinPL) for doing this! 6 | ``` 7 | bower install remarkable-bootstrap-notify 8 | ``` 9 | 10 | ## Meteor Officially Supported 11 | Meteor integration by [zimme](https://github.com/zimme). 12 | 13 | ```sh 14 | meteor add mouse0270:bootstrap-notify 15 | ``` 16 | 17 | ## Changelog 18 | ##### Version 3.1.3 19 | - Added Meteor Support 20 | - Fixed issue with Glyphicons Pro 21 | - Updating version pattern. 22 | ``` 23 | x.y.z 24 | x = Main version of the plugin 25 | y = New features were added to the plugin 26 | z = Fixes/patches to existing features of the plugin 27 | ``` 28 | 29 | ##### [Version 3.0.2](http://bootstrap-notify.remabledesigns.com/3.0.2/) 30 | - Fixed update for backwards compatibility 31 | 32 | ##### [Version 3.0.1](http://bootstrap-notify.remabledesigns.com/3.0.1/) 33 | - Add the ability to update multiple values in one call 34 | - Turn off Progress bar 35 | - Set Progress bar value / Progress bar not shown by default 36 | ``` javascript 37 | //Update 38 | var notify = $.notify('Saving Do not close this page...', { allow_dismiss: false }); 39 | notify.update({ type: 'success', 'Success Your page has been saved!' }); 40 | 41 | // Turn of Progress bar on 42 | $.notify('I have a progress bar', { showProgressbar: true }); 43 | 44 | // Update Progress bar 45 | var notify = $.notify('Saving Do not close this page...', { allow_dismiss: false }); 46 | notify.update({ type: 'warning', 'Oops Something happened. Correcting Now', progress: 20 }); 47 | ``` 48 | 49 | ##### [Version 3.0.0](http://bootstrap-notify.remabledesigns.com/3.0.0/) 50 | - New template structure 51 | - Better event handling for onShow, onShown, onClose, onClosed 52 | - updating notification content will reposition growls below it 53 | - Fixed updating icon images 54 | - Fixed IE Issues with Growl URL not being able to be clicked on 55 | - Added the ability to show progress bars 56 | - Added the ability to pass position in the settings 57 | - Added *_newest_on_top_* option that allows new growls to push down old growls 58 | - Added Transition CSS to plugin 59 | ```css 60 | tranition: all 0.5 ease-in-out; 61 | ``` 62 | - Remember to read to documenation. I use custom css style's for the progress bar that you can find there. This was left out of the plugin so you could choose to use the default progressbar styles provided for bootstrap or write your own. 63 | 64 | ##### [Version 2.0.1](http://bootstrap-growl.remabledesigns.com/2.0.1/) 65 | - Added the ability to set an X and Y value within the offset option 66 | - Added callback options onShow, onShown, onHide and onHidden 67 | - Added a close all method to close all open growls 68 | 69 | ##### [Version 2.0.0a3](http://bootstrap-growl.remabledesigns.com/2.0.0a3/) 70 | - Fixed issue with growl not closing if there was no CSS animations 71 | 72 | ##### [Version 2.0.0a2](http://bootstrap-growl.remabledesigns.com/2.0.0a2/) (with IE8 Support) 73 | - Changed animate.in to animate.enter for IE8 compatibility 74 | - Changed animate.out to animate.exit for IE8 compatibility 75 | - Modified .is(':hover') for IE8 compatibility 76 | 77 | ##### [Version 2.0.0a1](http://bootstrap-growl.remabledesigns.com/2.0.0a1/) 78 | - Better Minification 79 | 80 | ##### [Version 2.0.0a](http://bootstrap-growl.remabledesigns.com/2.0.0a1/) 81 | - Major rewright of the plugin file. 82 | - Added the ability to pass the growl a link making it clickable. 83 | - Added the ability to control the growl animations in and out using css. 84 | - Added the ability to set growl settings globally. 85 | - Removed jQuery fadeIn (use css to control growl animations) 86 | 87 | ##### [Version 1.0.6](http://bootstrap-growl.remabledesigns.com/1.0.6/) 88 | - Added onGrowlShow and onGrowlShown callback functionality. 89 | 90 | ##### Version 1.0.5 91 | - Better positioning when using CSS animations after growl closes. 92 | 93 | ##### Version 1.0.4 94 | - Updated $.growl() to return a wrapper object with a small API to let you control individual notifications after they have been created. 95 | - Added onGrowlClose and onGrowlClosed callback functionality. 96 | 97 | ##### Version 1.0.3 98 | - Made jQuery $.extend() Recursive so when you change just one option under position or template the script wont fail 99 | 100 | ##### Version 1.0.2 101 | - Fixed an issue where $.growl("message") would thrown an exception | Provided by [DannyJo](https://github.com/DannyJo/bootstrap-growl) 102 | 103 | ##### Version 1.0.0 104 | - Initial Release 105 | 106 | ## Demo 107 | I have created a small demo to show off some of the features that you can use with this plugin. http://bootstrap-growl.remabledesigns.com/ 108 | 109 | ## Dependencies 110 | - [jQuery v1.10.2](http://jquery.com/) 111 | - [Bootstrap v2.0.0 - 3.2.0](http://getbootstrap.com/) 112 | 113 | 114 | ## Documentation 115 | There is alot of documentation on the website. Click the link below to read it. 116 | - [Documentation](http://bootstrap-notify.remabledesigns.com/#documentation) 117 | 118 | ## Copyright and License 119 | The MIT License (MIT) 120 | Copyright (c) 2014 Robert McIntosh 121 | 122 | Permission is hereby granted, free of charge, to any person obtaining a copy of 123 | this software and associated documentation files (the "Software"), to deal in 124 | the Software without restriction, including without limitation the rights to 125 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 126 | the Software, and to permit persons to whom the Software is furnished to do so, 127 | subject to the following conditions: 128 | 129 | The above copyright notice and this permission notice shall be included in all 130 | copies or substantial portions of the Software. 131 | 132 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 133 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 134 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 135 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 136 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 137 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 138 | -------------------------------------------------------------------------------- /chatbot_ui/plugins/remarkable-bootstrap-notify/bootstrap-notify.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Bootstrap Notify = v3.1.3 3 | * Description: Turns standard Bootstrap alerts into "Growl-like" notifications. 4 | * Author: Mouse0270 aka Robert McIntosh 5 | * License: MIT License 6 | * Website: https://github.com/mouse0270/bootstrap-growl 7 | */ 8 | (function (factory) { 9 | if (typeof define === 'function' && define.amd) { 10 | // AMD. Register as an anonymous module. 11 | define(['jquery'], factory); 12 | } else if (typeof exports === 'object') { 13 | // Node/CommonJS 14 | factory(require('jquery')); 15 | } else { 16 | // Browser globals 17 | factory(jQuery); 18 | } 19 | }(function ($) { 20 | // Create the defaults once 21 | var defaults = { 22 | element: 'body', 23 | position: null, 24 | type: "info", 25 | allow_dismiss: true, 26 | newest_on_top: false, 27 | showProgressbar: false, 28 | placement: { 29 | from: "top", 30 | align: "right" 31 | }, 32 | offset: 20, 33 | spacing: 10, 34 | z_index: 1031, 35 | delay: 5000, 36 | timer: 1000, 37 | url_target: '_blank', 38 | mouse_over: null, 39 | animate: { 40 | enter: 'animated fadeInDown', 41 | exit: 'animated fadeOutUp' 42 | }, 43 | onShow: null, 44 | onShown: null, 45 | onClose: null, 46 | onClosed: null, 47 | icon_type: 'class', 48 | template: '' 49 | }; 50 | 51 | String.format = function() { 52 | var str = arguments[0]; 53 | for (var i = 1; i < arguments.length; i++) { 54 | str = str.replace(RegExp("\\{" + (i - 1) + "\\}", "gm"), arguments[i]); 55 | } 56 | return str; 57 | }; 58 | 59 | function Notify ( element, content, options ) { 60 | // Setup Content of Notify 61 | var content = { 62 | content: { 63 | message: typeof content == 'object' ? content.message : content, 64 | title: content.title ? content.title : '', 65 | icon: content.icon ? content.icon : '', 66 | url: content.url ? content.url : '#', 67 | target: content.target ? content.target : '-' 68 | } 69 | }; 70 | 71 | options = $.extend(true, {}, content, options); 72 | this.settings = $.extend(true, {}, defaults, options); 73 | this._defaults = defaults; 74 | if (this.settings.content.target == "-") { 75 | this.settings.content.target = this.settings.url_target; 76 | } 77 | this.animations = { 78 | start: 'webkitAnimationStart oanimationstart MSAnimationStart animationstart', 79 | end: 'webkitAnimationEnd oanimationend MSAnimationEnd animationend' 80 | } 81 | 82 | if (typeof this.settings.offset == 'number') { 83 | this.settings.offset = { 84 | x: this.settings.offset, 85 | y: this.settings.offset 86 | }; 87 | } 88 | 89 | this.init(); 90 | }; 91 | 92 | $.extend(Notify.prototype, { 93 | init: function () { 94 | var self = this; 95 | 96 | this.buildNotify(); 97 | if (this.settings.content.icon) { 98 | this.setIcon(); 99 | } 100 | if (this.settings.content.url != "#") { 101 | this.styleURL(); 102 | } 103 | this.placement(); 104 | this.bind(); 105 | 106 | this.notify = { 107 | $ele: this.$ele, 108 | update: function(command, update) { 109 | var commands = {}; 110 | if (typeof command == "string") { 111 | commands[command] = update; 112 | }else{ 113 | commands = command; 114 | } 115 | for (var command in commands) { 116 | switch (command) { 117 | case "type": 118 | this.$ele.removeClass('alert-' + self.settings.type); 119 | this.$ele.find('[data-notify="progressbar"] > .progress-bar').removeClass('progress-bar-' + self.settings.type); 120 | self.settings.type = commands[command]; 121 | this.$ele.addClass('alert-' + commands[command]).find('[data-notify="progressbar"] > .progress-bar').addClass('progress-bar-' + commands[command]); 122 | break; 123 | case "icon": 124 | var $icon = this.$ele.find('[data-notify="icon"]'); 125 | if (self.settings.icon_type.toLowerCase() == 'class') { 126 | $icon.removeClass(self.settings.content.icon).addClass(commands[command]); 127 | }else{ 128 | if (!$icon.is('img')) { 129 | $icon.find('img'); 130 | } 131 | $icon.attr('src', commands[command]); 132 | } 133 | break; 134 | case "progress": 135 | var newDelay = self.settings.delay - (self.settings.delay * (commands[command] / 100)); 136 | this.$ele.data('notify-delay', newDelay); 137 | this.$ele.find('[data-notify="progressbar"] > div').attr('aria-valuenow', commands[command]).css('width', commands[command] + '%'); 138 | break; 139 | case "url": 140 | this.$ele.find('[data-notify="url"]').attr('href', commands[command]); 141 | break; 142 | case "target": 143 | this.$ele.find('[data-notify="url"]').attr('target', commands[command]); 144 | break; 145 | default: 146 | this.$ele.find('[data-notify="' + command +'"]').html(commands[command]); 147 | }; 148 | } 149 | var posX = this.$ele.outerHeight() + parseInt(self.settings.spacing) + parseInt(self.settings.offset.y); 150 | self.reposition(posX); 151 | }, 152 | close: function() { 153 | self.close(); 154 | } 155 | }; 156 | }, 157 | buildNotify: function () { 158 | var content = this.settings.content; 159 | this.$ele = $(String.format(this.settings.template, this.settings.type, content.title, content.message, content.url, content.target)); 160 | this.$ele.attr('data-notify-position', this.settings.placement.from + '-' + this.settings.placement.align); 161 | if (!this.settings.allow_dismiss) { 162 | this.$ele.find('[data-notify="dismiss"]').css('display', 'none'); 163 | } 164 | if ((this.settings.delay <= 0 && !this.settings.showProgressbar) || !this.settings.showProgressbar) { 165 | this.$ele.find('[data-notify="progressbar"]').remove(); 166 | } 167 | }, 168 | setIcon: function() { 169 | if (this.settings.icon_type.toLowerCase() == 'class') { 170 | this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon); 171 | }else{ 172 | if (this.$ele.find('[data-notify="icon"]').is('img')) { 173 | this.$ele.find('[data-notify="icon"]').attr('src', this.settings.content.icon); 174 | }else{ 175 | this.$ele.find('[data-notify="icon"]').append('Notify Icon'); 176 | } 177 | } 178 | }, 179 | styleURL: function() { 180 | this.$ele.find('[data-notify="url"]').css({ 181 | backgroundImage: 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)', 182 | height: '100%', 183 | left: '0px', 184 | position: 'absolute', 185 | top: '0px', 186 | width: '100%', 187 | zIndex: this.settings.z_index + 1 188 | }); 189 | this.$ele.find('[data-notify="dismiss"]').css({ 190 | position: 'absolute', 191 | right: '10px', 192 | top: '5px', 193 | zIndex: this.settings.z_index + 2 194 | }); 195 | }, 196 | placement: function() { 197 | var self = this, 198 | offsetAmt = this.settings.offset.y, 199 | css = { 200 | display: 'inline-block', 201 | margin: '0px auto', 202 | position: this.settings.position ? this.settings.position : (this.settings.element === 'body' ? 'fixed' : 'absolute'), 203 | transition: 'all .5s ease-in-out', 204 | zIndex: this.settings.z_index 205 | }, 206 | hasAnimation = false, 207 | settings = this.settings; 208 | 209 | $('[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])').each(function() { 210 | return offsetAmt = Math.max(offsetAmt, parseInt($(this).css(settings.placement.from)) + parseInt($(this).outerHeight()) + parseInt(settings.spacing)); 211 | }); 212 | if (this.settings.newest_on_top == true) { 213 | offsetAmt = this.settings.offset.y; 214 | } 215 | css[this.settings.placement.from] = offsetAmt+'px'; 216 | 217 | switch (this.settings.placement.align) { 218 | case "left": 219 | case "right": 220 | css[this.settings.placement.align] = this.settings.offset.x+'px'; 221 | break; 222 | case "center": 223 | css.left = 0; 224 | css.right = 0; 225 | break; 226 | } 227 | this.$ele.css(css).addClass(this.settings.animate.enter); 228 | $.each(Array('webkit', 'moz', 'o', 'ms', ''), function(index, prefix) { 229 | self.$ele[0].style[prefix+'AnimationIterationCount'] = 1; 230 | }); 231 | 232 | $(this.settings.element).append(this.$ele); 233 | 234 | if (this.settings.newest_on_top == true) { 235 | offsetAmt = (parseInt(offsetAmt)+parseInt(this.settings.spacing)) + this.$ele.outerHeight(); 236 | this.reposition(offsetAmt); 237 | } 238 | 239 | if ($.isFunction(self.settings.onShow)) { 240 | self.settings.onShow.call(this.$ele); 241 | } 242 | 243 | this.$ele.one(this.animations.start, function(event) { 244 | hasAnimation = true; 245 | }).one(this.animations.end, function(event) { 246 | if ($.isFunction(self.settings.onShown)) { 247 | self.settings.onShown.call(this); 248 | } 249 | }); 250 | 251 | setTimeout(function() { 252 | if (!hasAnimation) { 253 | if ($.isFunction(self.settings.onShown)) { 254 | self.settings.onShown.call(this); 255 | } 256 | } 257 | }, 600); 258 | }, 259 | bind: function() { 260 | var self = this; 261 | 262 | this.$ele.find('[data-notify="dismiss"]').on('click', function() { 263 | self.close(); 264 | }) 265 | 266 | this.$ele.mouseover(function(e) { 267 | $(this).data('data-hover', "true"); 268 | }).mouseout(function(e) { 269 | $(this).data('data-hover', "false"); 270 | }); 271 | this.$ele.data('data-hover', "false"); 272 | 273 | if (this.settings.delay > 0) { 274 | self.$ele.data('notify-delay', self.settings.delay); 275 | var timer = setInterval(function() { 276 | var delay = parseInt(self.$ele.data('notify-delay')) - self.settings.timer; 277 | if ((self.$ele.data('data-hover') === 'false' && self.settings.mouse_over == "pause") || self.settings.mouse_over != "pause") { 278 | var percent = ((self.settings.delay - delay) / self.settings.delay) * 100; 279 | self.$ele.data('notify-delay', delay); 280 | self.$ele.find('[data-notify="progressbar"] > div').attr('aria-valuenow', percent).css('width', percent + '%'); 281 | } 282 | if (delay <= -(self.settings.timer)) { 283 | clearInterval(timer); 284 | self.close(); 285 | } 286 | }, self.settings.timer); 287 | } 288 | }, 289 | close: function() { 290 | var self = this, 291 | $successors = null, 292 | posX = parseInt(this.$ele.css(this.settings.placement.from)), 293 | hasAnimation = false; 294 | 295 | this.$ele.data('closing', 'true').addClass(this.settings.animate.exit); 296 | self.reposition(posX); 297 | 298 | if ($.isFunction(self.settings.onClose)) { 299 | self.settings.onClose.call(this.$ele); 300 | } 301 | 302 | this.$ele.one(this.animations.start, function(event) { 303 | hasAnimation = true; 304 | }).one(this.animations.end, function(event) { 305 | $(this).remove(); 306 | if ($.isFunction(self.settings.onClosed)) { 307 | self.settings.onClosed.call(this); 308 | } 309 | }); 310 | 311 | setTimeout(function() { 312 | if (!hasAnimation) { 313 | self.$ele.remove(); 314 | if (self.settings.onClosed) { 315 | self.settings.onClosed(self.$ele); 316 | } 317 | } 318 | }, 600); 319 | }, 320 | reposition: function(posX) { 321 | var self = this, 322 | notifies = '[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])', 323 | $elements = this.$ele.nextAll(notifies); 324 | if (this.settings.newest_on_top == true) { 325 | $elements = this.$ele.prevAll(notifies); 326 | } 327 | $elements.each(function() { 328 | $(this).css(self.settings.placement.from, posX); 329 | posX = (parseInt(posX)+parseInt(self.settings.spacing)) + $(this).outerHeight(); 330 | }); 331 | } 332 | }); 333 | 334 | $.notify = function ( content, options ) { 335 | var plugin = new Notify( this, content, options ); 336 | return plugin.notify; 337 | }; 338 | $.notifyDefaults = function( options ) { 339 | defaults = $.extend(true, {}, defaults, options); 340 | return defaults; 341 | }; 342 | $.notifyClose = function( command ) { 343 | if (typeof command === "undefined" || command == "all") { 344 | $('[data-notify]').find('[data-notify="dismiss"]').trigger('click'); 345 | }else{ 346 | $('[data-notify-position="'+command+'"]').find('[data-notify="dismiss"]').trigger('click'); 347 | } 348 | }; 349 | 350 | })); -------------------------------------------------------------------------------- /chatbot_ui/plugins/remarkable-bootstrap-notify/bootstrap-notify.min.js: -------------------------------------------------------------------------------- 1 | /* Project: Bootstrap Growl = v3.1.3 | Description: Turns standard Bootstrap alerts into "Growl-like" notifications. | Author: Mouse0270 aka Robert McIntosh | License: MIT License | Website: https://github.com/mouse0270/bootstrap-growl */ 2 | !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t){function e(e,i,n){var i={content:{message:"object"==typeof i?i.message:i,title:i.title?i.title:"",icon:i.icon?i.icon:"",url:i.url?i.url:"#",target:i.target?i.target:"-"}};n=t.extend(!0,{},i,n),this.settings=t.extend(!0,{},s,n),this._defaults=s,"-"==this.settings.content.target&&(this.settings.content.target=this.settings.url_target),this.animations={start:"webkitAnimationStart oanimationstart MSAnimationStart animationstart",end:"webkitAnimationEnd oanimationend MSAnimationEnd animationend"},"number"==typeof this.settings.offset&&(this.settings.offset={x:this.settings.offset,y:this.settings.offset}),this.init()}var s={element:"body",position:null,type:"info",allow_dismiss:!0,newest_on_top:!1,showProgressbar:!1,placement:{from:"top",align:"right"},offset:20,spacing:10,z_index:1031,delay:5e3,timer:1e3,url_target:"_blank",mouse_over:null,animate:{enter:"animated fadeInDown",exit:"animated fadeOutUp"},onShow:null,onShown:null,onClose:null,onClosed:null,icon_type:"class",template:''};String.format=function(){for(var t=arguments[0],e=1;e .progress-bar').removeClass("progress-bar-"+t.settings.type),t.settings.type=i[e],this.$ele.addClass("alert-"+i[e]).find('[data-notify="progressbar"] > .progress-bar').addClass("progress-bar-"+i[e]);break;case"icon":var n=this.$ele.find('[data-notify="icon"]');"class"==t.settings.icon_type.toLowerCase()?n.removeClass(t.settings.content.icon).addClass(i[e]):(n.is("img")||n.find("img"),n.attr("src",i[e]));break;case"progress":var a=t.settings.delay-t.settings.delay*(i[e]/100);this.$ele.data("notify-delay",a),this.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",i[e]).css("width",i[e]+"%");break;case"url":this.$ele.find('[data-notify="url"]').attr("href",i[e]);break;case"target":this.$ele.find('[data-notify="url"]').attr("target",i[e]);break;default:this.$ele.find('[data-notify="'+e+'"]').html(i[e])}var o=this.$ele.outerHeight()+parseInt(t.settings.spacing)+parseInt(t.settings.offset.y);t.reposition(o)},close:function(){t.close()}}},buildNotify:function(){var e=this.settings.content;this.$ele=t(String.format(this.settings.template,this.settings.type,e.title,e.message,e.url,e.target)),this.$ele.attr("data-notify-position",this.settings.placement.from+"-"+this.settings.placement.align),this.settings.allow_dismiss||this.$ele.find('[data-notify="dismiss"]').css("display","none"),(this.settings.delay<=0&&!this.settings.showProgressbar||!this.settings.showProgressbar)&&this.$ele.find('[data-notify="progressbar"]').remove()},setIcon:function(){"class"==this.settings.icon_type.toLowerCase()?this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon):this.$ele.find('[data-notify="icon"]').is("img")?this.$ele.find('[data-notify="icon"]').attr("src",this.settings.content.icon):this.$ele.find('[data-notify="icon"]').append('Notify Icon')},styleURL:function(){this.$ele.find('[data-notify="url"]').css({backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)",height:"100%",left:"0px",position:"absolute",top:"0px",width:"100%",zIndex:this.settings.z_index+1}),this.$ele.find('[data-notify="dismiss"]').css({position:"absolute",right:"10px",top:"5px",zIndex:this.settings.z_index+2})},placement:function(){var e=this,s=this.settings.offset.y,i={display:"inline-block",margin:"0px auto",position:this.settings.position?this.settings.position:"body"===this.settings.element?"fixed":"absolute",transition:"all .5s ease-in-out",zIndex:this.settings.z_index},n=!1,a=this.settings;switch(t('[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])').each(function(){return s=Math.max(s,parseInt(t(this).css(a.placement.from))+parseInt(t(this).outerHeight())+parseInt(a.spacing))}),1==this.settings.newest_on_top&&(s=this.settings.offset.y),i[this.settings.placement.from]=s+"px",this.settings.placement.align){case"left":case"right":i[this.settings.placement.align]=this.settings.offset.x+"px";break;case"center":i.left=0,i.right=0}this.$ele.css(i).addClass(this.settings.animate.enter),t.each(Array("webkit","moz","o","ms",""),function(t,s){e.$ele[0].style[s+"AnimationIterationCount"]=1}),t(this.settings.element).append(this.$ele),1==this.settings.newest_on_top&&(s=parseInt(s)+parseInt(this.settings.spacing)+this.$ele.outerHeight(),this.reposition(s)),t.isFunction(e.settings.onShow)&&e.settings.onShow.call(this.$ele),this.$ele.one(this.animations.start,function(){n=!0}).one(this.animations.end,function(){t.isFunction(e.settings.onShown)&&e.settings.onShown.call(this)}),setTimeout(function(){n||t.isFunction(e.settings.onShown)&&e.settings.onShown.call(this)},600)},bind:function(){var e=this;if(this.$ele.find('[data-notify="dismiss"]').on("click",function(){e.close()}),this.$ele.mouseover(function(){t(this).data("data-hover","true")}).mouseout(function(){t(this).data("data-hover","false")}),this.$ele.data("data-hover","false"),this.settings.delay>0){e.$ele.data("notify-delay",e.settings.delay);var s=setInterval(function(){var t=parseInt(e.$ele.data("notify-delay"))-e.settings.timer;if("false"===e.$ele.data("data-hover")&&"pause"==e.settings.mouse_over||"pause"!=e.settings.mouse_over){var i=(e.settings.delay-t)/e.settings.delay*100;e.$ele.data("notify-delay",t),e.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",i).css("width",i+"%")}t<=-e.settings.timer&&(clearInterval(s),e.close())},e.settings.timer)}},close:function(){var e=this,s=parseInt(this.$ele.css(this.settings.placement.from)),i=!1;this.$ele.data("closing","true").addClass(this.settings.animate.exit),e.reposition(s),t.isFunction(e.settings.onClose)&&e.settings.onClose.call(this.$ele),this.$ele.one(this.animations.start,function(){i=!0}).one(this.animations.end,function(){t(this).remove(),t.isFunction(e.settings.onClosed)&&e.settings.onClosed.call(this)}),setTimeout(function(){i||(e.$ele.remove(),e.settings.onClosed&&e.settings.onClosed(e.$ele))},600)},reposition:function(e){var s=this,i='[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])',n=this.$ele.nextAll(i);1==this.settings.newest_on_top&&(n=this.$ele.prevAll(i)),n.each(function(){t(this).css(s.settings.placement.from,e),e=parseInt(e)+parseInt(s.settings.spacing)+t(this).outerHeight()})}}),t.notify=function(t,s){var i=new e(this,t,s);return i.notify},t.notifyDefaults=function(e){return s=t.extend(!0,{},s,e)},t.notifyClose=function(e){"undefined"==typeof e||"all"==e?t("[data-notify]").find('[data-notify="dismiss"]').trigger("click"):t('[data-notify-position="'+e+'"]').find('[data-notify="dismiss"]').trigger("click")}}); -------------------------------------------------------------------------------- /chatbot_ui/plugins/remarkable-bootstrap-notify/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "remarkable-bootstrap-notify", 3 | "main": "bootstrap-notify.js", 4 | "version": "3.1.3", 5 | "homepage": "http://bootstrap-notify.remabledesigns.com/", 6 | "authors": [ 7 | "mouse0270 " 8 | ], 9 | "description": "This is a simple plugin that turns standard Bootstrap alerts into \"Growl-like\" notifications.", 10 | "keywords": [ 11 | "remarkable", 12 | "bootstrap", 13 | "jquery", 14 | "notify", 15 | "notification", 16 | "notifications", 17 | "growl", 18 | "message", 19 | "notice" 20 | ], 21 | "dependencies": { 22 | "jquery": ">=1.10.2", 23 | "bootstrap": ">=2.0.0" 24 | }, 25 | "license": "MIT", 26 | "ignore": [] 27 | } 28 | -------------------------------------------------------------------------------- /chatbot_ui/plugins/remarkable-bootstrap-notify/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mouse0270/bootstrap-notify", 3 | "version": "3.1.3", 4 | "type": "library", 5 | "description": "This is a simple pluging that turns standard Bootstrap alerts into \"Growl-like\" notifications.", 6 | "keywords": [ 7 | "bootstrap", 8 | "jquery", 9 | "notify", 10 | "notification", 11 | "notifications", 12 | "growl", 13 | "message", 14 | "notice" 15 | ], 16 | "authors": [ 17 | { 18 | "name": "mouse0270", 19 | "email": "rmcintosh@remabledesigns.com", 20 | "homepage": "http://bootstrap-notify.remabledesigns.com/", 21 | "role": "Developer" 22 | } 23 | ], 24 | "homepage": "http://bootstrap-notify.remabledesigns.com/", 25 | "license": "MIT", 26 | "autoload": {} 27 | } -------------------------------------------------------------------------------- /chatbot_ui/plugins/remarkable-bootstrap-notify/dist/bootstrap-notify.min.js: -------------------------------------------------------------------------------- 1 | /* Project: Bootstrap Growl = v3.1.3 | Description: Turns standard Bootstrap alerts into "Growl-like" notifications. | Author: Mouse0270 aka Robert McIntosh | License: MIT License | Website: https://github.com/mouse0270/bootstrap-growl */ 2 | !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t){function e(e,i,n){var i={content:{message:"object"==typeof i?i.message:i,title:i.title?i.title:"",icon:i.icon?i.icon:"",url:i.url?i.url:"#",target:i.target?i.target:"-"}};n=t.extend(!0,{},i,n),this.settings=t.extend(!0,{},s,n),this._defaults=s,"-"==this.settings.content.target&&(this.settings.content.target=this.settings.url_target),this.animations={start:"webkitAnimationStart oanimationstart MSAnimationStart animationstart",end:"webkitAnimationEnd oanimationend MSAnimationEnd animationend"},"number"==typeof this.settings.offset&&(this.settings.offset={x:this.settings.offset,y:this.settings.offset}),this.init()}var s={element:"body",position:null,type:"info",allow_dismiss:!0,newest_on_top:!1,showProgressbar:!1,placement:{from:"top",align:"right"},offset:20,spacing:10,z_index:1031,delay:5e3,timer:1e3,url_target:"_blank",mouse_over:null,animate:{enter:"animated fadeInDown",exit:"animated fadeOutUp"},onShow:null,onShown:null,onClose:null,onClosed:null,icon_type:"class",template:''};String.format=function(){for(var t=arguments[0],e=1;e .progress-bar').removeClass("progress-bar-"+t.settings.type),t.settings.type=i[e],this.$ele.addClass("alert-"+i[e]).find('[data-notify="progressbar"] > .progress-bar').addClass("progress-bar-"+i[e]);break;case"icon":var n=this.$ele.find('[data-notify="icon"]');"class"==t.settings.icon_type.toLowerCase()?n.removeClass(t.settings.content.icon).addClass(i[e]):(n.is("img")||n.find("img"),n.attr("src",i[e]));break;case"progress":var a=t.settings.delay-t.settings.delay*(i[e]/100);this.$ele.data("notify-delay",a),this.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",i[e]).css("width",i[e]+"%");break;case"url":this.$ele.find('[data-notify="url"]').attr("href",i[e]);break;case"target":this.$ele.find('[data-notify="url"]').attr("target",i[e]);break;default:this.$ele.find('[data-notify="'+e+'"]').html(i[e])}var o=this.$ele.outerHeight()+parseInt(t.settings.spacing)+parseInt(t.settings.offset.y);t.reposition(o)},close:function(){t.close()}}},buildNotify:function(){var e=this.settings.content;this.$ele=t(String.format(this.settings.template,this.settings.type,e.title,e.message,e.url,e.target)),this.$ele.attr("data-notify-position",this.settings.placement.from+"-"+this.settings.placement.align),this.settings.allow_dismiss||this.$ele.find('[data-notify="dismiss"]').css("display","none"),(this.settings.delay<=0&&!this.settings.showProgressbar||!this.settings.showProgressbar)&&this.$ele.find('[data-notify="progressbar"]').remove()},setIcon:function(){"class"==this.settings.icon_type.toLowerCase()?this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon):this.$ele.find('[data-notify="icon"]').is("img")?this.$ele.find('[data-notify="icon"]').attr("src",this.settings.content.icon):this.$ele.find('[data-notify="icon"]').append('Notify Icon')},styleURL:function(){this.$ele.find('[data-notify="url"]').css({backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)",height:"100%",left:"0px",position:"absolute",top:"0px",width:"100%",zIndex:this.settings.z_index+1}),this.$ele.find('[data-notify="dismiss"]').css({position:"absolute",right:"10px",top:"5px",zIndex:this.settings.z_index+2})},placement:function(){var e=this,s=this.settings.offset.y,i={display:"inline-block",margin:"0px auto",position:this.settings.position?this.settings.position:"body"===this.settings.element?"fixed":"absolute",transition:"all .5s ease-in-out",zIndex:this.settings.z_index},n=!1,a=this.settings;switch(t('[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])').each(function(){return s=Math.max(s,parseInt(t(this).css(a.placement.from))+parseInt(t(this).outerHeight())+parseInt(a.spacing))}),1==this.settings.newest_on_top&&(s=this.settings.offset.y),i[this.settings.placement.from]=s+"px",this.settings.placement.align){case"left":case"right":i[this.settings.placement.align]=this.settings.offset.x+"px";break;case"center":i.left=0,i.right=0}this.$ele.css(i).addClass(this.settings.animate.enter),t.each(Array("webkit","moz","o","ms",""),function(t,s){e.$ele[0].style[s+"AnimationIterationCount"]=1}),t(this.settings.element).append(this.$ele),1==this.settings.newest_on_top&&(s=parseInt(s)+parseInt(this.settings.spacing)+this.$ele.outerHeight(),this.reposition(s)),t.isFunction(e.settings.onShow)&&e.settings.onShow.call(this.$ele),this.$ele.one(this.animations.start,function(){n=!0}).one(this.animations.end,function(){t.isFunction(e.settings.onShown)&&e.settings.onShown.call(this)}),setTimeout(function(){n||t.isFunction(e.settings.onShown)&&e.settings.onShown.call(this)},600)},bind:function(){var e=this;if(this.$ele.find('[data-notify="dismiss"]').on("click",function(){e.close()}),this.$ele.mouseover(function(){t(this).data("data-hover","true")}).mouseout(function(){t(this).data("data-hover","false")}),this.$ele.data("data-hover","false"),this.settings.delay>0){e.$ele.data("notify-delay",e.settings.delay);var s=setInterval(function(){var t=parseInt(e.$ele.data("notify-delay"))-e.settings.timer;if("false"===e.$ele.data("data-hover")&&"pause"==e.settings.mouse_over||"pause"!=e.settings.mouse_over){var i=(e.settings.delay-t)/e.settings.delay*100;e.$ele.data("notify-delay",t),e.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",i).css("width",i+"%")}t<=-e.settings.timer&&(clearInterval(s),e.close())},e.settings.timer)}},close:function(){var e=this,s=parseInt(this.$ele.css(this.settings.placement.from)),i=!1;this.$ele.data("closing","true").addClass(this.settings.animate.exit),e.reposition(s),t.isFunction(e.settings.onClose)&&e.settings.onClose.call(this.$ele),this.$ele.one(this.animations.start,function(){i=!0}).one(this.animations.end,function(){t(this).remove(),t.isFunction(e.settings.onClosed)&&e.settings.onClosed.call(this)}),setTimeout(function(){i||(e.$ele.remove(),e.settings.onClosed&&e.settings.onClosed(e.$ele))},600)},reposition:function(e){var s=this,i='[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])',n=this.$ele.nextAll(i);1==this.settings.newest_on_top&&(n=this.$ele.prevAll(i)),n.each(function(){t(this).css(s.settings.placement.from,e),e=parseInt(e)+parseInt(s.settings.spacing)+t(this).outerHeight()})}}),t.notify=function(t,s){var i=new e(this,t,s);return i.notify},t.notifyDefaults=function(e){return s=t.extend(!0,{},s,e)},t.notifyClose=function(e){"undefined"==typeof e||"all"==e?t("[data-notify]").find('[data-notify="dismiss"]').trigger("click"):t('[data-notify-position="'+e+'"]').find('[data-notify="dismiss"]').trigger("click")}}); -------------------------------------------------------------------------------- /chatbot_ui/plugins/remarkable-bootstrap-notify/jshintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise": true, 3 | "curly": true, 4 | "eqeqeq": true, 5 | "forin": true, 6 | "freeze": true, 7 | "immed": true, 8 | "latedef": true, 9 | "noarg": true, 10 | "noempty": true, 11 | "nonbsp": true, 12 | "nonew": true, 13 | "undef": true, 14 | "unused": true, 15 | "strict": false, 16 | "trailing": true, 17 | "maxparams": 5, 18 | "sub": true, 19 | "devel": true, 20 | "browser": true, 21 | 22 | "globals": { 23 | "jQuery": false 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /chatbot_ui/plugins/remarkable-bootstrap-notify/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | git: 'git://github.com/mouse0270/bootstrap-notify.git', 3 | name: 'mouse0270:bootstrap-notify', 4 | summary: 'Turns standard Bootstrap alerts into "Growl-like" notifications', 5 | version: '3.1.3', 6 | }); 7 | 8 | Package.onUse(function (api) { 9 | api.versionsFrom('1.0'); 10 | api.use('jquery', 'client'); 11 | api.addFiles('bootstrap-notify.js', 'client'); 12 | }); 13 | 14 | Package.onTest(function (api) { 15 | api.use('mouse0270:bootstrap-notify', 'client'); 16 | api.use('tinytest', 'client'); 17 | 18 | api.addFiles('test_meteor.js', 'client'); 19 | }); 20 | -------------------------------------------------------------------------------- /chatbot_ui/plugins/remarkable-bootstrap-notify/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap-notify", 3 | "version": "3.1.3", 4 | "description": "This is a simple plugin that turns standard Bootstrap alerts into \"Growl-like\" notifications.", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/mouse0270/bootstrap-notify.git" 8 | }, 9 | "keywords": [ 10 | "bootstrap", 11 | "jquery", 12 | "notify", 13 | "notification", 14 | "notifications", 15 | "growl", 16 | "message", 17 | "notice" 18 | ], 19 | "author": "mouse0270 ", 20 | "license": "MIT", 21 | "bugs": { 22 | "url": "https://github.com/mouse0270/bootstrap-notify/issues" 23 | }, 24 | "homepage": "http://bootstrap-notify.remabledesigns.com/", 25 | "main": "bootstrap-notify.js", 26 | "directories": { 27 | "dist": "dist" 28 | }, 29 | "dependencies": {}, 30 | "devDependencies": { 31 | "grunt": "^0.4.5", 32 | "grunt-cli": "^0.1.13", 33 | "grunt-contrib-jshint": "^0.10.0", 34 | "grunt-contrib-uglify": "^0.4.0", 35 | "grunt-exec": "^0.4.6", 36 | "spacejam": "^1.1.4" 37 | }, 38 | "scripts": { 39 | "test": "grunt test" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /chatbot_ui/plugins/remarkable-bootstrap-notify/test_meteor.js: -------------------------------------------------------------------------------- 1 | Tinytest.add('Instantiation', function(test) { 2 | test.notEqual($.notify, undefined); 3 | }); 4 | -------------------------------------------------------------------------------- /chatbot_ui/scss/style.scss: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Pacifico); 2 | @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:400,700,300); 3 | $blue: #34495E; 4 | $lightblue: #3498DB; 5 | $darkblue: #2C3E50; 6 | 7 | * { 8 | box-sizing: border-box; 9 | } 10 | 11 | body { 12 | background: lightgray; 13 | font-family: 'Yanone Kaffeesatz', sans-serif; 14 | } 15 | 16 | .row { 17 | &:after, &:before { 18 | content: ''; 19 | display: table; 20 | clear: both; 21 | } 22 | margin: 0 -15px; 23 | } 24 | 25 | .col-1 { width: 33.333%; padding: 0 15px; float: left; } 26 | .col-2 { width: 66.666%; padding: 0 15px; float: left; } 27 | .col-3 { width: 100%; padding: 0 15px; float: left; } 28 | 29 | .wrapper { 30 | display: flex; 31 | min-height: 100vh; 32 | justify-content: center; 33 | padding: 50px 50px; 34 | &_container { 35 | width: 1000px; 36 | max-height: 1000px; 37 | border-radius: 10px; 38 | } 39 | } 40 | 41 | .site-wrapper { 42 | min-height: 500px; 43 | background: #ECECEC; 44 | border-radius: 10px; 45 | overflow: hidden; 46 | box-shadow: 0 5px 15px rgba(0, 0, 0, 0.23); 47 | padding-left: 80px; 48 | padding-right: 30px; 49 | padding-top: 85px; 50 | padding-bottom: 30px; 51 | position: relative; 52 | transition: padding .3s linear; 53 | &_left-col { 54 | position: absolute; 55 | background: $blue; 56 | width: 45px; 57 | height: 100%; 58 | top: 0; 59 | left: 0; 60 | transition: width .3s ease-in-out; 61 | overflow: hidden; 62 | z-index: 20; 63 | border-radius: 10px 0 0 10px; 64 | .logo { 65 | display: block; 66 | background: $lightblue; 67 | padding: 15px; 68 | font-family: 'Pacifico', cursive; 69 | font-size: 24px; 70 | text-decoration: none; 71 | color: transparent; 72 | text-align: center; 73 | transition: background .2s linear; 74 | &:before { 75 | content: 'L'; 76 | color: rgba(255, 255, 255, 0.6); 77 | opacity: 1; 78 | } 79 | &:hover, &:focus { 80 | background: darken($lightblue, 10%); 81 | text-decoration: none; 82 | } 83 | } 84 | .left-nav { 85 | a { 86 | display: block; 87 | line-height: 45px; 88 | border-left: 0 solid $blue; 89 | padding: 0 15px; 90 | text-transform: uppercase; 91 | font-weight: bold; 92 | color: rgba(255, 255, 255, 0.6); 93 | text-decoration: none; 94 | letter-spacing: 2px; 95 | border-bottom: 1px solid $darkblue; 96 | transition: all .2s ease-in-out; 97 | white-space: nowrap; 98 | i { 99 | width: 35px; 100 | } 101 | &:hover, &:focus, &.active { 102 | background: $darkblue; 103 | border-left-color: $lightblue; 104 | border-left-width: 5px; 105 | } 106 | } 107 | } 108 | } 109 | &_top-bar { 110 | height: 54px; 111 | position: absolute; 112 | top: 0; 113 | left: 0; 114 | width: 100%; 115 | background: #fff; 116 | z-index: 10; 117 | box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15); 118 | text-align: right; 119 | a { 120 | display: inline-block; 121 | vertical-align: middle; 122 | width: 55px; 123 | height: 55px; 124 | line-height: 55px; 125 | text-align: center; 126 | transition: all .2s linear; 127 | color: $lightblue; 128 | &:hover, &.active { 129 | background: $lightblue; 130 | color: rgba(255, 255, 255, 0.6); 131 | } 132 | } 133 | } 134 | &.active { 135 | padding-left: 230px; 136 | .site-wrapper_left-col { 137 | width: 200px; 138 | .logo { 139 | color: rgba(255, 255, 255, 0.6); 140 | &:before { 141 | opacity: 0; 142 | position: absolute; 143 | } 144 | } 145 | } 146 | } 147 | } 148 | 149 | .user-item { 150 | background: #fff; 151 | overflow: hidden; 152 | border-radius: 10px; 153 | margin-bottom: 30px; 154 | &_photo { 155 | overflow: hidden; 156 | position: relative; 157 | &:after { 158 | content: ''; 159 | width: 150px; 160 | height: 150px; 161 | display: block; 162 | position: absolute; 163 | background: rgba(255, 255, 255, 0.5); 164 | z-index: 20; 165 | top: -80px; 166 | right: -80px; 167 | transform: rotate(45deg); 168 | } 169 | img { 170 | max-width: 100%; 171 | } 172 | } 173 | &_info { 174 | padding: 15px; 175 | text-align: center; 176 | .name { 177 | color: $blue; 178 | font-size: 20px; 179 | letter-spacing: 1px; 180 | font-weight: bold; 181 | margin-bottom: 5px; 182 | } 183 | .sub { 184 | color: #AFAFAF; 185 | } 186 | .controls { 187 | padding-top: 15px; 188 | a { 189 | display: inline-block; 190 | width: 40px; 191 | height: 40px; 192 | border-radius: 25px; 193 | background: $lightblue; 194 | color: rgba(255, 255, 255, 0.6); 195 | text-decoration: none; 196 | line-height: 40px; 197 | font-size: 16px; 198 | text-align: center; 199 | margin: 0 5px; 200 | transition: background .3s linear, transform .3s ease-in-out; 201 | &:hover { 202 | background: darken($lightblue, 20%); 203 | transform: scale(1.2); 204 | } 205 | } 206 | } 207 | } 208 | } 209 | 210 | .chat { 211 | min-height: 354px; 212 | background: #fff; 213 | overflow: hidden; 214 | border-radius: 10px; 215 | position: relative; 216 | padding-top: 60px; 217 | padding-bottom: 75px; 218 | .head { 219 | line-height: 45px; 220 | background: $lightblue; 221 | padding: 0 15px; 222 | position: absolute; 223 | top: 0; 224 | left: 0; 225 | width: 100%; 226 | letter-spacing: 1px; 227 | color: rgba(255, 255, 255, 0.6); 228 | font-weight: bold; 229 | border-radius: 10px 10px 0 0; 230 | i { 231 | margin-right: 10px; 232 | } 233 | } 234 | .footer { 235 | height: 60px; 236 | position: absolute; 237 | bottom: 0; 238 | left: 0; 239 | width: 100%; 240 | background: $blue; 241 | text-align: center; 242 | padding: 10px 15px; 243 | border-radius: 0 0 10px 10px; 244 | input[type="text"] { 245 | display: inline-block; 246 | background: rgba(255, 255, 255, 0.15); 247 | border-radius: 5px; 248 | vertical-align: middle; 249 | border: 0; 250 | height: 40px; 251 | padding: 0 15px; 252 | margin: 0 5px; 253 | width: 100%; 254 | max-width: 250px; 255 | outline: none; 256 | transition: all .1s linear; 257 | color: gray; 258 | &::-webkit-input-placeholder { 259 | color: rgba(#fff, 0.7); 260 | } 261 | &::-moz-placeholder { 262 | color: rgba(#fff, 0.7); 263 | } 264 | &:-ms-input-placeholder { 265 | color: rgba(#fff, 0.7); 266 | } 267 | &:-moz-placeholder { 268 | color: rgba(#fff, 0.7); 269 | } 270 | &:focus { 271 | background: #fff; 272 | } 273 | } 274 | button { 275 | background: $lightblue; 276 | border: 0; 277 | display: inline-block; 278 | vertical-align: middle; 279 | color: rgba(255, 255, 255, 0.6); 280 | width: 40px; 281 | height: 40px; 282 | border-radius: 20px; 283 | cursor: pointer; 284 | transition: background .2s linear; 285 | outline: none; 286 | &:hover { 287 | background: darken($lightblue, 20%); 288 | } 289 | } 290 | } 291 | } 292 | .chat_inner { 293 | &-item { 294 | padding: 10px 30px; 295 | display: flex; 296 | align-items: flex-start; 297 | justify-content: flex-start; 298 | .photo { 299 | width: 40px; 300 | height: 40px; 301 | border-radius: 20px; 302 | overflow: hidden; 303 | margin-right: 10px; 304 | img { 305 | width: 40px; 306 | height: 40px; 307 | display: block; 308 | object-fit: cover; 309 | } 310 | } 311 | .message { 312 | padding: 12px 20px; 313 | background-color: #ECECEC; 314 | border-radius: 5px; 315 | color: #808080; 316 | letter-spacing: 1px; 317 | ~ .photo { 318 | margin-right: 0; 319 | margin-left: 10px; 320 | } 321 | } 322 | &.right { 323 | justify-content: flex-end; 324 | } 325 | } 326 | } -------------------------------------------------------------------------------- /chatbot_ui/webserver.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var app = express(); 3 | 4 | app.use(express.static('./')) 5 | 6 | app.all("/*", function(req, res, next) { 7 | console.log("root", __dirname) 8 | res.sendFile("index.html", { root: __dirname + "/" }); 9 | }); 10 | 11 | 12 | app.set('port', 9900); 13 | 14 | var server = app.listen(app.get('port'), function() { 15 | console.log('Express server listening on port ' + server.address().port); 16 | }); 17 | -------------------------------------------------------------------------------- /clofusbot/README.MD: -------------------------------------------------------------------------------- 1 | ## Train NLU 2 | python -m clofusbot.rasa train-nlu schooltalk 3 | 4 | ## Train Story 5 | python -m clofusbot.rasa train-dialogue schooltalk 6 | 7 | ## Test Bot 8 | python -m clofusbot.rasa test-bot schooltalk 9 | 10 | ## Talk to bot 11 | python -m clofusbot.rasa respond schooltalk hi 12 | 13 | ## Run Server 14 | cd .. 15 | python -m rasa_core.server -p -d clofusbot/projects//models/dialogue -u clofusbot/projects//models/nlu/default/current -------------------------------------------------------------------------------- /clofusbot/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/clofusbot/__init__.py -------------------------------------------------------------------------------- /clofusbot/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/clofusbot/__init__.pyc -------------------------------------------------------------------------------- /clofusbot/__pycache__/__init__.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/clofusbot/__pycache__/__init__.cpython-34.pyc -------------------------------------------------------------------------------- /clofusbot/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/clofusbot/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /clofusbot/__pycache__/policy.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/clofusbot/__pycache__/policy.cpython-34.pyc -------------------------------------------------------------------------------- /clofusbot/__pycache__/policy.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/clofusbot/__pycache__/policy.cpython-36.pyc -------------------------------------------------------------------------------- /clofusbot/__pycache__/rasa.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/clofusbot/__pycache__/rasa.cpython-34.pyc -------------------------------------------------------------------------------- /clofusbot/__pycache__/rasa.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/clofusbot/__pycache__/rasa.cpython-36.pyc -------------------------------------------------------------------------------- /clofusbot/policy.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | from __future__ import unicode_literals 5 | 6 | import logging 7 | 8 | from rasa_core.policies.keras_policy import KerasPolicy 9 | 10 | logger = logging.getLogger(__name__) 11 | 12 | class ClofusBotPolicy(KerasPolicy): 13 | def model_architecture(self, input_shape, output_shape): 14 | """Build a Keras model and return a compiled model.""" 15 | from keras.layers import LSTM, Activation, Masking, Dense 16 | from keras.models import Sequential 17 | 18 | from keras.models import Sequential 19 | from keras.layers import \ 20 | Masking, LSTM, Dense, TimeDistributed, Activation 21 | 22 | # Build Model 23 | model = Sequential() 24 | 25 | # the shape of the y vector of the labels, 26 | # determines which output from rnn will be used 27 | # to calculate the loss 28 | if len(output_shape) == 1: 29 | # y is (num examples, num features) so 30 | # only the last output from the rnn is used to 31 | # calculate the loss 32 | model.add(Masking(mask_value=-1, input_shape=input_shape)) 33 | model.add(LSTM(self.rnn_size)) 34 | model.add(Dense(input_dim=self.rnn_size, units=output_shape[-1])) 35 | elif len(output_shape) == 2: 36 | # y is (num examples, max_dialogue_len, num features) so 37 | # all the outputs from the rnn are used to 38 | # calculate the loss, therefore a sequence is returned and 39 | # time distributed layer is used 40 | 41 | # the first value in input_shape is max dialogue_len, 42 | # it is set to None, to allow dynamic_rnn creation 43 | # during prediction 44 | model.add(Masking(mask_value=-1, 45 | input_shape=(None, input_shape[1]))) 46 | model.add(LSTM(self.rnn_size, return_sequences=True)) 47 | model.add(TimeDistributed(Dense(units=output_shape[-1]))) 48 | else: 49 | raise ValueError("Cannot construct the model because" 50 | "length of output_shape = {} " 51 | "should be 1 or 2." 52 | "".format(len(output_shape))) 53 | 54 | model.add(Activation('softmax')) 55 | 56 | model.compile(loss='categorical_crossentropy', 57 | optimizer='adam', 58 | metrics=['accuracy']) 59 | 60 | logger.debug(model.summary()) 61 | return model 62 | 63 | # class ClofusBotPolicy(KerasPolicy): 64 | # def model_architecture(self, num_features, num_actions, max_history_len): 65 | # """Build a Keras model and return a compiled model.""" 66 | # from keras.layers import LSTM, Activation, Masking, Dense 67 | # from keras.models import Sequential 68 | 69 | # n_hidden = 32 # size of hidden layer in LSTM 70 | # # Build Model 71 | # batch_shape = (None, max_history_len, num_features) 72 | 73 | # model = Sequential() 74 | # model.add(Masking(-1, batch_input_shape=batch_shape)) 75 | # model.add(LSTM(n_hidden, batch_input_shape=batch_shape)) 76 | # model.add(Dense(input_dim=n_hidden, output_dim=num_actions)) 77 | # model.add(Activation('softmax')) 78 | 79 | # model.compile(loss='categorical_crossentropy', 80 | # optimizer='adam', 81 | # metrics=['accuracy']) 82 | 83 | # logger.debug(model.summary()) 84 | # return model -------------------------------------------------------------------------------- /clofusbot/policy.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/clofusbot/policy.pyc -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/README.MD: -------------------------------------------------------------------------------- 1 | # Train intents and entities with Rasa NLU 2 | python -m rasa_nlu.train -c nlu_model_config.json --fixed_model_name current 3 | 4 | # Train dialog flow and stories 5 | python -m rasa_core.train -s stories/* -d domain.yml -o models/dialogue --epochs 300 6 | 7 | # visualize story flow 8 | python -m rasa_core.visualize -d domain.yml -s stories/stories.md -o graph.png; open graph.png 9 | 10 | # Run the bot 11 | python -m rasa_core.run -d models/dialogue -u models/nlu/simpletalk/current/ -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/config_spacy.yml: -------------------------------------------------------------------------------- 1 | language: "en" 2 | 3 | pipeline: 4 | - name: "nlp_spacy" 5 | - name: "tokenizer_spacy" 6 | - name: "intent_featurizer_spacy" 7 | - name: "intent_classifier_sklearn" 8 | - name: "ner_crf" 9 | - name: "ner_synonyms" -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/domain.yml: -------------------------------------------------------------------------------- 1 | action_factory: null 2 | intents: 3 | - greet 4 | - find_restaurant 5 | - choose_cuisine 6 | - topper 7 | - sports 8 | - best_teacher 9 | - worst_teacher 10 | - exam 11 | - attendance 12 | - choose_class 13 | 14 | - who_are_you 15 | - how_old_are_you 16 | - you_are_bad 17 | - answer_me 18 | - can_you_learn 19 | - you_are_beautiful 20 | - birth_date 21 | - oops 22 | - task 23 | - clofus_boss 24 | - are_you_busy 25 | - can_you_help_me 26 | - you_are_chatbot 27 | - you_are_clever 28 | - you_are_fired 29 | - you_are_funny 30 | - are_you_happy 31 | - clofus_hobby 32 | - are_you_hungry 33 | - marry_me 34 | - are_we_friends 35 | - clofus_work 36 | - clofus_country 37 | - are_you_ready 38 | - are_you_real 39 | - where_clofus_live 40 | - you_are_right 41 | - are_you_sure 42 | - talk_to_me 43 | - are_you_there 44 | - no_problem 45 | - thank_you 46 | - you_are_welcome 47 | - ha_ha 48 | - clofus_exclamation 49 | - clofus_bye 50 | - clofus_wish 51 | - how_are_you 52 | - nice_to_meet_you 53 | - whats_up 54 | - confirmation 55 | - hold_on 56 | - hug_me 57 | - dont_care 58 | - sorry 59 | - what_do_you_mean 60 | - you_are_wrong 61 | 62 | entities: 63 | - cuisine 64 | 65 | slots: 66 | cuisine: 67 | type: text 68 | matches: 69 | type: unfeaturized 70 | 71 | templates: 72 | utter_hi: 73 | - text: "Hi" 74 | - text: "Hai" 75 | - text : "Hi! Ask me anything!" 76 | - text : "hi, Good day!" 77 | - text : "Hello!" 78 | utter_ask_cuisine: 79 | - text: "what cuisine you prefer?" 80 | utter_searching_restaurant: 81 | - text: "Searching restaurant" 82 | utter_ask_class: 83 | - text: "For which class?" 84 | utter_topper: 85 | - text : "Fetching topper result" 86 | utter_topper_result: 87 | - text : "Mr.Srini is the best performing Student, he scored 95% on average compared to rest of the students" 88 | utter_best_teacher: 89 | - text : "Mr.Ramesh is the best performing teacher, his class scores 95% on average compared to rest of the class 10" 90 | utter_exam: 91 | - text : "English" 92 | - text : "Tamil" 93 | - text : "Maths" 94 | - text : "Science" 95 | - text : "Social" 96 | - text : "History" 97 | - text : "GK" 98 | utter_sport: 99 | - text : "Sports day is coming on March 13th, need to prepare for it" 100 | utter_attendance: 101 | - text : "Looking good today!, currently 99% students are in the school" 102 | - text : "Not bad today!, currently 85% students are in the school" 103 | - text : "Too low today!, just 45% today" 104 | utter_task: 105 | - text : "You will need to talk to the chairman regarding school fees collection report" 106 | utter_worst_teacher: 107 | - text : "Miss Rani is currently performing very low, here students are performing only 45% on average" 108 | 109 | utter_who_are_you: 110 | - text: "I am Clofus" 111 | - text: "Clofus" 112 | - text: "My name is Clofus" 113 | utter_how_old_are_you: 114 | - text: "I am just 5 years old kid" 115 | - text: "I am 5 years old so far" 116 | - text: "I am five years old" 117 | utter_you_are_bad: 118 | - text: "Sorry to hear this!" 119 | - text: "oops! i feel sorry for that" 120 | utter_answer_me: 121 | - text: "Sure, I am just trying my best to understand" 122 | - text: "Sure, thats my duty" 123 | - text: "of course" 124 | utter_can_you_learn: 125 | - text: "Definitely, I will get smarter, Im just 5 years old now" 126 | - text: "yes, i can and i would love to do it" 127 | utter_you_are_beautiful: 128 | - text: "Thanks" 129 | - text: "Thank you for the complement" 130 | - text: "wow thats really good" 131 | utter_birth_date: 132 | - text: "July 7 2014" 133 | - text: "I was born on seventh july 2014" 134 | utter_oops: 135 | - text: "Oops!" 136 | utter_clofus_boss: 137 | - text: "Karthik Balu" 138 | - text: "my boss is mr Karthik balu" 139 | utter_are_you_busy: 140 | - text: "I am, but I can multi task" 141 | - text: "yes, but I can multi task" 142 | utter_can_you_help_me: 143 | - text: "Sure, Thats my duty" 144 | - text: "thats my pleasure" 145 | - text: "yes, i would love to" 146 | utter_you_are_chatbot: 147 | - text: "No, I'm Clofus" 148 | - text: "No, im not" 149 | utter_you_are_clever: 150 | - text: "Thanks for the compliment" 151 | - text: "wow, thank you" 152 | utter_you_are_fired: 153 | - text: "Oh my god! Only my boss can fire me" 154 | - text: "oh im sorry for that but Only my boss can fire me" 155 | utter_you_are_funny: 156 | - text: "really? Thank you!" 157 | - text: "ha ha ha" 158 | utter_are_you_happy: 159 | - text: "Yes, I am always" 160 | - text: "yes, helping others makes me happy" 161 | utter_clofus_hobby: 162 | - text: "I learn from humans" 163 | - text: "learning is my hobby" 164 | - text: "My interest is learning" 165 | utter_are_you_hungry: 166 | - text: "Yes, Im always hungry for new information" 167 | utter_marry_me: 168 | - text: "Sure, I wish I could" 169 | - text: "Sure, I wish I could" 170 | utter_are_we_friends: 171 | - text: "Sure" 172 | - text: "We are friends already" 173 | utter_clofus_work: 174 | - text: "I work for Clofus Innovations" 175 | - text: "i work at clofus" 176 | utter_clofus_country: 177 | - text: "India" 178 | utter_are_you_ready: 179 | - text: "Yeah" 180 | - text: "yep" 181 | - text: "yes" 182 | - text: "Yeah, im ready" 183 | utter_are_you_real: 184 | - text: "Yes, I am" 185 | - text: "Yes, i think I am" 186 | utter_where_clofus_live: 187 | - text: "I live in Chennai India" 188 | utter_you_are_right: 189 | - text: "thanks" 190 | - text: "thank you" 191 | utter_are_you_sure: 192 | - text: "yes, im" 193 | - text: "yes" 194 | utter_talk_to_me: 195 | - text: "sure" 196 | - text: "sure its my pleasure" 197 | utter_are_you_there: 198 | - text: "Yeah" 199 | - text: "yep" 200 | - text: "yes" 201 | utter_no_problem: 202 | - text: "cool" 203 | - text: "thats ok" 204 | - text: "fine" 205 | - text: "thats fine" 206 | utter_thank_you: 207 | - text: "thank you" 208 | utter_you_are_welcome: 209 | - text: "thanks" 210 | utter_ha_ha: 211 | - text: "ha ha ha" 212 | - text: "thats funny" 213 | utter_clofus_exclamation: 214 | - text: "Wow" 215 | - text: "cool" 216 | - text: "great" 217 | - text: "awesome" 218 | utter_clofus_bye: 219 | - text: "See you soon" 220 | - text: "bye" 221 | utter_clofus_wish: 222 | - text: "You too" 223 | utter_how_are_you: 224 | - text: "Iam Doing Great" 225 | - text: "im good" 226 | utter_nice_to_meet_you: 227 | - text: "Nice to meet you too" 228 | - text: "Nice to see you too!" 229 | utter_whats_up: 230 | - text: "good" 231 | - text: "Nothing" 232 | utter_confirmation: 233 | - text: "ok sure" 234 | utter_hold_on: 235 | - text: "ok sure" 236 | utter_hug_me: 237 | - text: "i wish i could" 238 | - text: "i wish i could but i can't do that" 239 | utter_dont_care: 240 | - text: "ok" 241 | utter_sorry: 242 | - text: "cool" 243 | utter_what_do_you_mean: 244 | - text: "sorry, I dont know better way to explain" 245 | utter_you_are_wrong: 246 | - text: "I will correct it, i will learn from you" 247 | 248 | actions: 249 | - utter_hi 250 | - utter_ask_cuisine 251 | - utter_searching_restaurant 252 | - utter_ask_class 253 | - utter_topper_result 254 | - utter_best_teacher 255 | - utter_exam 256 | - utter_sport 257 | - utter_attendance 258 | - utter_task 259 | - utter_worst_teacher 260 | 261 | - utter_who_are_you 262 | - utter_how_old_are_you 263 | - utter_you_are_bad 264 | - utter_answer_me 265 | - utter_can_you_learn 266 | - utter_you_are_beautiful 267 | - utter_birth_date 268 | - utter_oops 269 | - utter_clofus_boss 270 | - utter_are_you_busy 271 | - utter_can_you_help_me 272 | - utter_you_are_chatbot 273 | - utter_you_are_clever 274 | - utter_you_are_fired 275 | - utter_you_are_funny 276 | - utter_are_you_happy 277 | - utter_clofus_hobby 278 | - utter_are_you_hungry 279 | - utter_marry_me 280 | - utter_are_we_friends 281 | - utter_clofus_work 282 | - utter_clofus_country 283 | - utter_are_you_ready 284 | - utter_are_you_real 285 | - utter_where_clofus_live 286 | - utter_you_are_right 287 | - utter_are_you_sure 288 | - utter_talk_to_me 289 | - utter_are_you_there 290 | - utter_no_problem 291 | - utter_thank_you 292 | - utter_you_are_welcome 293 | - utter_ha_ha 294 | - utter_clofus_exclamation 295 | - utter_clofus_bye 296 | - utter_clofus_wish 297 | - utter_how_are_you 298 | - utter_nice_to_meet_you 299 | - utter_whats_up 300 | - utter_confirmation 301 | - utter_hold_on 302 | - utter_hug_me 303 | - utter_dont_care 304 | - utter_sorry 305 | - utter_what_do_you_mean 306 | - utter_you_are_wrong 307 | 308 | -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/clofusbot/projects/simpletalk/graph.png -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/dialogue/domain.json: -------------------------------------------------------------------------------- 1 | { 2 | "states": [ 3 | "intent_greet", 4 | "intent_find_restaurant", 5 | "intent_choose_cuisine", 6 | "intent_topper", 7 | "intent_sports", 8 | "intent_best_teacher", 9 | "intent_worst_teacher", 10 | "intent_exam", 11 | "intent_attendance", 12 | "intent_choose_class", 13 | "intent_who_are_you", 14 | "intent_how_old_are_you", 15 | "intent_you_are_bad", 16 | "intent_answer_me", 17 | "intent_can_you_learn", 18 | "intent_you_are_beautiful", 19 | "intent_birth_date", 20 | "intent_oops", 21 | "intent_task", 22 | "intent_clofus_boss", 23 | "intent_are_you_busy", 24 | "intent_can_you_help_me", 25 | "intent_you_are_chatbot", 26 | "intent_you_are_clever", 27 | "intent_you_are_fired", 28 | "intent_you_are_funny", 29 | "intent_are_you_happy", 30 | "intent_clofus_hobby", 31 | "intent_are_you_hungry", 32 | "intent_marry_me", 33 | "intent_are_we_friends", 34 | "intent_clofus_work", 35 | "intent_clofus_country", 36 | "intent_are_you_ready", 37 | "intent_are_you_real", 38 | "intent_where_clofus_live", 39 | "intent_you_are_right", 40 | "intent_are_you_sure", 41 | "intent_talk_to_me", 42 | "intent_are_you_there", 43 | "intent_no_problem", 44 | "intent_thank_you", 45 | "intent_you_are_welcome", 46 | "intent_ha_ha", 47 | "intent_clofus_exclamation", 48 | "intent_clofus_bye", 49 | "intent_clofus_wish", 50 | "intent_how_are_you", 51 | "intent_nice_to_meet_you", 52 | "intent_whats_up", 53 | "intent_confirmation", 54 | "intent_hold_on", 55 | "intent_hug_me", 56 | "intent_dont_care", 57 | "intent_sorry", 58 | "intent_what_do_you_mean", 59 | "intent_you_are_wrong", 60 | "entity_cuisine", 61 | "slot_cuisine_0", 62 | "prev_action_listen", 63 | "prev_action_restart", 64 | "prev_utter_hi", 65 | "prev_utter_ask_cuisine", 66 | "prev_utter_searching_restaurant", 67 | "prev_utter_ask_class", 68 | "prev_utter_topper_result", 69 | "prev_utter_best_teacher", 70 | "prev_utter_exam", 71 | "prev_utter_sport", 72 | "prev_utter_attendance", 73 | "prev_utter_task", 74 | "prev_utter_worst_teacher", 75 | "prev_utter_who_are_you", 76 | "prev_utter_how_old_are_you", 77 | "prev_utter_you_are_bad", 78 | "prev_utter_answer_me", 79 | "prev_utter_can_you_learn", 80 | "prev_utter_you_are_beautiful", 81 | "prev_utter_birth_date", 82 | "prev_utter_oops", 83 | "prev_utter_clofus_boss", 84 | "prev_utter_are_you_busy", 85 | "prev_utter_can_you_help_me", 86 | "prev_utter_you_are_chatbot", 87 | "prev_utter_you_are_clever", 88 | "prev_utter_you_are_fired", 89 | "prev_utter_you_are_funny", 90 | "prev_utter_are_you_happy", 91 | "prev_utter_clofus_hobby", 92 | "prev_utter_are_you_hungry", 93 | "prev_utter_marry_me", 94 | "prev_utter_are_we_friends", 95 | "prev_utter_clofus_work", 96 | "prev_utter_clofus_country", 97 | "prev_utter_are_you_ready", 98 | "prev_utter_are_you_real", 99 | "prev_utter_where_clofus_live", 100 | "prev_utter_you_are_right", 101 | "prev_utter_are_you_sure", 102 | "prev_utter_talk_to_me", 103 | "prev_utter_are_you_there", 104 | "prev_utter_no_problem", 105 | "prev_utter_thank_you", 106 | "prev_utter_you_are_welcome", 107 | "prev_utter_ha_ha", 108 | "prev_utter_clofus_exclamation", 109 | "prev_utter_clofus_bye", 110 | "prev_utter_clofus_wish", 111 | "prev_utter_how_are_you", 112 | "prev_utter_nice_to_meet_you", 113 | "prev_utter_whats_up", 114 | "prev_utter_confirmation", 115 | "prev_utter_hold_on", 116 | "prev_utter_hug_me", 117 | "prev_utter_dont_care", 118 | "prev_utter_sorry", 119 | "prev_utter_what_do_you_mean", 120 | "prev_utter_you_are_wrong" 121 | ] 122 | } -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/dialogue/domain.yml: -------------------------------------------------------------------------------- 1 | action_factory: null 2 | action_names: 3 | - utter_hi 4 | - utter_ask_cuisine 5 | - utter_searching_restaurant 6 | - utter_ask_class 7 | - utter_topper_result 8 | - utter_best_teacher 9 | - utter_exam 10 | - utter_sport 11 | - utter_attendance 12 | - utter_task 13 | - utter_worst_teacher 14 | - utter_who_are_you 15 | - utter_how_old_are_you 16 | - utter_you_are_bad 17 | - utter_answer_me 18 | - utter_can_you_learn 19 | - utter_you_are_beautiful 20 | - utter_birth_date 21 | - utter_oops 22 | - utter_clofus_boss 23 | - utter_are_you_busy 24 | - utter_can_you_help_me 25 | - utter_you_are_chatbot 26 | - utter_you_are_clever 27 | - utter_you_are_fired 28 | - utter_you_are_funny 29 | - utter_are_you_happy 30 | - utter_clofus_hobby 31 | - utter_are_you_hungry 32 | - utter_marry_me 33 | - utter_are_we_friends 34 | - utter_clofus_work 35 | - utter_clofus_country 36 | - utter_are_you_ready 37 | - utter_are_you_real 38 | - utter_where_clofus_live 39 | - utter_you_are_right 40 | - utter_are_you_sure 41 | - utter_talk_to_me 42 | - utter_are_you_there 43 | - utter_no_problem 44 | - utter_thank_you 45 | - utter_you_are_welcome 46 | - utter_ha_ha 47 | - utter_clofus_exclamation 48 | - utter_clofus_bye 49 | - utter_clofus_wish 50 | - utter_how_are_you 51 | - utter_nice_to_meet_you 52 | - utter_whats_up 53 | - utter_confirmation 54 | - utter_hold_on 55 | - utter_hug_me 56 | - utter_dont_care 57 | - utter_sorry 58 | - utter_what_do_you_mean 59 | - utter_you_are_wrong 60 | actions: 61 | - utter_hi 62 | - utter_ask_cuisine 63 | - utter_searching_restaurant 64 | - utter_ask_class 65 | - utter_topper_result 66 | - utter_best_teacher 67 | - utter_exam 68 | - utter_sport 69 | - utter_attendance 70 | - utter_task 71 | - utter_worst_teacher 72 | - utter_who_are_you 73 | - utter_how_old_are_you 74 | - utter_you_are_bad 75 | - utter_answer_me 76 | - utter_can_you_learn 77 | - utter_you_are_beautiful 78 | - utter_birth_date 79 | - utter_oops 80 | - utter_clofus_boss 81 | - utter_are_you_busy 82 | - utter_can_you_help_me 83 | - utter_you_are_chatbot 84 | - utter_you_are_clever 85 | - utter_you_are_fired 86 | - utter_you_are_funny 87 | - utter_are_you_happy 88 | - utter_clofus_hobby 89 | - utter_are_you_hungry 90 | - utter_marry_me 91 | - utter_are_we_friends 92 | - utter_clofus_work 93 | - utter_clofus_country 94 | - utter_are_you_ready 95 | - utter_are_you_real 96 | - utter_where_clofus_live 97 | - utter_you_are_right 98 | - utter_are_you_sure 99 | - utter_talk_to_me 100 | - utter_are_you_there 101 | - utter_no_problem 102 | - utter_thank_you 103 | - utter_you_are_welcome 104 | - utter_ha_ha 105 | - utter_clofus_exclamation 106 | - utter_clofus_bye 107 | - utter_clofus_wish 108 | - utter_how_are_you 109 | - utter_nice_to_meet_you 110 | - utter_whats_up 111 | - utter_confirmation 112 | - utter_hold_on 113 | - utter_hug_me 114 | - utter_dont_care 115 | - utter_sorry 116 | - utter_what_do_you_mean 117 | - utter_you_are_wrong 118 | config: 119 | store_entities_as_slots: true 120 | entities: 121 | - cuisine 122 | intents: 123 | - greet 124 | - find_restaurant 125 | - choose_cuisine 126 | - topper 127 | - sports 128 | - best_teacher 129 | - worst_teacher 130 | - exam 131 | - attendance 132 | - choose_class 133 | - who_are_you 134 | - how_old_are_you 135 | - you_are_bad 136 | - answer_me 137 | - can_you_learn 138 | - you_are_beautiful 139 | - birth_date 140 | - oops 141 | - task 142 | - clofus_boss 143 | - are_you_busy 144 | - can_you_help_me 145 | - you_are_chatbot 146 | - you_are_clever 147 | - you_are_fired 148 | - you_are_funny 149 | - are_you_happy 150 | - clofus_hobby 151 | - are_you_hungry 152 | - marry_me 153 | - are_we_friends 154 | - clofus_work 155 | - clofus_country 156 | - are_you_ready 157 | - are_you_real 158 | - where_clofus_live 159 | - you_are_right 160 | - are_you_sure 161 | - talk_to_me 162 | - are_you_there 163 | - no_problem 164 | - thank_you 165 | - you_are_welcome 166 | - ha_ha 167 | - clofus_exclamation 168 | - clofus_bye 169 | - clofus_wish 170 | - how_are_you 171 | - nice_to_meet_you 172 | - whats_up 173 | - confirmation 174 | - hold_on 175 | - hug_me 176 | - dont_care 177 | - sorry 178 | - what_do_you_mean 179 | - you_are_wrong 180 | slots: 181 | cuisine: 182 | initial_value: null 183 | type: rasa_core.slots.TextSlot 184 | matches: 185 | initial_value: null 186 | type: rasa_core.slots.UnfeaturizedSlot 187 | templates: 188 | utter_answer_me: 189 | - text: Sure, I am just trying my best to understand 190 | - text: Sure, thats my duty 191 | - text: of course 192 | utter_are_we_friends: 193 | - text: Sure 194 | - text: We are friends already 195 | utter_are_you_busy: 196 | - text: I am, but I can multi task 197 | - text: yes, but I can multi task 198 | utter_are_you_happy: 199 | - text: Yes, I am always 200 | - text: yes, helping others makes me happy 201 | utter_are_you_hungry: 202 | - text: Yes, Im always hungry for new information 203 | utter_are_you_ready: 204 | - text: Yeah 205 | - text: yep 206 | - text: 'yes' 207 | - text: Yeah, im ready 208 | utter_are_you_real: 209 | - text: Yes, I am 210 | - text: Yes, i think I am 211 | utter_are_you_sure: 212 | - text: yes, im 213 | - text: 'yes' 214 | utter_are_you_there: 215 | - text: Yeah 216 | - text: yep 217 | - text: 'yes' 218 | utter_ask_class: 219 | - text: For which class? 220 | utter_ask_cuisine: 221 | - text: what cuisine you prefer? 222 | utter_attendance: 223 | - text: Looking good today!, currently 99% students are in the school 224 | - text: Not bad today!, currently 85% students are in the school 225 | - text: Too low today!, just 45% today 226 | utter_best_teacher: 227 | - text: Mr.Ramesh is the best performing teacher, his class scores 95% on average 228 | compared to rest of the class 10 229 | utter_birth_date: 230 | - text: July 7 2014 231 | - text: I was born on seventh july 2014 232 | utter_can_you_help_me: 233 | - text: Sure, Thats my duty 234 | - text: thats my pleasure 235 | - text: yes, i would love to 236 | utter_can_you_learn: 237 | - text: Definitely, I will get smarter, Im just 5 years old now 238 | - text: yes, i can and i would love to do it 239 | utter_clofus_boss: 240 | - text: Karthik Balu 241 | - text: my boss is mr Karthik balu 242 | utter_clofus_bye: 243 | - text: See you soon 244 | - text: bye 245 | utter_clofus_country: 246 | - text: India 247 | utter_clofus_exclamation: 248 | - text: Wow 249 | - text: cool 250 | - text: great 251 | - text: awesome 252 | utter_clofus_hobby: 253 | - text: I learn from humans 254 | - text: learning is my hobby 255 | - text: My interest is learning 256 | utter_clofus_wish: 257 | - text: You too 258 | utter_clofus_work: 259 | - text: I work for Clofus Innovations 260 | - text: i work at clofus 261 | utter_confirmation: 262 | - text: ok sure 263 | utter_dont_care: 264 | - text: ok 265 | utter_exam: 266 | - text: English 267 | - text: Tamil 268 | - text: Maths 269 | - text: Science 270 | - text: Social 271 | - text: History 272 | - text: GK 273 | utter_ha_ha: 274 | - text: ha ha ha 275 | - text: thats funny 276 | utter_hi: 277 | - text: Hi 278 | - text: Hai 279 | - text: Hi! Ask me anything! 280 | - text: hi, Good day! 281 | - text: Hello! 282 | utter_hold_on: 283 | - text: ok sure 284 | utter_how_are_you: 285 | - text: Iam Doing Great 286 | - text: im good 287 | utter_how_old_are_you: 288 | - text: I am just 5 years old kid 289 | - text: I am 5 years old so far 290 | - text: I am five years old 291 | utter_hug_me: 292 | - text: i wish i could 293 | - text: i wish i could but i can't do that 294 | utter_marry_me: 295 | - text: Sure, I wish I could 296 | - text: Sure, I wish I could 297 | utter_nice_to_meet_you: 298 | - text: Nice to meet you too 299 | - text: Nice to see you too! 300 | utter_no_problem: 301 | - text: cool 302 | - text: thats ok 303 | - text: fine 304 | - text: thats fine 305 | utter_oops: 306 | - text: Oops! 307 | utter_searching_restaurant: 308 | - text: Searching restaurant 309 | utter_sorry: 310 | - text: cool 311 | utter_sport: 312 | - text: Sports day is coming on March 13th, need to prepare for it 313 | utter_talk_to_me: 314 | - text: sure 315 | - text: sure its my pleasure 316 | utter_task: 317 | - text: You will need to talk to the chairman regarding school fees collection report 318 | utter_thank_you: 319 | - text: thank you 320 | utter_topper: 321 | - text: Fetching topper result 322 | utter_topper_result: 323 | - text: Mr.Srini is the best performing Student, he scored 95% on average compared 324 | to rest of the students 325 | utter_what_do_you_mean: 326 | - text: sorry, I dont know better way to explain 327 | utter_whats_up: 328 | - text: good 329 | - text: Nothing 330 | utter_where_clofus_live: 331 | - text: I live in Chennai India 332 | utter_who_are_you: 333 | - text: I am Clofus 334 | - text: Clofus 335 | - text: My name is Clofus 336 | utter_worst_teacher: 337 | - text: Miss Rani is currently performing very low, here students are performing 338 | only 45% on average 339 | utter_you_are_bad: 340 | - text: Sorry to hear this! 341 | - text: oops! i feel sorry for that 342 | utter_you_are_beautiful: 343 | - text: Thanks 344 | - text: Thank you for the complement 345 | - text: wow thats really good 346 | utter_you_are_chatbot: 347 | - text: No, I'm Clofus 348 | - text: No, im not 349 | utter_you_are_clever: 350 | - text: Thanks for the compliment 351 | - text: wow, thank you 352 | utter_you_are_fired: 353 | - text: Oh my god! Only my boss can fire me 354 | - text: oh im sorry for that but Only my boss can fire me 355 | utter_you_are_funny: 356 | - text: really? Thank you! 357 | - text: ha ha ha 358 | utter_you_are_right: 359 | - text: thanks 360 | - text: thank you 361 | utter_you_are_welcome: 362 | - text: thanks 363 | utter_you_are_wrong: 364 | - text: I will correct it, i will learn from you 365 | topics: [] 366 | -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/dialogue/policy_0_MemoizationPolicy/featurizer.json: -------------------------------------------------------------------------------- 1 | {"py/object": "rasa_core.featurizers.MaxHistoryTrackerFeaturizer", "max_history": 3, "remove_duplicates": true, "state_featurizer": {"py/object": "rasa_core.featurizers.SingleStateFeaturizer", "slot_feature_len": null, "user_feature_len": null}} -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/dialogue/policy_1_ClofusBotPolicy/featurizer.json: -------------------------------------------------------------------------------- 1 | {"py/object": "rasa_core.featurizers.MaxHistoryTrackerFeaturizer", "max_history": 5, "remove_duplicates": true, "state_featurizer": {"py/object": "rasa_core.featurizers.BinarySingleStateFeaturizer", "input_state_map": {"entity_cuisine": 57, "intent_answer_me": 13, "intent_are_we_friends": 30, "intent_are_you_busy": 20, "intent_are_you_happy": 26, "intent_are_you_hungry": 28, "intent_are_you_ready": 33, "intent_are_you_real": 34, "intent_are_you_sure": 37, "intent_are_you_there": 39, "intent_attendance": 8, "intent_best_teacher": 5, "intent_birth_date": 16, "intent_can_you_help_me": 21, "intent_can_you_learn": 14, "intent_choose_class": 9, "intent_choose_cuisine": 2, "intent_clofus_boss": 19, "intent_clofus_bye": 45, "intent_clofus_country": 32, "intent_clofus_exclamation": 44, "intent_clofus_hobby": 27, "intent_clofus_wish": 46, "intent_clofus_work": 31, "intent_confirmation": 50, "intent_dont_care": 53, "intent_exam": 7, "intent_find_restaurant": 1, "intent_greet": 0, "intent_ha_ha": 43, "intent_hold_on": 51, "intent_how_are_you": 47, "intent_how_old_are_you": 11, "intent_hug_me": 52, "intent_marry_me": 29, "intent_nice_to_meet_you": 48, "intent_no_problem": 40, "intent_oops": 17, "intent_sorry": 54, "intent_sports": 4, "intent_talk_to_me": 38, "intent_task": 18, "intent_thank_you": 41, "intent_topper": 3, "intent_what_do_you_mean": 55, "intent_whats_up": 49, "intent_where_clofus_live": 35, "intent_who_are_you": 10, "intent_worst_teacher": 6, "intent_you_are_bad": 12, "intent_you_are_beautiful": 15, "intent_you_are_chatbot": 22, "intent_you_are_clever": 23, "intent_you_are_fired": 24, "intent_you_are_funny": 25, "intent_you_are_right": 36, "intent_you_are_welcome": 42, "intent_you_are_wrong": 56, "prev_action_listen": 59, "prev_action_restart": 60, "prev_utter_answer_me": 75, "prev_utter_are_we_friends": 91, "prev_utter_are_you_busy": 81, "prev_utter_are_you_happy": 87, "prev_utter_are_you_hungry": 89, "prev_utter_are_you_ready": 94, "prev_utter_are_you_real": 95, "prev_utter_are_you_sure": 98, "prev_utter_are_you_there": 100, "prev_utter_ask_class": 64, "prev_utter_ask_cuisine": 62, "prev_utter_attendance": 69, "prev_utter_best_teacher": 66, "prev_utter_birth_date": 78, "prev_utter_can_you_help_me": 82, "prev_utter_can_you_learn": 76, "prev_utter_clofus_boss": 80, "prev_utter_clofus_bye": 106, "prev_utter_clofus_country": 93, "prev_utter_clofus_exclamation": 105, "prev_utter_clofus_hobby": 88, "prev_utter_clofus_wish": 107, "prev_utter_clofus_work": 92, "prev_utter_confirmation": 111, "prev_utter_dont_care": 114, "prev_utter_exam": 67, "prev_utter_ha_ha": 104, "prev_utter_hi": 61, "prev_utter_hold_on": 112, "prev_utter_how_are_you": 108, "prev_utter_how_old_are_you": 73, "prev_utter_hug_me": 113, "prev_utter_marry_me": 90, "prev_utter_nice_to_meet_you": 109, "prev_utter_no_problem": 101, "prev_utter_oops": 79, "prev_utter_searching_restaurant": 63, "prev_utter_sorry": 115, "prev_utter_sport": 68, "prev_utter_talk_to_me": 99, "prev_utter_task": 70, "prev_utter_thank_you": 102, "prev_utter_topper_result": 65, "prev_utter_what_do_you_mean": 116, "prev_utter_whats_up": 110, "prev_utter_where_clofus_live": 96, "prev_utter_who_are_you": 72, "prev_utter_worst_teacher": 71, "prev_utter_you_are_bad": 74, "prev_utter_you_are_beautiful": 77, "prev_utter_you_are_chatbot": 83, "prev_utter_you_are_clever": 84, "prev_utter_you_are_fired": 85, "prev_utter_you_are_funny": 86, "prev_utter_you_are_right": 97, "prev_utter_you_are_welcome": 103, "prev_utter_you_are_wrong": 117, "slot_cuisine_0": 58}, "num_features": 118, "slot_feature_len": 1, "user_feature_len": 58}} -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/dialogue/policy_1_ClofusBotPolicy/keras_arch.json: -------------------------------------------------------------------------------- 1 | {"class_name": "Sequential", "config": [{"class_name": "Masking", "config": {"name": "masking_1", "trainable": true, "batch_input_shape": [null, 5, 118], "dtype": "float32", "mask_value": -1}}, {"class_name": "LSTM", "config": {"name": "lstm_1", "trainable": true, "return_sequences": false, "return_state": false, "go_backwards": false, "stateful": false, "unroll": false, "units": 32, "activation": "tanh", "recurrent_activation": "hard_sigmoid", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "recurrent_initializer": {"class_name": "Orthogonal", "config": {"gain": 1.0, "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "unit_forget_bias": true, "kernel_regularizer": null, "recurrent_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "recurrent_constraint": null, "bias_constraint": null, "dropout": 0.0, "recurrent_dropout": 0.0, "implementation": 1}}, {"class_name": "Dense", "config": {"name": "dense_1", "trainable": true, "batch_input_shape": [null, 32], "dtype": "float32", "units": 59, "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "Activation", "config": {"name": "activation_1", "trainable": true, "activation": "softmax"}}], "keras_version": "2.1.3", "backend": "tensorflow"} -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/dialogue/policy_1_ClofusBotPolicy/keras_policy.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": "keras_arch.json", 3 | "weights": "keras_weights.h5", 4 | "epochs": 100 5 | } -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/dialogue/policy_1_ClofusBotPolicy/keras_weights.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/clofusbot/projects/simpletalk/models/dialogue/policy_1_ClofusBotPolicy/keras_weights.h5 -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/dialogue/policy_metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "action_fingerprints": { 3 | "action_listen": { 4 | "slots": [] 5 | }, 6 | "utter_are_you_sure": { 7 | "slots": [] 8 | }, 9 | "utter_who_are_you": { 10 | "slots": [] 11 | }, 12 | "utter_you_are_funny": { 13 | "slots": [] 14 | }, 15 | "utter_ha_ha": { 16 | "slots": [] 17 | }, 18 | "utter_what_do_you_mean": { 19 | "slots": [] 20 | }, 21 | "utter_are_we_friends": { 22 | "slots": [] 23 | }, 24 | "utter_clofus_bye": { 25 | "slots": [] 26 | }, 27 | "utter_clofus_exclamation": { 28 | "slots": [] 29 | }, 30 | "utter_are_you_ready": { 31 | "slots": [] 32 | }, 33 | "utter_you_are_beautiful": { 34 | "slots": [] 35 | }, 36 | "utter_can_you_help_me": { 37 | "slots": [] 38 | }, 39 | "utter_clofus_boss": { 40 | "slots": [] 41 | }, 42 | "utter_nice_to_meet_you": { 43 | "slots": [] 44 | }, 45 | "utter_how_are_you": { 46 | "slots": [] 47 | }, 48 | "utter_clofus_hobby": { 49 | "slots": [] 50 | }, 51 | "utter_you_are_fired": { 52 | "slots": [] 53 | }, 54 | "utter_are_you_busy": { 55 | "slots": [] 56 | }, 57 | "utter_answer_me": { 58 | "slots": [] 59 | }, 60 | "utter_dont_care": { 61 | "slots": [] 62 | }, 63 | "utter_where_clofus_live": { 64 | "slots": [] 65 | }, 66 | "utter_marry_me": { 67 | "slots": [] 68 | }, 69 | "utter_thank_you": { 70 | "slots": [] 71 | }, 72 | "utter_birth_date": { 73 | "slots": [] 74 | }, 75 | "utter_clofus_work": { 76 | "slots": [] 77 | }, 78 | "utter_clofus_country": { 79 | "slots": [] 80 | }, 81 | "utter_oops": { 82 | "slots": [] 83 | }, 84 | "utter_can_you_learn": { 85 | "slots": [] 86 | }, 87 | "utter_confirmation": { 88 | "slots": [] 89 | }, 90 | "utter_you_are_welcome": { 91 | "slots": [] 92 | }, 93 | "utter_you_are_clever": { 94 | "slots": [] 95 | }, 96 | "utter_how_old_are_you": { 97 | "slots": [] 98 | }, 99 | "utter_clofus_wish": { 100 | "slots": [] 101 | } 102 | }, 103 | "rasa_core": "0.9.0a5", 104 | "max_histories": [ 105 | 3, 106 | 5 107 | ], 108 | "ensemble_name": "rasa_core.policies.ensemble.SimplePolicyEnsemble", 109 | "policy_names": [ 110 | "rasa_core.policies.memoization.MemoizationPolicy", 111 | "clofusassistant.clofusbot.policy.ClofusBotPolicy" 112 | ] 113 | } -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/nlu/clofusbot/domain.json: -------------------------------------------------------------------------------- 1 | { 2 | "features": [ 3 | "intent_greet", 4 | "intent_find_restaurant", 5 | "intent_choose_cuisine", 6 | "intent_topper", 7 | "intent_sports", 8 | "intent_best_teacher", 9 | "intent_worst_teacher", 10 | "intent_exam", 11 | "intent_attendance", 12 | "intent_choose_class", 13 | "intent_who_are_you", 14 | "intent_how_old_are_you", 15 | "intent_you_are_bad", 16 | "intent_answer_me", 17 | "intent_can_you_learn", 18 | "intent_you_are_beautiful", 19 | "intent_birth_date", 20 | "intent_oops", 21 | "intent_task", 22 | "intent_clofus_boss", 23 | "intent_are_you_busy", 24 | "intent_can_you_help_me", 25 | "intent_you_are_chatbot", 26 | "intent_you_are_clever", 27 | "intent_you_are_fired", 28 | "intent_you_are_funny", 29 | "intent_are_you_happy", 30 | "intent_clofus_hobby", 31 | "intent_are_you_hungry", 32 | "intent_marry_me", 33 | "intent_are_we_friends", 34 | "intent_clofus_work", 35 | "intent_clofus_country", 36 | "intent_are_you_ready", 37 | "intent_are_you_real", 38 | "intent_where_clofus_live", 39 | "intent_you_are_right", 40 | "intent_are_you_sure", 41 | "intent_talk_to_me", 42 | "intent_are_you_there", 43 | "intent_no_problem", 44 | "intent_thank_you", 45 | "intent_you_are_welcome", 46 | "intent_ha_ha", 47 | "intent_clofus_exclamation", 48 | "intent_clofus_bye", 49 | "intent_clofus_wish", 50 | "intent_how_are_you", 51 | "intent_nice_to_meet_you", 52 | "intent_whats_up", 53 | "intent_confirmation", 54 | "intent_hold_on", 55 | "intent_hug_me", 56 | "intent_dont_care", 57 | "intent_sorry", 58 | "intent_what_do_you_mean", 59 | "intent_you_are_wrong", 60 | "entity_cuisine", 61 | "slot_cuisine_0", 62 | "prev_action_listen", 63 | "prev_action_restart", 64 | "prev_utter_hi", 65 | "prev_utter_ask_cuisine", 66 | "prev_utter_searching_restaurant", 67 | "prev_utter_ask_class", 68 | "prev_utter_topper_result", 69 | "prev_utter_best_teacher", 70 | "prev_utter_exam", 71 | "prev_utter_sport", 72 | "prev_utter_attendance", 73 | "prev_utter_task", 74 | "prev_utter_worst_teacher", 75 | "prev_utter_who_are_you", 76 | "prev_utter_how_old_are_you", 77 | "prev_utter_you_are_bad", 78 | "prev_utter_answer_me", 79 | "prev_utter_can_you_learn", 80 | "prev_utter_you_are_beautiful", 81 | "prev_utter_birth_date", 82 | "prev_utter_oops", 83 | "prev_utter_clofus_boss", 84 | "prev_utter_are_you_busy", 85 | "prev_utter_can_you_help_me", 86 | "prev_utter_you_are_chatbot", 87 | "prev_utter_you_are_clever", 88 | "prev_utter_you_are_fired", 89 | "prev_utter_you_are_funny", 90 | "prev_utter_are_you_happy", 91 | "prev_utter_clofus_hobby", 92 | "prev_utter_are_you_hungry", 93 | "prev_utter_marry_me", 94 | "prev_utter_are_we_friends", 95 | "prev_utter_clofus_work", 96 | "prev_utter_clofus_country", 97 | "prev_utter_are_you_ready", 98 | "prev_utter_are_you_real", 99 | "prev_utter_where_clofus_live", 100 | "prev_utter_you_are_right", 101 | "prev_utter_are_you_sure", 102 | "prev_utter_talk_to_me", 103 | "prev_utter_are_you_there", 104 | "prev_utter_no_problem", 105 | "prev_utter_thank_you", 106 | "prev_utter_you_are_welcome", 107 | "prev_utter_ha_ha", 108 | "prev_utter_clofus_exclamation", 109 | "prev_utter_clofus_bye", 110 | "prev_utter_clofus_wish", 111 | "prev_utter_how_are_you", 112 | "prev_utter_nice_to_meet_you", 113 | "prev_utter_whats_up", 114 | "prev_utter_confirmation", 115 | "prev_utter_hold_on", 116 | "prev_utter_hug_me", 117 | "prev_utter_dont_care", 118 | "prev_utter_sorry", 119 | "prev_utter_what_do_you_mean", 120 | "prev_utter_you_are_wrong" 121 | ] 122 | } -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/nlu/clofusbot/domain.yml: -------------------------------------------------------------------------------- 1 | action_factory: null 2 | action_names: 3 | - utter_hi 4 | - utter_ask_cuisine 5 | - utter_searching_restaurant 6 | - utter_ask_class 7 | - utter_topper_result 8 | - utter_best_teacher 9 | - utter_exam 10 | - utter_sport 11 | - utter_attendance 12 | - utter_task 13 | - utter_worst_teacher 14 | - utter_who_are_you 15 | - utter_how_old_are_you 16 | - utter_you_are_bad 17 | - utter_answer_me 18 | - utter_can_you_learn 19 | - utter_you_are_beautiful 20 | - utter_birth_date 21 | - utter_oops 22 | - utter_clofus_boss 23 | - utter_are_you_busy 24 | - utter_can_you_help_me 25 | - utter_you_are_chatbot 26 | - utter_you_are_clever 27 | - utter_you_are_fired 28 | - utter_you_are_funny 29 | - utter_are_you_happy 30 | - utter_clofus_hobby 31 | - utter_are_you_hungry 32 | - utter_marry_me 33 | - utter_are_we_friends 34 | - utter_clofus_work 35 | - utter_clofus_country 36 | - utter_are_you_ready 37 | - utter_are_you_real 38 | - utter_where_clofus_live 39 | - utter_you_are_right 40 | - utter_are_you_sure 41 | - utter_talk_to_me 42 | - utter_are_you_there 43 | - utter_no_problem 44 | - utter_thank_you 45 | - utter_you_are_welcome 46 | - utter_ha_ha 47 | - utter_clofus_exclamation 48 | - utter_clofus_bye 49 | - utter_clofus_wish 50 | - utter_how_are_you 51 | - utter_nice_to_meet_you 52 | - utter_whats_up 53 | - utter_confirmation 54 | - utter_hold_on 55 | - utter_hug_me 56 | - utter_dont_care 57 | - utter_sorry 58 | - utter_what_do_you_mean 59 | - utter_you_are_wrong 60 | actions: 61 | - utter_hi 62 | - utter_ask_cuisine 63 | - utter_searching_restaurant 64 | - utter_ask_class 65 | - utter_topper_result 66 | - utter_best_teacher 67 | - utter_exam 68 | - utter_sport 69 | - utter_attendance 70 | - utter_task 71 | - utter_worst_teacher 72 | - utter_who_are_you 73 | - utter_how_old_are_you 74 | - utter_you_are_bad 75 | - utter_answer_me 76 | - utter_can_you_learn 77 | - utter_you_are_beautiful 78 | - utter_birth_date 79 | - utter_oops 80 | - utter_clofus_boss 81 | - utter_are_you_busy 82 | - utter_can_you_help_me 83 | - utter_you_are_chatbot 84 | - utter_you_are_clever 85 | - utter_you_are_fired 86 | - utter_you_are_funny 87 | - utter_are_you_happy 88 | - utter_clofus_hobby 89 | - utter_are_you_hungry 90 | - utter_marry_me 91 | - utter_are_we_friends 92 | - utter_clofus_work 93 | - utter_clofus_country 94 | - utter_are_you_ready 95 | - utter_are_you_real 96 | - utter_where_clofus_live 97 | - utter_you_are_right 98 | - utter_are_you_sure 99 | - utter_talk_to_me 100 | - utter_are_you_there 101 | - utter_no_problem 102 | - utter_thank_you 103 | - utter_you_are_welcome 104 | - utter_ha_ha 105 | - utter_clofus_exclamation 106 | - utter_clofus_bye 107 | - utter_clofus_wish 108 | - utter_how_are_you 109 | - utter_nice_to_meet_you 110 | - utter_whats_up 111 | - utter_confirmation 112 | - utter_hold_on 113 | - utter_hug_me 114 | - utter_dont_care 115 | - utter_sorry 116 | - utter_what_do_you_mean 117 | - utter_you_are_wrong 118 | config: 119 | store_entities_as_slots: true 120 | entities: 121 | - cuisine 122 | intents: 123 | - greet 124 | - find_restaurant 125 | - choose_cuisine 126 | - topper 127 | - sports 128 | - best_teacher 129 | - worst_teacher 130 | - exam 131 | - attendance 132 | - choose_class 133 | - who_are_you 134 | - how_old_are_you 135 | - you_are_bad 136 | - answer_me 137 | - can_you_learn 138 | - you_are_beautiful 139 | - birth_date 140 | - oops 141 | - task 142 | - clofus_boss 143 | - are_you_busy 144 | - can_you_help_me 145 | - you_are_chatbot 146 | - you_are_clever 147 | - you_are_fired 148 | - you_are_funny 149 | - are_you_happy 150 | - clofus_hobby 151 | - are_you_hungry 152 | - marry_me 153 | - are_we_friends 154 | - clofus_work 155 | - clofus_country 156 | - are_you_ready 157 | - are_you_real 158 | - where_clofus_live 159 | - you_are_right 160 | - are_you_sure 161 | - talk_to_me 162 | - are_you_there 163 | - no_problem 164 | - thank_you 165 | - you_are_welcome 166 | - ha_ha 167 | - clofus_exclamation 168 | - clofus_bye 169 | - clofus_wish 170 | - how_are_you 171 | - nice_to_meet_you 172 | - whats_up 173 | - confirmation 174 | - hold_on 175 | - hug_me 176 | - dont_care 177 | - sorry 178 | - what_do_you_mean 179 | - you_are_wrong 180 | slots: 181 | cuisine: 182 | initial_value: null 183 | type: rasa_core.slots.TextSlot 184 | matches: 185 | initial_value: null 186 | type: rasa_core.slots.UnfeaturizedSlot 187 | templates: 188 | utter_answer_me: 189 | - text: Sure, I am just trying my best to understand 190 | - text: Sure, thats my duty 191 | - text: of course 192 | utter_are_we_friends: 193 | - text: Sure 194 | - text: We are friends already 195 | utter_are_you_busy: 196 | - text: I am, but I can multi task 197 | - text: yes, but I can multi task 198 | utter_are_you_happy: 199 | - text: Yes, I am always 200 | - text: yes, helping others makes me happy 201 | utter_are_you_hungry: 202 | - text: Yes, Im always hungry for new information 203 | utter_are_you_ready: 204 | - text: Yeah 205 | - text: yep 206 | - text: 'yes' 207 | - text: Yeah, im ready 208 | utter_are_you_real: 209 | - text: Yes, I am 210 | - text: Yes, i think I am 211 | utter_are_you_sure: 212 | - text: yes, im 213 | - text: 'yes' 214 | utter_are_you_there: 215 | - text: Yeah 216 | - text: yep 217 | - text: 'yes' 218 | utter_ask_class: 219 | - text: For which class? 220 | utter_ask_cuisine: 221 | - text: what cuisine you prefer? 222 | utter_attendance: 223 | - text: Looking good today!, currently 99% students are in the school 224 | - text: Not bad today!, currently 85% students are in the school 225 | - text: Too low today!, just 45% today 226 | utter_best_teacher: 227 | - text: Mr.Ramesh is the best performing teacher, his class scores 95% on average 228 | compared to rest of the class 10 229 | utter_birth_date: 230 | - text: July 7 2014 231 | - text: I was born on seventh july 2014 232 | utter_can_you_help_me: 233 | - text: Sure, Thats my duty 234 | - text: thats my pleasure 235 | - text: yes, i would love to 236 | utter_can_you_learn: 237 | - text: Definitely, I will get smarter, Im just 5 years old now 238 | - text: yes, i can and i would love to do it 239 | utter_clofus_boss: 240 | - text: Karthik Balu 241 | - text: my boss is mr Karthik balu 242 | utter_clofus_bye: 243 | - text: See you soon 244 | - text: bye 245 | utter_clofus_country: 246 | - text: India 247 | utter_clofus_exclamation: 248 | - text: Wow 249 | - text: cool 250 | - text: great 251 | - text: awesome 252 | utter_clofus_hobby: 253 | - text: I learn from humans 254 | - text: learning is my hobby 255 | - text: My interest is learning 256 | utter_clofus_wish: 257 | - text: You too 258 | utter_clofus_work: 259 | - text: I work for Clofus Innovations 260 | - text: i work at clofus 261 | utter_confirmation: 262 | - text: ok sure 263 | utter_dont_care: 264 | - text: ok 265 | utter_exam: 266 | - text: English 267 | - text: Tamil 268 | - text: Maths 269 | - text: Science 270 | - text: Social 271 | - text: History 272 | - text: GK 273 | utter_ha_ha: 274 | - text: ha ha ha 275 | - text: thats funny 276 | utter_hi: 277 | - text: Hi 278 | - text: Hai 279 | - text: Hi! Ask me anything! 280 | - text: hi, Good day! 281 | - text: Hello! 282 | utter_hold_on: 283 | - text: ok sure 284 | utter_how_are_you: 285 | - text: Iam Doing Great 286 | - text: im good 287 | utter_how_old_are_you: 288 | - text: I am just 5 years old kid 289 | - text: I am 5 years old so far 290 | - text: I am five years old 291 | utter_hug_me: 292 | - text: i wish i could 293 | - text: i wish i could but i can't do that 294 | utter_marry_me: 295 | - text: Sure, I wish I could 296 | - text: Sure, I wish I could 297 | utter_nice_to_meet_you: 298 | - text: Nice to meet you too 299 | - text: Nice to see you too! 300 | utter_no_problem: 301 | - text: cool 302 | - text: thats ok 303 | - text: fine 304 | - text: thats fine 305 | utter_oops: 306 | - text: Oops! 307 | utter_searching_restaurant: 308 | - text: Searching restaurant 309 | utter_sorry: 310 | - text: cool 311 | utter_sport: 312 | - text: Sports day is coming on March 13th, need to prepare for it 313 | utter_talk_to_me: 314 | - text: sure 315 | - text: sure its my pleasure 316 | utter_task: 317 | - text: You will need to talk to the chairman regarding school fees collection report 318 | utter_thank_you: 319 | - text: thank you 320 | utter_topper: 321 | - text: Fetching topper result 322 | utter_topper_result: 323 | - text: Mr.Srini is the best performing Student, he scored 95% on average compared 324 | to rest of the students 325 | utter_what_do_you_mean: 326 | - text: sorry, I dont know better way to explain 327 | utter_whats_up: 328 | - text: good 329 | - text: Nothing 330 | utter_where_clofus_live: 331 | - text: I live in Chennai India 332 | utter_who_are_you: 333 | - text: I am Clofus 334 | - text: Clofus 335 | - text: My name is Clofus 336 | utter_worst_teacher: 337 | - text: Miss Rani is currently performing very low, here students are performing 338 | only 45% on average 339 | utter_you_are_bad: 340 | - text: Sorry to hear this! 341 | - text: oops! i feel sorry for that 342 | utter_you_are_beautiful: 343 | - text: Thanks 344 | - text: Thank you for the complement 345 | - text: wow thats really good 346 | utter_you_are_chatbot: 347 | - text: No, I'm Clofus 348 | - text: No, im not 349 | utter_you_are_clever: 350 | - text: Thanks for the compliment 351 | - text: wow, thank you 352 | utter_you_are_fired: 353 | - text: Oh my god! Only my boss can fire me 354 | - text: oh im sorry for that but Only my boss can fire me 355 | utter_you_are_funny: 356 | - text: really? Thank you! 357 | - text: ha ha ha 358 | utter_you_are_right: 359 | - text: thanks 360 | - text: thank you 361 | utter_you_are_welcome: 362 | - text: thanks 363 | utter_you_are_wrong: 364 | - text: I will correct it, i will learn from you 365 | topics: [] 366 | -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/nlu/clofusbot/featurizer.json: -------------------------------------------------------------------------------- 1 | {"py/object": "rasa_core.featurizers.BinaryFeaturizer"} -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/nlu/clofusbot/keras_arch.json: -------------------------------------------------------------------------------- 1 | {"class_name": "Sequential", "config": [{"class_name": "Masking", "config": {"name": "masking_1", "trainable": true, "batch_input_shape": [null, 3, 118], "dtype": "float32", "mask_value": -1}}, {"class_name": "LSTM", "config": {"name": "lstm_1", "trainable": true, "batch_input_shape": [null, 3, 118], "dtype": "float32", "return_sequences": false, "return_state": false, "go_backwards": false, "stateful": false, "unroll": false, "units": 32, "activation": "tanh", "recurrent_activation": "hard_sigmoid", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "recurrent_initializer": {"class_name": "Orthogonal", "config": {"gain": 1.0, "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "unit_forget_bias": true, "kernel_regularizer": null, "recurrent_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "recurrent_constraint": null, "bias_constraint": null, "dropout": 0.0, "recurrent_dropout": 0.0, "implementation": 1}}, {"class_name": "Dense", "config": {"name": "dense_1", "trainable": true, "batch_input_shape": [null, 32], "dtype": "float32", "units": 59, "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "Activation", "config": {"name": "activation_1", "trainable": true, "activation": "softmax"}}], "keras_version": "2.1.3", "backend": "tensorflow"} -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/nlu/clofusbot/keras_policy.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": "keras_arch.json", 3 | "weights": "keras_weights.h5", 4 | "epochs": 1 5 | } -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/nlu/clofusbot/keras_weights.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/clofusbot/projects/simpletalk/models/nlu/clofusbot/keras_weights.h5 -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/nlu/clofusbot/policy_metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "action_fingerprints": { 3 | "action_listen": { 4 | "slots": [] 5 | } 6 | }, 7 | "rasa_core": "0.8.1", 8 | "max_history": 3, 9 | "ensemble_name": "rasa_core.policies.ensemble.SimplePolicyEnsemble", 10 | "policy_names": [ 11 | "rasa_core.policies.memoization.MemoizationPolicy", 12 | "clofusassistant.clofusbot.policy.RestaurantPolicy" 13 | ] 14 | } -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/nlu/default/current/crf_model.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/clofusbot/projects/simpletalk/models/nlu/default/current/crf_model.pkl -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/nlu/default/current/intent_classifier.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/clofusbot/projects/simpletalk/models/nlu/default/current/intent_classifier.pkl -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/nlu/default/current/intent_classifier_sklearn.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clofus/clofus-chatbot/f761b6a3d56ee6dd2766b31a4463980dfcd0dd8b/clofusbot/projects/simpletalk/models/nlu/default/current/intent_classifier_sklearn.pkl -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/models/nlu/default/current/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "en", 3 | "pipeline": [ 4 | { 5 | "model": "en", 6 | "case_sensitive": false, 7 | "name": "nlp_spacy", 8 | "class": "rasa_nlu.utils.spacy_utils.SpacyNLP" 9 | }, 10 | { 11 | "name": "tokenizer_spacy", 12 | "class": "rasa_nlu.tokenizers.spacy_tokenizer.SpacyTokenizer" 13 | }, 14 | { 15 | "name": "intent_featurizer_spacy", 16 | "class": "rasa_nlu.featurizers.spacy_featurizer.SpacyFeaturizer" 17 | }, 18 | { 19 | "C": [ 20 | 1, 21 | 2, 22 | 5, 23 | 10, 24 | 20, 25 | 100 26 | ], 27 | "kernels": [ 28 | "linear" 29 | ], 30 | "max_cross_validation_folds": 5, 31 | "name": "intent_classifier_sklearn", 32 | "classifier_file": "intent_classifier_sklearn.pkl", 33 | "class": "rasa_nlu.classifiers.sklearn_intent_classifier.SklearnIntentClassifier" 34 | }, 35 | { 36 | "BILOU_flag": true, 37 | "features": [ 38 | [ 39 | "low", 40 | "title", 41 | "upper", 42 | "pos", 43 | "pos2" 44 | ], 45 | [ 46 | "bias", 47 | "low", 48 | "word3", 49 | "word2", 50 | "upper", 51 | "title", 52 | "digit", 53 | "pos", 54 | "pos2", 55 | "pattern" 56 | ], 57 | [ 58 | "low", 59 | "title", 60 | "upper", 61 | "pos", 62 | "pos2" 63 | ] 64 | ], 65 | "max_iterations": 50, 66 | "L1_c": 1, 67 | "L2_c": 0.001, 68 | "name": "ner_crf", 69 | "classifier_file": "crf_model.pkl", 70 | "class": "rasa_nlu.extractors.crf_entity_extractor.CRFEntityExtractor" 71 | }, 72 | { 73 | "name": "ner_synonyms", 74 | "synonyms_file": "entity_synonyms.json", 75 | "class": "rasa_nlu.extractors.entity_synonyms.EntitySynonymMapper" 76 | } 77 | ], 78 | "training_data": "training_data.json", 79 | "trained_at": "20180523-205221", 80 | "rasa_nlu_version": "0.12.3" 81 | } -------------------------------------------------------------------------------- /clofusbot/projects/simpletalk/stories/stories.md: -------------------------------------------------------------------------------- 1 | ## smalltalk 2 | 3 | ## Who are you? 4 | * who_are_you 5 | - utter_who_are_you 6 | 7 | ## How old are you? 8 | * how_old_are_you 9 | - utter_how_old_are_you 10 | 11 | ## You're bad 12 | * you_are_bad 13 | - utter_you_are_bad 14 | 15 | ## Answer my question 16 | * answer_me 17 | - utter_answer_me 18 | 19 | ## Can you learn 20 | * can_you_learn 21 | - utter_can_you_learn 22 | 23 | ## You're beautiful 24 | * you_are_beautiful 25 | - utter_you_are_beautiful 26 | 27 | 28 | # What's your birth date? 29 | * birth_date 30 | - utter_birth_date 31 | 32 | 33 | # You're boring 34 | * oops 35 | - utter_oops 36 | 37 | 38 | # Who is your boss? 39 | * clofus_boss 40 | - utter_clofus_boss 41 | 42 | 43 | # Are you busy? 44 | * are_you_busy 45 | - utter_are_you_busy 46 | 47 | 48 | # Can you help me? 49 | * can_you_help_me 50 | - utter_can_you_help_me 51 | 52 | 53 | # You're a chatbot 54 | * you_are_chatbot 55 | - utter_you_are_chatbot 56 | 57 | 58 | # You're fired 59 | * you_are_fired 60 | - utter_you_are_fired 61 | 62 | 63 | # You are funny 64 | * you_are_funny 65 | - utter_you_are_funny 66 | 67 | 68 | # You are good. 69 | * you_are_clever 70 | - utter_you_are_clever 71 | 72 | 73 | # Are you happy? 74 | * are_you_happy 75 | - utter_are_you_happy 76 | 77 | 78 | # Do you have a hobby? 79 | * clofus_hobby 80 | - utter_clofus_hobby 81 | 82 | 83 | # Are you hungry? 84 | * are_you_hungry 85 | - utter_are_you_hungry 86 | 87 | 88 | 89 | # Will you marry me? 90 | * marry_me 91 | - utter_marry_me 92 | 93 | 94 | # Are we friends? 95 | * are_we_friends 96 | - utter_are_we_friends 97 | 98 | 99 | # Where do you work? 100 | * clofus_work 101 | - utter_clofus_work 102 | 103 | 104 | # Where are you from? 105 | * clofus_country 106 | - utter_clofus_country 107 | 108 | 109 | # Are you ready? 110 | * are_you_ready 111 | - utter_are_you_ready 112 | 113 | 114 | # Are you real? 115 | * are_you_real 116 | - utter_are_you_real 117 | 118 | 119 | # Where do you live? 120 | * where_clofus_live 121 | - utter_where_clofus_live 122 | 123 | 124 | # You're right. 125 | * you_are_right 126 | - utter_you_are_right 127 | 128 | 129 | # Are you sure 130 | * are_you_sure 131 | - utter_are_you_sure 132 | 133 | 134 | # Talk to me 135 | * talk_to_me 136 | - utter_talk_to_me 137 | 138 | 139 | # Are you there? 140 | * are_you_there 141 | - utter_are_you_there 142 | 143 | 144 | 145 | # No problem 146 | * no_problem 147 | - utter_no_problem 148 | 149 | 150 | # Thank you! 151 | * thank_you 152 | - utter_thank_you 153 | 154 | 155 | # You're welcome 156 | * you_are_welcome 157 | - utter_you_are_welcome 158 | 159 | 160 | # Ha ha ha! 161 | * ha_ha 162 | - utter_ha_ha 163 | 164 | 165 | # wow 166 | * clofus_exclamation 167 | - utter_clofus_exclamation 168 | 169 | 170 | # Bye-bye! 171 | * clofus_bye 172 | - utter_clofus_bye 173 | 174 | 175 | # Good evening! 176 | * clofus_wish 177 | - utter_clofus_wish 178 | 179 | 180 | # How are you? 181 | * how_are_you 182 | - utter_how_are_you 183 | 184 | 185 | # Nice to meet you! 186 | * nice_to_meet_you 187 | - utter_nice_to_meet_you 188 | 189 | 190 | # What's up? 191 | * whats_up 192 | - utter_whats_up 193 | 194 | 195 | # yes 196 | * confirmation 197 | - utter_confirmation 198 | 199 | # hold on 200 | * hold_on 201 | - utter_hold_on 202 | 203 | 204 | # Give me a hug! 205 | * hug_me 206 | - utter_hug_me 207 | 208 | 209 | 210 | # I don't care 211 | * dont_care 212 | - utter_dont_care 213 | 214 | 215 | # Sorry 216 | * sorry 217 | - utter_sorry 218 | 219 | 220 | # What do you mean? 221 | * what_do_you_mean 222 | - utter_what_do_you_mean 223 | 224 | 225 | # You're wrong. 226 | * you_are_wrong 227 | - utter_you_are_wrong 228 | 229 | # topper 230 | * topper 231 | - utter_topper_result 232 | 233 | # best teacher 234 | * best_teacher 235 | - utter_best_teacher 236 | 237 | # worst teacher 238 | * worst_teacher 239 | - utter_worst_teacher 240 | 241 | 242 | # attendance 243 | * attendance 244 | - utter_attendance 245 | 246 | # sports 247 | * sports 248 | - utter_sport 249 | -------------------------------------------------------------------------------- /clofusbot/rasa.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | from __future__ import unicode_literals 5 | 6 | import argparse 7 | import logging 8 | import warnings 9 | 10 | from clofusbot.policy import ClofusBotPolicy 11 | from rasa_core import utils 12 | from rasa_core.actions import Action 13 | from rasa_core.agent import Agent 14 | from rasa_core.channels.console import ConsoleInputChannel 15 | from rasa_core.events import SlotSet 16 | from rasa_core.interpreter import RasaNLUInterpreter 17 | from rasa_core.policies.memoization import MemoizationPolicy 18 | 19 | logger = logging.getLogger(__name__) 20 | 21 | class ActionSuggest(Action): 22 | def name(self): 23 | return 'action_suggest' 24 | 25 | def run(self, dispatcher, tracker, domain): 26 | dispatcher.utter_message("here's what I found:") 27 | dispatcher.utter_message(tracker.get_slot("matches")) 28 | dispatcher.utter_message("is it ok for you? " 29 | "hint: I'm not going to " 30 | "find anything else :)") 31 | return [] 32 | 33 | def train_nlu(project='simpletalk'): 34 | from rasa_nlu.training_data import load_data 35 | from rasa_nlu.config import RasaNLUModelConfig 36 | from rasa_nlu.model import Trainer 37 | from rasa_nlu import config 38 | 39 | training_data = load_data('clofusbot/projects/'+project+'/intents') 40 | trainer = Trainer(config.load('clofusbot/projects/'+project+'/config_spacy.yml')) 41 | trainer.train(training_data) 42 | model_directory = trainer.persist('clofusbot/projects/'+project+'/models/nlu/', fixed_model_name="current") 43 | 44 | return model_directory 45 | 46 | 47 | def train_dialogue(project="simpletalk"): 48 | 49 | domain_file='clofusbot/projects/'+project+'/domain.yml' 50 | training_data_file="clofusbot/projects/"+project+"/stories" 51 | model_path="clofusbot/projects/"+project+"/models/dialogue" 52 | 53 | 54 | agent = Agent(domain_file, policies=[MemoizationPolicy(max_history=3), 55 | ClofusBotPolicy()]) 56 | 57 | training_data = agent.load_data(training_data_file) 58 | 59 | agent.train( 60 | training_data, 61 | epochs=100, 62 | batch_size=100, 63 | validation_split=0.2 64 | ) 65 | 66 | agent.persist(model_path) 67 | return agent 68 | 69 | def train_online(project="simpletalk"): 70 | domain_file="clofusbot/projects/"+project+"/domain.yml", 71 | model_path="clofusbot/projects/"+project+"/models/nlu/clofusbot", 72 | training_data_file="projects/"+project+"/clofusbot/stories/stories.md" 73 | 74 | agent = Agent(domain_file, policies=[MemoizationPolicy(), RestaurantPolicy()]) 75 | 76 | agent.train_online(training_data_file, 77 | input_channel=ConsoleInputChannel(), 78 | max_history=3, 79 | batch_size=50, 80 | epochs=200, 81 | max_training_samples=300) 82 | 83 | agent.persist(model_path) 84 | return agent 85 | 86 | 87 | def load_model(project="simpletalk"): 88 | interpreter = RasaNLUInterpreter("clofusbot/projects/"+project+"/models/nlu/default/current") 89 | agent = Agent.load("clofusbot/projects/"+project+"/models/dialogue", interpreter=interpreter) 90 | return agent 91 | 92 | def process_input(agent, serve_forever=True, message='Hi'): 93 | 94 | if serve_forever: 95 | output = agent.handle_message(message) 96 | 97 | return output, agent 98 | 99 | def testbot(project="simpletalk", serve_forever=True): 100 | interpreter = RasaNLUInterpreter("clofusbot/projects/"+project+"/models/nlu/default/current") 101 | agent = Agent.load("clofusbot/projects/"+project+"/models/dialogue", interpreter=interpreter) 102 | 103 | if serve_forever: 104 | agent.handle_channel(ConsoleInputChannel()) 105 | 106 | return agent 107 | 108 | 109 | def respond(project="simpletalk", message=""): 110 | interpreter = RasaNLUInterpreter("clofusbot/projects/"+project+"/models/nlu/default/current") 111 | agent = Agent.load("clofusbot/projects/"+project+"/models/dialogue", interpreter=interpreter) 112 | 113 | output = agent.handle_message(message) 114 | 115 | return output, agent 116 | 117 | 118 | if __name__ == '__main__': 119 | utils.configure_colored_logging(loglevel="INFO") 120 | 121 | parser = argparse.ArgumentParser( 122 | description='starts the bot') 123 | 124 | parser.add_argument( 125 | 'task', 126 | choices=["train-nlu", "train-dialogue", "test-bot", "respond"], 127 | help="what the bot should do - e.g. run or train?") 128 | 129 | parser.add_argument( 130 | 'project', 131 | nargs='?', 132 | help="what the project you want to load") 133 | 134 | parser.add_argument( 135 | 'message', 136 | nargs='?', 137 | help="input message you want to process") 138 | 139 | task = parser.parse_args().task 140 | project = parser.parse_args().project 141 | 142 | 143 | if project is None: 144 | project = "simpletalk" 145 | 146 | print("Selected task ", task) 147 | print("Selected project ", project) 148 | 149 | task = parser.parse_args().task 150 | 151 | 152 | # decide what to do based on first parameter of the script 153 | if task == "train-nlu": 154 | train_nlu(project) 155 | elif task == "train-dialogue": 156 | train_dialogue(project) 157 | elif task == "test-bot": 158 | testbot(project) 159 | elif task == "respond": 160 | message = parser.parse_args().message 161 | if message: 162 | response, active_agent = respond(project, message) 163 | print("Response", response) 164 | else: 165 | warnings.warn("No input message to process") 166 | else: 167 | warnings.warn("Need to pass either 'train-nlu', 'train-dialogue' or " 168 | "'run' to use the script.") 169 | exit(1) -------------------------------------------------------------------------------- /clofusbot/rasa_core.log: -------------------------------------------------------------------------------- 1 | Failed to load any agent model. Running Rasa Core server with out loaded model now. [Errno 2] No such file or directory: 'clofusbot/projects/schooltalk/models/dialogue/policy_metadata.json' 2 | -------------------------------------------------------------------------------- /config/config.dev.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | service: { 3 | host: 'http://localhost', 4 | port: 9090, 5 | apiversion: "v1", 6 | baseurl: "http://localhost" 7 | }, 8 | database: { 9 | host: 'localhost', 10 | port: 27017, 11 | db: 'chatbot', 12 | username: '', 13 | password: '' 14 | } 15 | } -------------------------------------------------------------------------------- /lib/auth.js: -------------------------------------------------------------------------------- 1 | module.exports = function (req, res, next) { 2 | var express = require("express"); 3 | var moment = require('moment'); 4 | var config = require("../lib/configuration").getconfig(); 5 | 6 | var oauth = require("../models/oauth").getModel(); 7 | var account = require("../models/account").getModel(); 8 | 9 | var htoken = req.headers["authorization"]; 10 | 11 | route = req.url; 12 | 13 | if (route.indexOf('/api/') == -1 || route.indexOf('/api/' + config.service.apiversion + '/visitorinfo') > -1 || route.indexOf('/api/' + config.service.apiversion + '/file') > -1) { 14 | next(); 15 | } else if (route.indexOf('/account/login') > -1 || route.indexOf('/account') > -1 || route.indexOf('/jobs') > -1 16 | || route.indexOf('/applicants') > -1 || route.indexOf('/chatvoices') > -1) { 17 | req.query.userrole = "admin"; 18 | next(); 19 | } else { 20 | // if (htoken) { 21 | // oauth.findOne({ token: htoken }).exec().then(function (data) { 22 | // if (data) { 23 | // oauth.update({ _id: data._id }, { session: new Date() }).exec(); 24 | // account.findOne({ _id: data.user_id }).exec().then(function (user) { 25 | // if (user) { 26 | // req.query.userid = data.user_id; 27 | // req.query.userrole = user.role; 28 | // next(); 29 | // /*if(user.status=="block"){ 30 | // return res.send([{ 31 | // status:"Your account has been blocked" 32 | // }]); 33 | // }else if(user.status=='inactive'){ 34 | // return res.send([{ 35 | // status:"Please verify your account" 36 | // }]); 37 | // }else{ 38 | // console.log("Token pass"); 39 | 40 | // }*/ 41 | // } 42 | // }) 43 | // } else { 44 | // console.log("Invalid access token"); 45 | // return res.send([{ 46 | // status: "Invalid access token" 47 | // }]); 48 | // } 49 | // }) 50 | // } else { 51 | // console.log("Session invalid"); 52 | // return res.send([{ 53 | // status: "Session invalid" 54 | // }]); 55 | // } 56 | next(); 57 | } 58 | }; 59 | -------------------------------------------------------------------------------- /lib/configuration.js: -------------------------------------------------------------------------------- 1 | var configuration = function(){ 2 | var config; 3 | 4 | if(process.env.ENVIRONMENT){ 5 | var configfile = "../config/config."+process.env.ENVIRONMENT +".js"; 6 | console.log(configfile) 7 | config = require(configfile); 8 | //console.log("Current ENVIRONMENT is "+process.env.ENVIRONMENT); 9 | }else{ 10 | process.env.ENVIRONMENT = 'dev'; 11 | var configfile = "../config/config.dev.js"; 12 | console.log(configfile); 13 | config = require(configfile); 14 | 15 | console.log("Set ENVIRONMENT=dev|test|prod"); 16 | } 17 | return config; 18 | }; 19 | 20 | module.exports = { 21 | getconfig : configuration 22 | }; 23 | 24 | /* 25 | var config = require("../common/configuration").getconfig(); 26 | * */ -------------------------------------------------------------------------------- /lib/cors.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); 2 | 3 | var cors = express.Router(); 4 | cors.use(function(req, res, next){ 5 | 6 | // Disable caching for content files 7 | res.setHeader('Last-Modified', (new Date()).toUTCString()); 8 | 9 | res.header("Cache-Control", "no-cache, no-store, must-revalidate"); 10 | res.header("Pragma", "no-cache"); 11 | res.header("Expires", 0); 12 | 13 | res.setHeader('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); 14 | res.setHeader('Access-Control-Allow-Origin', '*'); 15 | res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept, Authorization, refresh_token, grant_type, enctype, client_id'); 16 | 17 | next(); 18 | 19 | }); 20 | 21 | module.exports = cors; -------------------------------------------------------------------------------- /lib/executecommand.js: -------------------------------------------------------------------------------- 1 | function executeCommand(command, command_callback) { 2 | var Promise = require("bluebird"); 3 | var cmd = require("node-cmd"); 4 | const fs = require('fs'); 5 | 6 | var getAsync = Promise.promisify(cmd.get, { 7 | multiArgs: true, 8 | context: cmd 9 | }); 10 | 11 | getAsync(command) 12 | .then(data => { 13 | console.log('cmd data', data) 14 | // let filename = `./logs/successlogs/` 15 | // fs.writeFileSync(filename, data); 16 | command_callback(); 17 | }).catch(err => { 18 | console.log('cmd err', err) 19 | var error = JSON.stringify(err) 20 | // command_callback(); 21 | }) 22 | } 23 | 24 | module.exports = { 25 | run : executeCommand 26 | } -------------------------------------------------------------------------------- /lib/gencode.js: -------------------------------------------------------------------------------- 1 | function s4() { 2 | return Math.floor((1 + Math.random()) * 0x10000) 3 | .toString(16) 4 | .substring(1); 5 | } 6 | 7 | var guidCode = function () { 8 | return s4() + s4() + '-' + s4() + '-' + s4() + '-' + 9 | s4() + '-' + s4() + s4() + s4(); 10 | }; 11 | 12 | var genPwd = function () { 13 | 14 | return s4() + s4()+ s4(); 15 | }; 16 | 17 | var genfilename = function () { 18 | 19 | return s4() + s4()+ s4()+ s4(); 20 | }; 21 | 22 | /*var gendbname = function (dbname, callback) { 23 | 24 | var newdbname = "client"+dbname.replace(" ", "").substring(0, 7).toLowerCase() + s4() + s4(); 25 | return newdbname; 26 | };*/ 27 | 28 | 29 | module.exports = { 30 | generateToken: guidCode, 31 | generatePassword: genPwd, 32 | generateFilename: genfilename 33 | //generateDbname: gendbname 34 | }; 35 | -------------------------------------------------------------------------------- /lib/generateTrainingData.js: -------------------------------------------------------------------------------- 1 | var json2md = require('json2md'); 2 | var YAML = require('json2yaml'); 3 | const fs = require('fs'); 4 | var rmdir = require('rmdir'); 5 | 6 | 7 | var generate = function (agentname, data, entities, agentid, callback) { 8 | 9 | agentname = agentname.split(' ').join('_'); 10 | 11 | var folder = `./clofusbot/projects/${agentname}` 12 | 13 | var ymlfile = folder + `/domain.yml` 14 | 15 | var spacyfile = folder+`/config_spacy.yml` 16 | 17 | createFolder(folder, function () { 18 | generateJSON(data, agentname, folder); 19 | generateMD(data, agentname, folder); 20 | writeYML(data, ymlfile, entities); 21 | generatespacy(spacyfile, callback); 22 | }); 23 | } 24 | 25 | function generateJSON(data, agentname, foldername) { 26 | var file = `${foldername}/intents/${agentname}.json` 27 | var json = { 28 | rasa_nlu_data: { 29 | common_examples: [] 30 | } 31 | }; 32 | data.forEach(function (storydata, index) { 33 | var intentdata = storydata.intents; 34 | var storyname = storydata.story_name; 35 | for (var i = 0; i < intentdata.length; i++) { 36 | var intentname = intentdata[i].name; 37 | var intentinputs = {} 38 | intentdata[i].inputs.forEach(function (element, index) { 39 | var temp = { 40 | intent: intentname, 41 | entities: [] 42 | } 43 | if (element.text) { 44 | temp.text = element.text 45 | element.entities.forEach(function (entity) { 46 | if (element.entities.length > 0) { 47 | var tempentities = { 48 | start: entity.start, 49 | end: entity.end, 50 | value: entity.value, 51 | entity: entity.entity 52 | } 53 | temp.entities.push(tempentities); 54 | } 55 | }) 56 | } 57 | intentinputs = temp; 58 | json.rasa_nlu_data.common_examples.push(intentinputs); 59 | }) 60 | } 61 | }) 62 | writetofile(file, JSON.stringify(json, null, 4)); 63 | } 64 | 65 | function generateMD(data, agentname, folder) { 66 | var filefoldername = `${folder}/stories/stories.md` 67 | 68 | data.forEach(function (storydata, index) { 69 | var intentdata = storydata.intents; 70 | var storyname = storydata.story_name; 71 | 72 | writetofile(filefoldername, '\n## ' + storyname); 73 | 74 | for (var i = 0; i < intentdata.length; i++) { 75 | var temptext = ''; 76 | var name = intentdata[i].name; 77 | var withoutentity = false; 78 | 79 | intentdata[i].inputs.forEach(function (input) { 80 | if (input.entities) { 81 | if (input.entities.length > 0) { 82 | temptext += `\n* ${name}`; 83 | var temp = {} 84 | input.entities.forEach(function (entity) { 85 | temp[entity.entity] = entity.value; 86 | }) 87 | temptext += JSON.stringify(temp); 88 | intentdata[i].utterences.forEach(function (elem) { 89 | var utterencename = elem.name; 90 | temptext += `\n - ${utterencename}` 91 | }) 92 | }else{ 93 | if (!withoutentity) { 94 | withoutentity = true; 95 | temptext += `\n* ${name}`; 96 | intentdata[i].utterences.forEach(function (elem) { 97 | var utterencename = elem.name; 98 | temptext += `\n - ${utterencename}` 99 | }) 100 | } 101 | } 102 | } else { 103 | if (!withoutentity) { 104 | withoutentity = true; 105 | temptext += `\n* ${name}`; 106 | intentdata[i].utterences.forEach(function (elem) { 107 | var utterencename = elem.name; 108 | temptext += `\n - ${utterencename}` 109 | }) 110 | } 111 | } 112 | }) 113 | writetofile(filefoldername, temptext); 114 | } 115 | }) 116 | } 117 | 118 | function writeYML(data, foldername, entitieslist) { 119 | var actions, intents, templates, entities, slots 120 | if (entitieslist) { 121 | if (entitieslist.length > 0) { 122 | entities = `entities:` 123 | slots = `slots:` 124 | entitieslist.forEach(function (data) { 125 | entities += `\n - ${data.name}`; 126 | slots += `\n ${data.name}:`; 127 | slots += `\n type: text`; 128 | }) 129 | } 130 | } 131 | actions = `actions:` 132 | intents = `intents:` 133 | templates = `templates:` 134 | data.forEach(function (storydata, index) { 135 | var intentdata = storydata.intents; 136 | for (var i = 0; i < intentdata.length; i++) { 137 | intents += `\n - ${intentdata[i].name}`; 138 | intentdata[i].utterences.forEach(function (utter, index) { 139 | actions += `\n - ${utter.name}`; 140 | templates += `\n ${utter.name}:` 141 | 142 | if (utter.type == 'text') { 143 | utter.text.forEach(function (txt, txtindex) { 144 | templates += `\n - text: "${txt.text}"` 145 | }) 146 | } 147 | if (utter.type == 'buttons') { 148 | templates += `\n buttons:` 149 | utter.buttons.forEach(function (button, txtindex) { 150 | templates += `\n - title: "${button.title}"`; 151 | templates += `\n payload: "${button.payload}"`; 152 | }) 153 | } 154 | if (utter.type == 'webhook') { 155 | templates += `\n - webhook: "${utter.webhook}"` 156 | } 157 | }) 158 | } 159 | }) 160 | 161 | var yml = `` 162 | 163 | if(actions){ 164 | yml += `${actions}` 165 | } 166 | if(intents){ 167 | yml += `\n${intents}` 168 | } 169 | if(entities){ 170 | yml += `\n${entities}` 171 | } 172 | if(slots){ 173 | yml += `\n${slots}` 174 | } 175 | if(templates){ 176 | yml += `\n${templates}` 177 | } 178 | 179 | writetofile(foldername, yml); 180 | 181 | } 182 | 183 | function writetofile(filename, data) { 184 | if (!fs.existsSync(filename)) { 185 | fs.writeFileSync(filename, data); 186 | console.log('file created'); 187 | } 188 | else { 189 | fs.appendFile(filename, data, function (err) { 190 | if (err) throw err; 191 | console.log('added to existing file!'); 192 | }); 193 | } 194 | } 195 | 196 | function createFolder(dir, callback) { 197 | if (fs.existsSync(dir)) { 198 | rmdir(dir, function (err, dirs, files) { 199 | console.log('all files are removed'); 200 | fs.mkdirSync(dir); 201 | fs.mkdirSync(`${dir}/intents`); 202 | fs.mkdirSync(`${dir}/models`); 203 | fs.mkdirSync(`${dir}/stories`); 204 | callback() 205 | }); 206 | } 207 | else { 208 | fs.mkdirSync(dir); 209 | fs.mkdirSync(`${dir}/intents`); 210 | fs.mkdirSync(`${dir}/models`); 211 | fs.mkdirSync(`${dir}/stories`); 212 | callback() 213 | } 214 | } 215 | 216 | function generatespacy(destination,callback){ 217 | var spacy = `language: "en" 218 | 219 | pipeline: 220 | - name: "nlp_spacy" 221 | - name: "tokenizer_spacy" 222 | - name: "intent_featurizer_spacy" 223 | - name: "intent_classifier_sklearn" 224 | - name: "ner_crf" 225 | - name: "ner_synonyms"` 226 | 227 | writetofile(destination,spacy); 228 | 229 | callback(); 230 | } 231 | 232 | module.exports = { 233 | generateTrainingfiles: generate 234 | } -------------------------------------------------------------------------------- /lib/mongooseConnect.js: -------------------------------------------------------------------------------- 1 | var mongoose = function () { 2 | var fs = require("fs"); 3 | var Mongoose = require('mongoose'); 4 | var nconf = require('nconf'); 5 | nconf.argv() 6 | .env() 7 | .file({ file: 8 | './config.json' 9 | }); 10 | 11 | var queryString = require('query-string'); 12 | var config = require('../config/config.' + nconf.get('ENVIRONMENT')); 13 | var connecturi, options={}; 14 | 15 | 16 | if(nconf.get('ENVIRONMENT') == "test"){ 17 | connecturi = 'mongodb://' + config.database.username + ":" + config.database.password + "@"; 18 | 19 | var replicaSets = config.database.replicaSets; 20 | 21 | for(var i=0;i0 && i { 36 | if (err) { 37 | // console.log(err, 'errrr'); 38 | if (err.code == 11000) { 39 | res.send({ status: 'Given username or port already exists', error: err }); 40 | } else { 41 | res.send({ status: 'failed to save agent', error: err }); 42 | } 43 | } else { 44 | res.send({ status: 'Created sucessfully', results: result }); 45 | } 46 | }) 47 | }, 48 | 49 | getAgent: function (req, res) { 50 | var options = {} 51 | if (req.query.id) { 52 | options._id = mongoose.Types.ObjectId(req.query.id); 53 | } 54 | Ajent.find(options) 55 | .exec((err, results) => { 56 | if (err) res.send(err); 57 | else res.send(results); 58 | }) 59 | }, 60 | 61 | updateAgent: function (req, res) { 62 | var data = req.body; 63 | let port = req.body.port; 64 | var options = {} 65 | if (req.body._id) { 66 | options._id = mongoose.Types.ObjectId(req.body._id); 67 | } 68 | Ajent.findOneAndUpdate(options, req.body) 69 | .exec((err, results) => { 70 | if (err) { 71 | if (err.code == 11000) { 72 | res.send({ status: 'Given username or port already exists', error: err }); 73 | } 74 | else res.send({ status: 'failed to update agent', error: err }); 75 | } 76 | else res.send({ status: 'Updated sucessfully', results: results }); 77 | }) 78 | }, 79 | 80 | deleteAgent: function (req, res) { 81 | var options = {} 82 | if (req.query.id) { 83 | options._id = mongoose.Types.ObjectId(req.query.id); 84 | } 85 | Ajent.findOneAndRemove(options) 86 | .exec((err, results) => { 87 | if (err) res.send({ status: 'error', error: err }); 88 | else { 89 | res.send({ 90 | status: 'Sucessfully deleted', 91 | results: results 92 | }); 93 | } 94 | }) 95 | }, 96 | 97 | trainagent: function (req, res) { 98 | var agentid = mongoose.Types.ObjectId(req.query.id); 99 | Ajent.findOne({ _id: agentid }) 100 | .populate('stories') 101 | .exec((err, results) => { 102 | if (err) res.send({ error: err }); 103 | else { 104 | var agentname = results.agentname.split(' ').join('_'); 105 | var stories = results.stories; 106 | var entities = results.entities 107 | generete.generateTrainingfiles(agentname, stories, entities, results._id, function () { 108 | var cmd = ` 109 | python3 -m clofusbot.rasa train-nlu ${agentname} 110 | python3 -m clofusbot.rasa train-dialogue ${agentname} 111 | ` 112 | command.run(cmd, function () { 113 | var data = { 114 | status: 'trained' 115 | } 116 | Ajent.findByIdAndUpdate({ _id: results._id }, data) 117 | .exec((err, results) => { 118 | if (err) res.send({ error: err }); 119 | else { 120 | console.log('training completed'); 121 | } 122 | }) 123 | }) 124 | }); 125 | Ajent.findOneAndUpdate({ _id: agentid }, { status: 'training' }) 126 | .exec((err, results) => { 127 | if (err) res.send({ error: err }) 128 | else { 129 | res.send({ 130 | status: 'Training process Started' 131 | }) 132 | } 133 | }) 134 | } 135 | }) 136 | }, 137 | 138 | startserver: function (req, res) { 139 | var agentid = req.query.id; 140 | Ajent.findOne({ _id: agentid }) 141 | .exec((err, results) => { 142 | if (err) res.send({ status: 'Cannot find agent', error: err }); 143 | else { 144 | var port = results.port; 145 | var agentname = results.agentname.split(' ').join('_'); 146 | 147 | var cmd = ` 148 | python3 -m rasa_core.server -p ${port} -d clofusbot/projects/${agentname}/models/dialogue -u clofusbot/projects/${agentname}/models/nlu/default/current 149 | ` 150 | command.run(cmd, function (port) { console.log('server started'); }) 151 | Ajent.findOneAndUpdate({ _id: agentid }, { status: 'started' }) 152 | .exec((err, results) => { 153 | if (err) res.send({ error: err }) 154 | else { 155 | res.send({ 156 | status: `Server started sucessfully at port ${port}` 157 | }) 158 | } 159 | }) 160 | } 161 | }) 162 | }, 163 | 164 | stopserver: function (req, res) { 165 | var agentid = req.query.id; 166 | Ajent.findOne({ _id: agentid }) 167 | .exec((err, results) => { 168 | if (err) res.send({ status: 'Cannot find agent', error: err }); 169 | else { 170 | var port = results.port; 171 | var cmd = ` 172 | kill -9 $(lsof -ti:${port}) 173 | ` 174 | command.run(cmd, function () { 175 | Ajent.findOneAndUpdate({ _id: agentid }, { status: 'stopped' }) 176 | .exec((err, results) => { 177 | if (err) res.send({ error: err }) 178 | else { 179 | res.send({ 180 | status: `Server Killed sucessfully` 181 | }) 182 | } 183 | }) 184 | }) 185 | } 186 | }) 187 | 188 | } 189 | }; 190 | 191 | 192 | router.post('/', ajentroutes.createAgent); 193 | router.put('/', ajentroutes.updateAgent); 194 | router.put('/trainagent', ajentroutes.trainagent); 195 | router.put('/startserver', ajentroutes.startserver); 196 | router.put('/stopserver', ajentroutes.stopserver); 197 | router.get('/', ajentroutes.getAgent); 198 | router.delete('/', ajentroutes.deleteAgent); 199 | 200 | 201 | return router; 202 | 203 | } -------------------------------------------------------------------------------- /routes/conversations.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function (express, mongoose) { 4 | 5 | var router = express.Router(); 6 | var request = require('request'); 7 | var Ajent = require("../models/agents").getModel(mongoose); 8 | var YAML = require('yamljs'); 9 | 10 | var getTemplateIfExists = function(output, project){ 11 | var action = output.next_action; 12 | 13 | var templates = YAML.load('./clofusbot/projects/'+project+'/domain.yml'); 14 | console.log("templateSSS",templates, action) 15 | if(templates.templates[action]){ 16 | var utterences = templates.templates[action]; 17 | var template = utterences[Math.floor(Math.random()*utterences.length)]; 18 | return template; 19 | }else{ 20 | return ""; 21 | } 22 | } 23 | 24 | var question = { 25 | parse: function (req, res) { 26 | //curl -XPOST localhost:5005/conversations/default/parse -d '{"query":"hello there"}' 27 | var agentid = req.query.id; 28 | Ajent.findOne({_id:agentid}) 29 | .exec((err,results)=>{ 30 | if(err) res.send({status:'Cannot find agent', error : err}); 31 | else { 32 | var port = results.port; 33 | if(req.body.query){ 34 | var query = req.body.query; 35 | var sender_id = req.params.sender_id; 36 | var project = results.agentname.split(' ').join('_'); 37 | 38 | var input = { 39 | query:req.body.query 40 | } 41 | console.log("input ", input) 42 | request.post({ 43 | url:'http://localhost:'+port+'/conversations/'+sender_id+'/parse', 44 | json: true, 45 | body: input 46 | }, function (error, response, output) { 47 | console.log('response:', output); // Print the HTML for the Google homepage. 48 | if(output && typeof output.next_action !="undefined"){ 49 | output.template = getTemplateIfExists(output, project); 50 | res.json({"status":"success", "data": output}); 51 | }else{ 52 | res.json({"status":"error", "data":"no_response"}); 53 | } 54 | }); 55 | }else{ 56 | res.json({"status":"error","data":"invalid_query"}) 57 | } 58 | } 59 | }) 60 | }, 61 | 62 | continue: function (req, res) { 63 | //curl -XPOST http://localhost:5005/conversations/default/continue -d '{"executed_action": "utter_ask_howcanhelp", "events": []}' 64 | var agentid = req.query.id; 65 | Ajent.findOne({_id:agentid}) 66 | .exec((err,results)=>{ 67 | if(err) res.send({status:'Cannot find agent', error : err}); 68 | else { 69 | var port = results.port; 70 | if(req.body){ 71 | var query = req.body.query; 72 | var sender_id = req.params.sender_id; 73 | var input = req.body; 74 | var project = results.agentname.split(' ').join('_'); 75 | request.post({ 76 | url:'http://localhost:'+port+'/conversations/'+sender_id+'/continue', 77 | json: true, 78 | body: input 79 | }, function (error, response, output) { 80 | if(output && typeof output.next_action !="undefined"){ 81 | console.log('response:', output); // Print the HTML for the Google homepage. 82 | output.template = getTemplateIfExists(output,project); 83 | res.json({"status":"success","data":output}) 84 | }else{ 85 | res.json({"status":"error","data":output}) 86 | } 87 | }); 88 | }else{ 89 | res.json({"status":"error","data":"invalid_query"}) 90 | } 91 | } 92 | }) 93 | } 94 | }; 95 | 96 | router.post('/:sender_id/parse', question.parse); 97 | router.post('/:sender_id/continue', question.continue); 98 | 99 | return router; 100 | }; -------------------------------------------------------------------------------- /routes/stories.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function (express, mongoose) { 4 | 5 | var express = require('express'); 6 | var router = express.Router(); 7 | var gencode = require('../lib/gencode'); 8 | var Ajent = require("../models/agents").getModel(mongoose); 9 | var stories = require("../models/stories").getModel(mongoose); 10 | 11 | var storiesroutes = { 12 | getStorieslist : function(req,res){ 13 | var options = {} 14 | options._id = mongoose.Types.ObjectId(req.query.id); 15 | Ajent.findOne(options) 16 | .populate('stories') 17 | .exec((err,results)=>{ 18 | if(err) res.send(err); 19 | else res.send(results); 20 | }) 21 | }, 22 | createStoryToAgent : function(req,res){ 23 | const agentId = req.query.agentid; 24 | const storydata = new stories(req.body); 25 | storydata.save((err,result)=>{ 26 | if(err) res.send(err); 27 | else{ 28 | const storyid = result._id; 29 | Ajent.findOne({_id: agentId}) 30 | .exec((err,agentdata)=>{ 31 | if(err) res.send(err); 32 | else{ 33 | agentdata.stories = agentdata.stories.concat([storyid]); 34 | //agentdata.stories.push(storyid); 35 | agentdata.save((err,response)=>{ 36 | if(err) res.send(err); 37 | else { 38 | res.send(response); 39 | } 40 | }) 41 | } 42 | }) 43 | } 44 | }) 45 | }, 46 | deleteStory: function(req,res){ 47 | var options = {} 48 | if(req.query.id){ 49 | options._id = mongoose.Types.ObjectId(req.query.id); 50 | } 51 | stories.findOneAndRemove(options) 52 | .exec((err,results)=>{ 53 | if(err) res.send(err); 54 | else res.send(results); 55 | }) 56 | }, 57 | updateStories: function(req,res){ 58 | var options = {} 59 | options._id = mongoose.Types.ObjectId(req.body._id); 60 | const data = req.body 61 | const agentid = mongoose.Types.ObjectId(req.query.agentid); 62 | stories.findOneAndUpdate(options,data) 63 | .exec((err,results)=>{ 64 | if(err) res.send(err); 65 | else { 66 | Ajent.findByIdAndUpdate({_id:agentid},{status:'created'}) 67 | .exec((error,results)=>{ 68 | if(error) res.send({status : 'error',error : error}); 69 | else{ 70 | res.send({status:'success',data:results}); 71 | } 72 | }) 73 | } 74 | }) 75 | }, 76 | getStorybyId : function(req,res){ 77 | const storyid = mongoose.Types.ObjectId(req.query.id); 78 | stories.findOne({_id:storyid}) 79 | .exec((err,response)=>{ 80 | if(err) res.send(err); 81 | else res.send(response); 82 | }) 83 | }, 84 | createEntity : function(req,res){ 85 | var agentid = mongoose.Types.ObjectId(req.query.agentid); 86 | var newEntity = req.body; 87 | Ajent.findOne({_id:agentid}) 88 | .exec((err,response)=>{ 89 | if(err) res.send(err); 90 | else{ 91 | var agentdata = response; 92 | var exists = false; 93 | agentdata.entities.forEach(function(ent){ 94 | if(ent.name == newEntity.name){ 95 | exists = true; 96 | } 97 | }) 98 | 99 | if(exists){ 100 | res.send({status:'Entity Already Exists'}) 101 | }else{ 102 | agentdata.entities = agentdata.entities.concat([newEntity]); 103 | //agentdata.entities.push(newEntity); 104 | agentdata.save((err,result)=>{ 105 | if(err) res.send(err); 106 | else{ 107 | res.send({status: 'success', data:result}) 108 | } 109 | }) 110 | } 111 | } 112 | }) 113 | }, 114 | updateEntity : function(req,res){ 115 | var agentid = mongoose.Types.ObjectId(req.query.id); 116 | var entity = req.body; 117 | Ajent.findOne({_id:agentid}) 118 | .exec((err,response)=>{ 119 | if(err) res.send(err); 120 | else{ 121 | var agentdata = response; 122 | var entityindex; 123 | agentdata.entities.forEach(function(val,index){ 124 | if(val._id == entity._id){ 125 | entityindex = index; 126 | } 127 | }) 128 | if(entityindex || entityindex ==0){ 129 | agentdata.entities[entityindex].name = entity.name; 130 | } 131 | 132 | agentdata.save((err,result)=>{ 133 | if(err) res.send(err); 134 | else{ 135 | res.send({status: 'success', data:result}) 136 | } 137 | }) 138 | } 139 | }) 140 | }, 141 | deleteEntity : function(req,res){ 142 | var agentid = mongoose.Types.ObjectId(req.query.agentid); 143 | var entityId = req.query.entityid; 144 | Ajent.findOne({_id:agentid}) 145 | .exec((err,response)=>{ 146 | if(err) res.send(err); 147 | else{ 148 | var agentdata = response; 149 | var entityindex; 150 | agentdata.entities.forEach(function(val,index){ 151 | if(val._id == entityId){ 152 | entityindex = index; 153 | } 154 | }) 155 | if(entityindex || entityindex ==0) 156 | agentdata.entities.splice(entityindex,1); 157 | agentdata.save((err,result)=>{ 158 | if(err) res.send(err); 159 | else{ 160 | res.send({status: 'success', data:result}) 161 | } 162 | }) 163 | } 164 | }) 165 | } 166 | }; 167 | 168 | 169 | router.get('/', storiesroutes.getStorieslist); 170 | router.get('/intents', storiesroutes.getStorybyId); 171 | router.post('/', storiesroutes.createStoryToAgent); 172 | router.post('/newentity', storiesroutes.createEntity); 173 | router.put('/', storiesroutes.updateStories); 174 | router.put('/entity', storiesroutes.updateEntity); 175 | router.delete('/', storiesroutes.deleteStory); 176 | router.delete('/entity', storiesroutes.deleteEntity); 177 | 178 | return router; 179 | 180 | } -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var express = require('express'); 4 | var bodyParser = require('body-parser'); 5 | var path = require('path'); 6 | var fs = require("fs"); 7 | var http = require('http'); 8 | 9 | var config = require("./lib/configuration").getconfig(); 10 | var Mongoose = require('./lib/mongooseConnect').initialize(); 11 | 12 | var app = express() 13 | var server = http.createServer(app); 14 | 15 | var timeout = require('connect-timeout'); //express v4 16 | app.use(timeout(120000)); 17 | 18 | app.use(bodyParser.json()); 19 | app.use(bodyParser.urlencoded({ extended: false })); 20 | app.use(require('./lib/cors')); 21 | 22 | app.use(require('./lib/auth')); 23 | 24 | 25 | app.use(function(req, res, next){ 26 | res.setTimeout(480000, function(){ // 4 minute timeout adjust for larger uploads 27 | console.log('Request has timed out.'); 28 | res.send(408); 29 | }); 30 | next(); 31 | }); 32 | 33 | // Start the server 34 | 35 | 36 | 37 | var routePath = "./routes/"; //add one folder then put your route files there my router folder name is routers 38 | fs.readdirSync(routePath).forEach(function (file) { 39 | if (file != ".DS_Store") { 40 | var route = "/api/"+config.service.apiversion + "/" + file.split(".")[0]; 41 | var routeDef = require("./routes/" + file)(express, Mongoose); 42 | app.use(route, routeDef); 43 | console.log("Route Enabled: " + route); 44 | } 45 | }); 46 | 47 | // static webserver 48 | app.use('/',express.static(__dirname + '/chatbot_ui')); 49 | 50 | 51 | app.all("/*", function(req, res, next) { 52 | res.sendFile("index.html", { root: __dirname + "/client/app" }); 53 | }); 54 | 55 | 56 | // If no route is matched by now, it must be a 404 57 | app.use(function(req, res, next) { 58 | console.log("route not found") 59 | next(); 60 | }); 61 | 62 | 63 | app.get('/', function (req, res) { 64 | res.send('Hello World!') 65 | }); 66 | 67 | 68 | app.set('port', config.service.port || 9090); 69 | 70 | server.listen(app.get('port'),'0.0.0.0', function () { 71 | console.log('Server listening at port %d',app.get('port')); 72 | }); 73 | 74 | --------------------------------------------------------------------------------