Skip to content

knightfall/UTS-RP19-OSHC_CHATBOT

Repository files navigation

OSHC Chatbot using Dialogflow

RASA Version: OSHC_Chatbot-Rasa

Deliverable of UTS 32933 Research Project Autumn 2019

supervisor: Dr. Wei Liu

Group 37

What is it

Overseas Student Health Cover is the health insurance which allmost all of the international students in Australia have to purchase before applying for student visa. This chatbot intends to educate current and prospective international students in Australia about their OSHC cover, who are the providers and how much do they cost.

Demo

To see the working demo, click on the links

Prerequisites

Cronjob, ScheduleParser and the webhook is written in dotnet core 2.2

To run the chatbot, you will need to have the following

Limitations

  • Cronjob fails to run in 1core/1thread droplets in DigitalOcean, probably because of the parallel invoke.
  • ScheduleParser isn't tested in linux. You migh face the same issue as Cronjob

Installation

Step 1. Mysql

Have a Mysql instance running. You can use managed Mysql provided by different cloud provider. The demo version of the project uses Google Cloud SQL. Import the chatbot.sql either using Mysql workbench or the following command This will restore the the snapshot of the demo database.

mysql -u username -p  < chatbot.sql //schema name is mbs

if something goes wrong, use the create scripts called create.sql to create the tables for ScheduleParser and Cronjob

mysql -u username -p  < create.sql

Step 2. ScheduleParser

If you are using the mbs.sql to populate the database, you can skip this part and start from the next step.

SDK installation

  • Download & install your platform version of .Net Core sdk from (https://dotnet.microsoft.com/download)

  • Goto ScheduleParser/ScheduleParser

  • Open Program.cs

  • Replace the values of _servername, _id and _password in the method InserData with your mysql login data. if you are using the default schema, you don't need to change the value of _catalog.

Replace values

if your schedule table isn't empty, run the following command in mysql:

truncate mbs.schedule

Windows with Visual Studio installation

Run the program from ScheduleParser.sln using Visual Studio 2017/2019

For Linux and or no Visual Studio installation

In ScheduleParser/ScheduleParser folder, run in command line:

dotnet restore
dotnet run --configuration Release

ScheduleParser takes the xml file from ScheduleParser/schedule, parse it and then update it into a database.


Step 3. Cronjob

Open Cronjob/Cronjob/mbsContext.cs In method OnConfiguring(), replace xx.xx.xx.xx with your server IP, root with your mysql instance username and ****** with your password. Replace values for msyql

Windows with Visual Studio installation

Run the program from Cronjob.sln using Visual Studio 2017/2019

For Linux and or no Visual Studio installation

In Cronjob/Cronjob folder, run in command line:

dotnet restore
dotnet run --configuration Release

it will populate the oshcquote with updated premiums of that time

Step 4. Webhook

Open webhook\ChatbotAPI\EFModels\mbsContext.cs In method OnConfiguring(), replace xx.xx.xx.xx with your server IP, root with your mysql instance username and ****** with your password.

Windows with Visual Studio installation

Run the program from UTS-ChatBot-RP19.sln using Visual Studio 2017/2019

For Linux and or no Visual Studio installation

In webhook\ChatbotAPI\ folder, run in command line:

dotnet restore
dotnet run --configuration Release

If everything is alright, it will show this window. Running Webhook

In order to make the webhook work, you will have to have the running instance exposed to the internet with a public IP. The best way to do it is to run it in a cheapo linux instance. For the demo, it is running on a Google cloud compute engine


Step 5. Dialogflow

- Create a Dialogflow account

- Create a new agent

creating and agent

- Go to Export and Import tab in agent settings and click Restore from zip

restore agent

- Select the chatbot.zip file from your device, type RESTORE and click on the blue RESTORE button.

uploading and agent

- Go to fulfillment tab, replace contoso.com with the webhook server ip or domain

Replacing webhook url with a real one

Testing the bot

In the Dialogflow console, on the right in Try it now, type cost of item 23 if you have installed everything correctly, it will show: mbs item response from dflow

For quotes, try 26 months no no It should show something like this: Quote for 26 months single policy

Sample questions

  1. What is MBS?
  2. What is covered?
  3. What is OSHC
  4. Who provides OSHC
  5. Do I need OSHC
  6. Does oshc cover psychiatrist visit?
  7. Does it cover emergency
  8. Get me a quote for OSHC
  9. What is item number X // X can be any integer

Contact

If you have any queries, feel free to create an issue or contact me via the email address in my profile.

About

OSHC Chatbot created using dialogflow

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published