Skip to content

Commit

Permalink
working skeleton bot
Browse files Browse the repository at this point in the history
  • Loading branch information
pinsleepe committed May 22, 2020
1 parent a1f6bb2 commit e2404b5
Show file tree
Hide file tree
Showing 9 changed files with 672 additions and 0 deletions.
Empty file added __init__.py
Empty file.
62 changes: 62 additions & 0 deletions actions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This files contains your custom actions which can be used to run
# custom Python code.
#
# See this guide on how to implement these action:
# https://rasa.com/docs/rasa/core/actions/#custom-actions/


# This is a simple example for a custom action which utters "Hello World!"

from typing import Dict, Text, Any, List, Union
from rasa_sdk import Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.forms import FormAction


class HealthCheckForm(FormAction):
"""HealthCheck form action"""

def name(self) -> Text:
"""Unique identifier of the form"""

return "healthcheck_form"

@staticmethod
def required_slots(tracker: Tracker) -> List[Text]:
"""A list of required slots that the form has to fill"""

return ["province", "age", "cough", "exposure", "tracing"]

def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
return {
"province": [
self.from_text(),
],
"age": [
self.from_text(),
],

"cough": [
self.from_text(),
],
"exposure": [
self.from_text(),
],
"tracing": [
self.from_text(),
]
}

def submit(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[Dict]:
"""Define what the form has to do
after all required slots are filled"""

# utter submit template
dispatcher.utter_message(template="utter_submit")
return []

27 changes: 27 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: en
pipeline:
- name: WhitespaceTokenizer
- name: RegexFeaturizer
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer
- name: CountVectorsFeaturizer
analyzer: "char_wb"
min_ngram: 1
max_ngram: 4
- name: DIETClassifier
epochs: 100
- name: EntitySynonymMapper
- name: ResponseSelector
epochs: 100

# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
- name: MemoizationPolicy
- name: TEDPolicy
max_history: 5
epochs: 100
- name: MappingPolicy
- name: FormPolicy
32 changes: 32 additions & 0 deletions credentials.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This file contains the credentials for the voice & chat platforms
# which your bot is using.
# https://rasa.com/docs/rasa/user-guide/messaging-and-voice-channels/

rest:
# # you don't need to provide anything here - this channel doesn't
# # require any credentials


#facebook:
# verify: "<verify>"
# secret: "<your secret>"
# page-access-token: "<your page access token>"

#slack:
# slack_token: "<your slack token>"
# slack_channel: "<the slack channel>"

#socketio:
# user_message_evt: <event name for user message>
# bot_message_evt: <event name for but messages>
# session_persistence: <true/false>

#mattermost:
# url: "https://<mattermost instance>/api/v4"
# token: "<bot token>"
# webhook_url: "<callback URL>"

# This entry is needed if you are using Rasa X. The entry represents credentials
# for the Rasa X "channel", i.e. Talk to your bot and Share with guest testers.
rasa:
url: "http://localhost:5002/api"
171 changes: 171 additions & 0 deletions data/nlu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
## intent:greet
- Hi
- Hey
- Hi bot
- Hey bot
- Hello
- Good morning
- hi again
- hi folks
- hi Mister
- hi pal!
- hi there
- greetings
- hello everybody
- hello is anybody there
- hello robot
- hallo
- heeey
- hi hi
- hey
- hey hey
- hello there
- hi
- hello
- yo
- hola
- hi?
- hey bot!
- hello friend

## intent:request_healthcheck
- Hi! I want to do health check for myself
- I want to do a test for myself
- Test
- Healthcheck
- Health check
- Please check if I have covid
- Please check if I'm sick
- Please check if I have to get tested
- I want to get tested
- Please test
- Test me
- Do I have the virus?
- Do I need to get tested?
- Check my symptoms
- I have a fever! Do I have covid?

## intent:affirm
- yeah a cheap restaurant serving international food
- correct
- ye
- uh yes
- let's do it
- yeah
- uh yes
- um yes
- yes knocking
- that's correct
- yes yes
- right
- yea
- yes
- yes right
- yes and i dont care
- right on
- i love that

## intent:deny
- no
- no new selection
- no thanks
- no thank you
- uh no
- breath no
- do you have something else
- no this does not work for me

## intent:thankyou
- um thank you good bye
- okay cool uh good bye thank you
- okay thank you good bye
- you rock
- and thats all thank you and good bye
- thank you and good bye
- sorry about my mistakes thank you good bye
- noise thank you good bye
- thank you goodbye noise
- okay thank you goodbye
- uh thank you good bye
- thank you goodbye
- thank you goodbye noise thank you goodbye
- breath thank you goodbye
- thank you
- okay thank you
- thanks goodbye
- ah thank you goodbye
- thank you noise
- thank you good bye
- breath thank you very much goodbye
- thanks
- noise thank you goodbye
- unintelligible thank you goodbye
- uh okay thank you good bye
- thank you bye
- um okay thank you good bye

## intent:chitchat
- can you share your boss with me?
- i want to get to know your owner
- i want to know the company which designed you
- i want to know the company which generated you
- i want to know the company which invented you
- i want to know who invented you
- May I ask who invented you?
- please tell me the company who created you
- please tell me who created you
- tell me more about your creators
- tell me more about your founders
- Ahoy matey how are you?
- are you alright
- are you having a good day
- Are you ok?
- are you okay
- Do you feel good?
- how are things going
- how are things with you?
- How are things?
- how are you
- how are you doing
- how are you doing this morning
- how are you feeling
- how are you today
- How are you?
- How is the weather today?
- What's the weather like?
- How is the weather?
- What is the weather at your place?
- Do you have good weather?
- Is it raining?
- What's it like out there?
- Is it hot or cold?
- Beautiful day, isn't it?
- What's the weather forecast?
- Is it quite breezy outside?

## intent:stop
- ok then you cant help me
- that was shit, you're not helping
- you can't help me
- you can't help me with what i need
- i guess you can't help me then
- ok i guess you can't help me
- that's not what i want
- ok, but that doesnt help me
- this is leading to nothing
- this conversation is not really helpful
- you cannot help me with what I want
- I think you cant help me
- hm i don't think you can do what i want
- stop
- stop go back
- do you get anything?
- and you call yourself bot company? pff
- and that's it?
- nothing else?

## intent:bot_challenge
- are you a bot?
- are you a human?
- am I talking to a bot?
- am I talking to a human?
Loading

0 comments on commit e2404b5

Please sign in to comment.