Skip to content

A Conversational-UI Assisted E-Coaching Platform For Healthy Lifestyle

License

Notifications You must be signed in to change notification settings

ahmedfadhil/CoachAIBot

Repository files navigation

Running in development

  • Clone the repository and access the cloned folder
git clone [email protected]:ahmedfadhil/CoachAIBot.git
cd CoachAiBot
  • If you already cloned the repo pull the changes
cd CoachAiBot
git pull
  • If you never used the system, remember to install all the dependencies and then run all migrations and seed the database.

Note that now we are using PostgreSQL, so remember to turn ON the server!

bundle install              #installs dependencies

bundle exec rake db:drop    #drops any old version of the db
bundle exec rake db:create  #creates a new db
bundle exec rake db:migrate #runs migrations
bundle exec rake db:seed    #seeds the db
  • Switch to development branch, only if the last version resides there, otherwise use master branch
git checkout development
  • Start ngrok. Ngrok will bind your localhost:3000 to a public address
cd ngrok
./ngrok http 3000
  • Now you should see something like this:
ngrok by @inconshreveable                                       (Ctrl+C to quit)
                                                                                
Session Status                online                                            
Account                       Marian Diaconu (Plan: Free)                       
Version                       2.2.8                                             
Region                        United States (us)                                
Web Interface                 http://127.0.0.1:4040                             
Forwarding                    http://d9e5ba0e.ngrok.io -> localhost:3000        
Forwarding                    https://d9e5ba0e.ngrok.io -> localhost:3000       
                                                                                
Connections                   ttl     opn     rt1     rt5     p50     p90       
                              0       0       0.00    0.00    0.00    0.00 
  • Set Telegram Bot Webhook by making a GET request like this:
curl https://api.telegram.org/bot294560170:AAFaB9cQ-hCzQEfYNr6z30gD2K7FeDZ1gVQ/setWebhook?url=${https_public_address}/webhooks/telegram_vbc43edbf1614a075954dvd4bfab34l1

But replace ${https_public_address} with your actual https public address.
In the example the https public address is: https://d9e5ba0e.ngrok.io.
And the bot token is: 294560170:AAFaB9cQ-hCzQEfYNr6z30gD2K7FeDZ1gVQ.
You can change them if you have to.

This will tell to TelegramAPI to send the user interactions with the bot @CoachAIBot, which is associated with the bot token to the https public address generated by ngrok, which binds the local Rails server.

  • If everything went well, you will receive a JSON response like this
{"ok":true,"result":true,"description":"Webhook is set"}
  • Lets start crono time-based background job scheduler daemon for Ruby on Rails. We use it for periodically tasks like sending Notifications
bundle exec crono start RAILS_ENV=development
  • Now you can start your Rails server.
rails s
  • Access http://localhost:3000/ for the Web Platform
  • Credentials for LOG IN
email:      [email protected]
password:   12345678
  • Search @CoachAIBot on Telegram

  • Note that the application is developed for Italian users and hence the language developed using a finite state machine automata was intended for Italian users only.

PhD Thesis: CONVERSATIONAL AGENT FOR HEALTH COACHING

Check the thesis here: CONVERSATIONAL AGENT FOR HEALTH COACHING

Citing CoachAI

If you find this repo useful in your research, please consider citing the following papers:

@inproceedings{fadhil2018effect,
  title={The Effect of Emojis when interacting with Conversational Interface Assisted Health Coaching System},
  author={Fadhil, Ahmed and Schiavo, Gianluca and Wang, Yunlong and Yilma, Bereket A},
  booktitle={Proceedings of the 12th EAI International Conference on Pervasive Computing Technologies for Healthcare},
  pages={378--383},
  year={2018},
  organization={ACM}
}

@article{fadhil2019assistive,
  title={Assistive Conversational Agent for Health Coaching: A Validation Study},
  author={Fadhil, Ahmed and Wang, Yunlong and Reiterer, Harald},
  journal={Methods of information in medicine},
  year={2019},
  publisher={Georg Thieme Verlag KG}
}

@article{fadhil2019coachai,
  title={CoachAI: A Conversational Agent Assisted Health Coaching Platform},
  author={Fadhil, Ahmed and Schiavo, Gianluca and Wang, Yunlong},
  journal={arXiv preprint arXiv:1904.11961},
  year={2019}
}

@article{fadhil2019designing,
  title={Designing for Health Chatbots},
  author={Fadhil, Ahmed and Schiavo, Gianluca},
  journal={arXiv preprint arXiv:1902.09022},
  year={2019}
}

@article{fadhilintelligent,
  title={Intelligent Conversational Agent Assisted Health Coaching System: The CoachAI Approach},
  author={Fadhil, Ahmed}
}

@phdthesis{jumaah2019conversational,
  title={Conversational Agent for Health Coaching},
  author={JUMAAH, Ahmed},
  year={2019},
  school={University of Trento}
}

Contributions

Contributions are welcome. Please consider using the steps below to contribute to the project.

  • Fork the project & clone locally.
  • Create an upstream remote and sync your local copy before you branch.
  • Branch for each separate piece of work.
  • Do the work, write good commit messages, and read the CONTRIBUTING file if there is one.
  • Push to your origin repository.
  • Create a new PR in GitHub.