Commit
·
b45d46c
1
Parent(s):
ecb4b0a
switch to rasa 2x
Browse files- rasa-assistant-2/actions/__init__.py +0 -0
- rasa-assistant-2/actions/actions.py +27 -0
- rasa-assistant-2/config.yml +26 -0
- rasa-assistant-2/credentials.yml +6 -0
- rasa-assistant-2/data/nlu.yml +92 -0
- rasa-assistant-2/data/rules.yml +13 -0
- rasa-assistant-2/data/stories.yml +30 -0
- rasa-assistant-2/domain.yml +34 -0
- rasa-assistant-2/endpoints.yml +9 -0
rasa-assistant-2/actions/__init__.py
ADDED
File without changes
|
rasa-assistant-2/actions/actions.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This files contains your custom actions which can be used to run
|
2 |
+
# custom Python code.
|
3 |
+
#
|
4 |
+
# See this guide on how to implement these action:
|
5 |
+
# https://rasa.com/docs/rasa/custom-actions
|
6 |
+
|
7 |
+
|
8 |
+
# This is a simple example for a custom action which utters "Hello World!"
|
9 |
+
|
10 |
+
# from typing import Any, Text, Dict, List
|
11 |
+
#
|
12 |
+
# from rasa_sdk import Action, Tracker
|
13 |
+
# from rasa_sdk.executor import CollectingDispatcher
|
14 |
+
#
|
15 |
+
#
|
16 |
+
# class ActionHelloWorld(Action):
|
17 |
+
#
|
18 |
+
# def name(self) -> Text:
|
19 |
+
# return "action_hello_world"
|
20 |
+
#
|
21 |
+
# def run(self, dispatcher: CollectingDispatcher,
|
22 |
+
# tracker: Tracker,
|
23 |
+
# domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
|
24 |
+
#
|
25 |
+
# dispatcher.utter_message(text="Hello World!")
|
26 |
+
#
|
27 |
+
# return []
|
rasa-assistant-2/config.yml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
language: en
|
2 |
+
|
3 |
+
pipeline:
|
4 |
+
- name: WhitespaceTokenizer
|
5 |
+
- name: RegexFeaturizer
|
6 |
+
- name: LexicalSyntacticFeaturizer
|
7 |
+
- name: CountVectorsFeaturizer
|
8 |
+
- name: CountVectorsFeaturizer
|
9 |
+
analyzer: char_wb
|
10 |
+
min_ngram: 1
|
11 |
+
max_ngram: 4
|
12 |
+
- name: DIETClassifier
|
13 |
+
epochs: 100
|
14 |
+
- name: EntitySynonymMapper
|
15 |
+
- name: ResponseSelector
|
16 |
+
epochs: 100
|
17 |
+
- name: FallbackClassifier
|
18 |
+
threshold: 0.3
|
19 |
+
ambiguity_threshold: 0.1
|
20 |
+
|
21 |
+
policies:
|
22 |
+
- name: MemoizationPolicy
|
23 |
+
- name: TEDPolicy
|
24 |
+
max_history: 5
|
25 |
+
epochs: 100
|
26 |
+
- name: RulePolicy
|
rasa-assistant-2/credentials.yml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
rest:
|
2 |
+
|
3 |
+
socketio:
|
4 |
+
user_message_evt: user_uttered
|
5 |
+
bot_message_evt: bot_uttered
|
6 |
+
session_persistence: true
|
rasa-assistant-2/data/nlu.yml
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: "2.0"
|
2 |
+
|
3 |
+
nlu:
|
4 |
+
- intent: greet
|
5 |
+
examples: |
|
6 |
+
- hey
|
7 |
+
- hello
|
8 |
+
- hi
|
9 |
+
- hello there
|
10 |
+
- good morning
|
11 |
+
- good evening
|
12 |
+
- moin
|
13 |
+
- hey there
|
14 |
+
- let's go
|
15 |
+
- hey dude
|
16 |
+
- goodmorning
|
17 |
+
- goodevening
|
18 |
+
- good afternoon
|
19 |
+
|
20 |
+
- intent: goodbye
|
21 |
+
examples: |
|
22 |
+
- good afternoon
|
23 |
+
- cu
|
24 |
+
- good by
|
25 |
+
- cee you later
|
26 |
+
- good night
|
27 |
+
- bye
|
28 |
+
- goodbye
|
29 |
+
- have a nice day
|
30 |
+
- see you around
|
31 |
+
- bye bye
|
32 |
+
- see you later
|
33 |
+
|
34 |
+
- intent: affirm
|
35 |
+
examples: |
|
36 |
+
- yes
|
37 |
+
- y
|
38 |
+
- indeed
|
39 |
+
- of course
|
40 |
+
- that sounds good
|
41 |
+
- correct
|
42 |
+
|
43 |
+
- intent: deny
|
44 |
+
examples: |
|
45 |
+
- no
|
46 |
+
- n
|
47 |
+
- never
|
48 |
+
- I don't think so
|
49 |
+
- don't like that
|
50 |
+
- no way
|
51 |
+
- not really
|
52 |
+
|
53 |
+
- intent: mood_great
|
54 |
+
examples: |
|
55 |
+
- perfect
|
56 |
+
- great
|
57 |
+
- amazing
|
58 |
+
- feeling like a king
|
59 |
+
- wonderful
|
60 |
+
- I am feeling very good
|
61 |
+
- I am great
|
62 |
+
- I am amazing
|
63 |
+
- I am going to save the world
|
64 |
+
- super stoked
|
65 |
+
- extremely good
|
66 |
+
- so so perfect
|
67 |
+
- so good
|
68 |
+
- so perfect
|
69 |
+
|
70 |
+
- intent: mood_unhappy
|
71 |
+
examples: |
|
72 |
+
- my day was horrible
|
73 |
+
- I am sad
|
74 |
+
- I don't feel very well
|
75 |
+
- I am disappointed
|
76 |
+
- super sad
|
77 |
+
- I'm so sad
|
78 |
+
- sad
|
79 |
+
- very sad
|
80 |
+
- unhappy
|
81 |
+
- not good
|
82 |
+
- not very good
|
83 |
+
- extremly sad
|
84 |
+
- so saad
|
85 |
+
- so sad
|
86 |
+
|
87 |
+
- intent: bot_challenge
|
88 |
+
examples: |
|
89 |
+
- are you a bot?
|
90 |
+
- are you a human?
|
91 |
+
- am I talking to a bot?
|
92 |
+
- am I talking to a human?
|
rasa-assistant-2/data/rules.yml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: "2.0"
|
2 |
+
|
3 |
+
rules:
|
4 |
+
|
5 |
+
- rule: Say goodbye anytime the user says goodbye
|
6 |
+
steps:
|
7 |
+
- intent: goodbye
|
8 |
+
- action: utter_goodbye
|
9 |
+
|
10 |
+
- rule: Say 'I am a bot' anytime the user challenges
|
11 |
+
steps:
|
12 |
+
- intent: bot_challenge
|
13 |
+
- action: utter_iamabot
|
rasa-assistant-2/data/stories.yml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: "2.0"
|
2 |
+
|
3 |
+
stories:
|
4 |
+
|
5 |
+
- story: happy path
|
6 |
+
steps:
|
7 |
+
- intent: greet
|
8 |
+
- action: utter_greet
|
9 |
+
- intent: mood_great
|
10 |
+
- action: utter_happy
|
11 |
+
|
12 |
+
- story: sad path 1
|
13 |
+
steps:
|
14 |
+
- intent: greet
|
15 |
+
- action: utter_greet
|
16 |
+
- intent: mood_unhappy
|
17 |
+
- action: utter_cheer_up
|
18 |
+
- action: utter_did_that_help
|
19 |
+
- intent: affirm
|
20 |
+
- action: utter_happy
|
21 |
+
|
22 |
+
- story: sad path 2
|
23 |
+
steps:
|
24 |
+
- intent: greet
|
25 |
+
- action: utter_greet
|
26 |
+
- intent: mood_unhappy
|
27 |
+
- action: utter_cheer_up
|
28 |
+
- action: utter_did_that_help
|
29 |
+
- intent: deny
|
30 |
+
- action: utter_goodbye
|
rasa-assistant-2/domain.yml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: "2.0"
|
2 |
+
|
3 |
+
intents:
|
4 |
+
- greet
|
5 |
+
- goodbye
|
6 |
+
- affirm
|
7 |
+
- deny
|
8 |
+
- mood_great
|
9 |
+
- mood_unhappy
|
10 |
+
- bot_challenge
|
11 |
+
|
12 |
+
responses:
|
13 |
+
utter_greet:
|
14 |
+
- text: "Hey! How are you?"
|
15 |
+
|
16 |
+
utter_cheer_up:
|
17 |
+
- text: "Here is something to cheer you up:"
|
18 |
+
image: "https://i.imgur.com/nGF1K8f.jpg"
|
19 |
+
|
20 |
+
utter_did_that_help:
|
21 |
+
- text: "Did that help you?"
|
22 |
+
|
23 |
+
utter_happy:
|
24 |
+
- text: "Great, carry on!"
|
25 |
+
|
26 |
+
utter_goodbye:
|
27 |
+
- text: "Bye"
|
28 |
+
|
29 |
+
utter_iamabot:
|
30 |
+
- text: "I am a bot, powered by Rasa."
|
31 |
+
|
32 |
+
session_config:
|
33 |
+
session_expiration_time: 60
|
34 |
+
carry_over_slots_to_new_session: true
|
rasa-assistant-2/endpoints.yml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
action_endpoint:
|
2 |
+
url: "http://localhost:5055/webhook"
|
3 |
+
|
4 |
+
#tracker_store:
|
5 |
+
# type: mongod
|
6 |
+
# url: <url to your mongo instance, e.g. mongodb://localhost:27017>
|
7 |
+
# db: <name of the db within your mongo instance, e.g. rasa>
|
8 |
+
# username: <username used for authentication>
|
9 |
+
# password: <password used for authentication>
|