Giter Site home page Giter Site logo

ice-cream-truck's Introduction

Ice Cream Truck bot

This chatbot allows you to place an order of Ice Cream in a Random Access Navigation way, using a Memory Neural Network.

Entry for machine learning tutorial How to Make a Chatbot - Intro to Deep Learning #12

Dependencies

  • python 3
  • tensorflow
  • keras
  • h5py (For saving and loading the model)
  • requests (For Telegram support)

Running

To run the command line interface, just type: python chatbot.py The bot will use the included pre trained model, if you want to train your own remove the file model.hdf5

CLI interface

Interaction example:

>add chocolate
>change chocolate for cherry
>add coffee
>done


Your order: cherry, coffee 🍦

Telegram interface

In order to use a Telegram bot as your interface:

  • Install Telegram
  • Add BotFather to your contancts: https://t.me/BotFather
  • Use the /newbot command and follow the instructions
  • On the code duplicate the file sample_config.py to config.py
  • From BotFather copy the bot token to config.py
  • Run the chatbot with the following parameter python chatbot.py telegram

Done! You can now add your bot to your contacts and order your Ice Cream

My demo on Telegram: https://t.me/eibriel_icecream_bot

Telegram Demo

Installing

If you are familiar with virtualenv create a new one after cloning the repo.

I am naming my env venv:

Python2:

virtualenv -p /usr/local/bin/python venv

Python3:

virtualenv -p /usr/local/bin/python3 venv

If you are using bash activate your env:

. venv/bin/activate

Fish users just use the fish version.

. venv/bin/activate.fish

After activating you get a similar prompt:

(venv) ~/c/s/ice-cream-truck (master ⚡☡=)

Installing libraries:

pip install -r requirements.txt

Startung up the bot:

(venv) ~/c/s/ice-cream-truck (master ⚡→☡=) python chatbot.py
Using TensorFlow backend.
Missing config.py, no Telegram support
-
('Vocab size:', 22, 'unique words')
('Story max length:', 30, 'words')
...

ice-cream-truck's People

Contributors

eibrielinv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ice-cream-truck's Issues

Illegal multibyte sequence

Traceback (most recent call last):
 File "chatbot.py", line 317, in <module>
   print (order_from_story(story).replace("*", "").replace("_", ""))
UnicodeEncodeError: 'cp949' codec can't encode character '\U0001f366' in position 27: illegal multibyte sequence

On: Python 3.5.2 :: Anaconda custom (64-bit)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.