Basit Anwer commited on
Commit ·
046f158
1
Parent(s): 11dd288
Moved back to Spacy with fallback threshold at 0.8
Browse files- .gitignore +4 -1
- Dockerfile +1 -1
- actions/actions.py +1 -4
- config.yml +6 -6
- data/nlu.yml +2 -21
- data/rules.yml +0 -7
- domain.yml +0 -2
.gitignore
CHANGED
|
@@ -1,4 +1,7 @@
|
|
| 1 |
*.tar.gz
|
| 2 |
*.pyc
|
| 3 |
results/
|
| 4 |
-
models/
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
*.tar.gz
|
| 2 |
*.pyc
|
| 3 |
results/
|
| 4 |
+
models/
|
| 5 |
+
.cache/
|
| 6 |
+
.config/
|
| 7 |
+
.keras
|
Dockerfile
CHANGED
|
@@ -7,7 +7,7 @@
|
|
| 7 |
# Build:
|
| 8 |
# docker build . -t zir-ai:rasa
|
| 9 |
|
| 10 |
-
FROM rasa/rasa:2.7.1-
|
| 11 |
|
| 12 |
USER root
|
| 13 |
|
|
|
|
| 7 |
# Build:
|
| 8 |
# docker build . -t zir-ai:rasa
|
| 9 |
|
| 10 |
+
FROM rasa/rasa:2.7.1-spacy-en
|
| 11 |
|
| 12 |
USER root
|
| 13 |
|
actions/actions.py
CHANGED
|
@@ -64,12 +64,9 @@ class ActionDefaultFallback(Action):
|
|
| 64 |
first_resp = parsed["responseSet"][0]["response"][0]
|
| 65 |
last_resp = parsed["responseSet"][0]["response"][-1]
|
| 66 |
textQuery = []
|
| 67 |
-
print(last_resp["score"])
|
| 68 |
-
print(first_resp["score"])
|
| 69 |
if last_resp["score"] < 0.3 or first_resp["score"] < 0.3:
|
| 70 |
-
print(f"Scores; {last_resp['score']} and {first_resp['score']}")
|
| 71 |
textQuery.append(
|
| 72 |
-
|
| 73 |
else:
|
| 74 |
textQuery = print_responses(parsed["responseSet"][0], self.cur)
|
| 75 |
textQuery.insert(0, "\n")
|
|
|
|
| 64 |
first_resp = parsed["responseSet"][0]["response"][0]
|
| 65 |
last_resp = parsed["responseSet"][0]["response"][-1]
|
| 66 |
textQuery = []
|
|
|
|
|
|
|
| 67 |
if last_resp["score"] < 0.3 or first_resp["score"] < 0.3:
|
|
|
|
| 68 |
textQuery.append(
|
| 69 |
+
"I'm sorry, I don't have any information about that.")
|
| 70 |
else:
|
| 71 |
textQuery = print_responses(parsed["responseSet"][0], self.cur)
|
| 72 |
textQuery.insert(0, "\n")
|
config.yml
CHANGED
|
@@ -3,11 +3,11 @@
|
|
| 3 |
language: en
|
| 4 |
|
| 5 |
pipeline:
|
| 6 |
-
- name:
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
- name:
|
| 10 |
-
|
| 11 |
- name: RegexFeaturizer
|
| 12 |
- name: LexicalSyntacticFeaturizer
|
| 13 |
- name: CountVectorsFeaturizer
|
|
@@ -21,7 +21,7 @@ pipeline:
|
|
| 21 |
- name: ResponseSelector
|
| 22 |
epochs: 100
|
| 23 |
- name: FallbackClassifier
|
| 24 |
-
threshold: 0.
|
| 25 |
ambiguity_threshold: 0.1
|
| 26 |
|
| 27 |
# Configuration for Rasa Core.
|
|
|
|
| 3 |
language: en
|
| 4 |
|
| 5 |
pipeline:
|
| 6 |
+
- name: SpacyNLP
|
| 7 |
+
model: "en_core_web_md"
|
| 8 |
+
case_sensitive: False
|
| 9 |
+
- name: SpacyTokenizer
|
| 10 |
+
- name: SpacyFeaturizer
|
| 11 |
- name: RegexFeaturizer
|
| 12 |
- name: LexicalSyntacticFeaturizer
|
| 13 |
- name: CountVectorsFeaturizer
|
|
|
|
| 21 |
- name: ResponseSelector
|
| 22 |
epochs: 100
|
| 23 |
- name: FallbackClassifier
|
| 24 |
+
threshold: 0.8
|
| 25 |
ambiguity_threshold: 0.1
|
| 26 |
|
| 27 |
# Configuration for Rasa Core.
|
data/nlu.yml
CHANGED
|
@@ -37,25 +37,6 @@ nlu:
|
|
| 37 |
- bye bye
|
| 38 |
- see you later
|
| 39 |
|
| 40 |
-
- intent: affirm
|
| 41 |
-
examples: |
|
| 42 |
-
- yes
|
| 43 |
-
- y
|
| 44 |
-
- indeed
|
| 45 |
-
- of course
|
| 46 |
-
- that sounds good
|
| 47 |
-
- correct
|
| 48 |
-
|
| 49 |
-
- intent: deny
|
| 50 |
-
examples: |
|
| 51 |
-
- no
|
| 52 |
-
- n
|
| 53 |
-
- never
|
| 54 |
-
- I don't think so
|
| 55 |
-
- don't like that
|
| 56 |
-
- no way
|
| 57 |
-
- not really
|
| 58 |
-
|
| 59 |
- intent: booking_1
|
| 60 |
examples: |
|
| 61 |
- Do I need to pay a security deposit at Atlantis Dubai?
|
|
@@ -601,7 +582,7 @@ nlu:
|
|
| 601 |
- How much does it take for it all in Aquaventure Waterpark?
|
| 602 |
- How long can I normally expect a visit to every ride?
|
| 603 |
- How Long It Would Take to go on every ride?
|
| 604 |
-
- How long will it take to visit the rides and attractions?
|
| 605 |
- How long does it take to go down the slides?
|
| 606 |
- How many riders can go on at a time?
|
| 607 |
- What rides can I go on if I am Pregnant?
|
|
@@ -628,7 +609,7 @@ nlu:
|
|
| 628 |
- If I bring my nanny, do I need to pay for them too
|
| 629 |
- Can i bring a nanny in Aquaventure Waterpark?
|
| 630 |
- Does aduaventure has Babysitting services?
|
| 631 |
-
- Is it any day care centre or some nani service available in Aquaventure park?
|
| 632 |
- Can you avail of the Nanny services at aquaventurepark?
|
| 633 |
- intent: aqua_13
|
| 634 |
examples: |
|
|
|
|
| 37 |
- bye bye
|
| 38 |
- see you later
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
- intent: booking_1
|
| 41 |
examples: |
|
| 42 |
- Do I need to pay a security deposit at Atlantis Dubai?
|
|
|
|
| 582 |
- How much does it take for it all in Aquaventure Waterpark?
|
| 583 |
- How long can I normally expect a visit to every ride?
|
| 584 |
- How Long It Would Take to go on every ride?
|
| 585 |
+
- How long will it take to visit the rides and attractions?
|
| 586 |
- How long does it take to go down the slides?
|
| 587 |
- How many riders can go on at a time?
|
| 588 |
- What rides can I go on if I am Pregnant?
|
|
|
|
| 609 |
- If I bring my nanny, do I need to pay for them too
|
| 610 |
- Can i bring a nanny in Aquaventure Waterpark?
|
| 611 |
- Does aduaventure has Babysitting services?
|
| 612 |
+
- Is it any day care centre or some nani service available in Aquaventure park?
|
| 613 |
- Can you avail of the Nanny services at aquaventurepark?
|
| 614 |
- intent: aqua_13
|
| 615 |
examples: |
|
data/rules.yml
CHANGED
|
@@ -173,7 +173,6 @@ rules:
|
|
| 173 |
steps:
|
| 174 |
- intent: visit_21
|
| 175 |
- action: utter_visit_21
|
| 176 |
-
|
| 177 |
- rule: restaurant_1
|
| 178 |
steps:
|
| 179 |
- intent: restaurant_1
|
|
@@ -294,7 +293,6 @@ rules:
|
|
| 294 |
steps:
|
| 295 |
- intent: restaurant_30
|
| 296 |
- action: utter_restaurant_30
|
| 297 |
-
|
| 298 |
- rule: dolphin_1
|
| 299 |
steps:
|
| 300 |
- intent: dolphin_1
|
|
@@ -347,7 +345,6 @@ rules:
|
|
| 347 |
steps:
|
| 348 |
- intent: dolphin_13
|
| 349 |
- action: utter_dolphin_13
|
| 350 |
-
|
| 351 |
- rule: aqua_1
|
| 352 |
steps:
|
| 353 |
- intent: aqua_1
|
|
@@ -412,7 +409,6 @@ rules:
|
|
| 412 |
steps:
|
| 413 |
- intent: aqua_16
|
| 414 |
- action: utter_aqua_16
|
| 415 |
-
|
| 416 |
- rule: kids_1
|
| 417 |
steps:
|
| 418 |
- intent: kids_1
|
|
@@ -505,7 +501,6 @@ rules:
|
|
| 505 |
steps:
|
| 506 |
- intent: kids_23
|
| 507 |
- action: utter_kids_23
|
| 508 |
-
|
| 509 |
- rule: spa_1
|
| 510 |
steps:
|
| 511 |
- intent: spa_1
|
|
@@ -514,7 +509,6 @@ rules:
|
|
| 514 |
steps:
|
| 515 |
- intent: spa_2
|
| 516 |
- action: utter_spa_2
|
| 517 |
-
|
| 518 |
- rule: pool_1
|
| 519 |
steps:
|
| 520 |
- intent: pool_1
|
|
@@ -527,7 +521,6 @@ rules:
|
|
| 527 |
steps:
|
| 528 |
- intent: pool_3
|
| 529 |
- action: utter_pool_3
|
| 530 |
-
|
| 531 |
- rule: retail_1
|
| 532 |
steps:
|
| 533 |
- intent: retail_1
|
|
|
|
| 173 |
steps:
|
| 174 |
- intent: visit_21
|
| 175 |
- action: utter_visit_21
|
|
|
|
| 176 |
- rule: restaurant_1
|
| 177 |
steps:
|
| 178 |
- intent: restaurant_1
|
|
|
|
| 293 |
steps:
|
| 294 |
- intent: restaurant_30
|
| 295 |
- action: utter_restaurant_30
|
|
|
|
| 296 |
- rule: dolphin_1
|
| 297 |
steps:
|
| 298 |
- intent: dolphin_1
|
|
|
|
| 345 |
steps:
|
| 346 |
- intent: dolphin_13
|
| 347 |
- action: utter_dolphin_13
|
|
|
|
| 348 |
- rule: aqua_1
|
| 349 |
steps:
|
| 350 |
- intent: aqua_1
|
|
|
|
| 409 |
steps:
|
| 410 |
- intent: aqua_16
|
| 411 |
- action: utter_aqua_16
|
|
|
|
| 412 |
- rule: kids_1
|
| 413 |
steps:
|
| 414 |
- intent: kids_1
|
|
|
|
| 501 |
steps:
|
| 502 |
- intent: kids_23
|
| 503 |
- action: utter_kids_23
|
|
|
|
| 504 |
- rule: spa_1
|
| 505 |
steps:
|
| 506 |
- intent: spa_1
|
|
|
|
| 509 |
steps:
|
| 510 |
- intent: spa_2
|
| 511 |
- action: utter_spa_2
|
|
|
|
| 512 |
- rule: pool_1
|
| 513 |
steps:
|
| 514 |
- intent: pool_1
|
|
|
|
| 521 |
steps:
|
| 522 |
- intent: pool_3
|
| 523 |
- action: utter_pool_3
|
|
|
|
| 524 |
- rule: retail_1
|
| 525 |
steps:
|
| 526 |
- intent: retail_1
|
domain.yml
CHANGED
|
@@ -6,8 +6,6 @@ version: "2.0"
|
|
| 6 |
intents:
|
| 7 |
- greet
|
| 8 |
- goodbye
|
| 9 |
-
- affirm
|
| 10 |
-
- deny
|
| 11 |
- booking_1
|
| 12 |
- booking_2
|
| 13 |
- booking_3
|
|
|
|
| 6 |
intents:
|
| 7 |
- greet
|
| 8 |
- goodbye
|
|
|
|
|
|
|
| 9 |
- booking_1
|
| 10 |
- booking_2
|
| 11 |
- booking_3
|