This is a final undergraduate (level 4) project by Matej Babis.
Languages: Python, Javascript & HTML
Webhook: https://projecteli.ngrok.io/
- Spotify Client ID:
N/A
(edited) - Dialogflow Client ID:
N/A
(edited) - ngrok Pro token:
N/A
(edited)
- GPy
- SciPy, NumPy, matplotlib
- Flask
- ngrok
- Dialogflow API requires a webhook to be connected to. By running a Flask Python app on localhost, we can tunnel the domain onto a local machine.
- In order to simplify the installation process, a Pro version of ngrok has been purchased.
- Add ngrok to the project directory.
- Add the paid token:
./ngrok authtoken TOKEN
.
After installing the dependencies, do the following:
- Add the following function to
{YOUR_PYTHON_ROOT}/Lib/site-packages/GPy/core/gp.py
:
def predict_f(self, _Xnew, full_cov=False, kern=None):
mu, var = self._raw_predict(_Xnew, full_cov=full_cov, kern=kern)
return mu, var
- Add the following line to
/Lib/site-packages/GPy/kern/__init__.py
:
from .src.pjk import PjkRbf
- Copy the
pjk.py
file into/Lib/site-packages/GPy/kern/src/
.- This is the custom covariance function.
> python app.py
> ./ngrok http -subdomain=projecteli 5000
Now you can access https://projecteli.ngrok.io/.
Alternatively, you can run the model in a shell without a front-end by executing:
> python offline.py
- Occasinally no response is produced for a command.
- Response is sent from the server, so possibly a Javascript issue.
- Mitigation: Use the command again.