1

web chat bot

Doug’s web bot is built from three open source chatbot engine projects

Chat-Bubble Simple chatbot UI for the Web with JSON scripting
AiChat.js Open-source javascript chatbot that uses classifiers and a response template to respond to user messages and questions.
chatbot A simple chat bot in JavaScript with links to smart conversational APIs such as DuckDuckGo Instant Answers

how it works

If the there is no set answer then the the question is passed to the next chatbot engine.
Chat Bubble provides a neat interface and framework of questions and responses.
AiChat.js provides grenral responses to create a richer free question environment
Chatbot provides either some patterned based answers or even replies from search engine api.

Configuration Examples

Chat Bubble

 ice: {
    // "says" defines an array of sequential bubbles that the bot will produce
    says: [
      "Hello!",
      "Let's explore advanced chat flows with <em>chat-bubble</em>.",
      "In this example you'll see how this simple JavaScript framework can help you create advanced conversational sequences with GIFs!",
      "To begin, choose how you'd like this (example) conversation to proceed...",
      "...We can either talk about <strong>bananas and ice cream</strong> or <strong>other special things</strong>. Which one shall it be?",
      "<img src=https://meanbusiness.com/wp-content/uploads/2018/04/PuppyEatingBanana.gif />"
    ],
    // "reply" is an array of possible options the user can pick from as a reply
    reply: [
      {
        question: "Bananas and ice cream!", // label for the reply option
        answer: "chapter-one" // key for the next conversation object
      },
      {
        question: "No, thanks.", // label for the reply option
        answer: "end" // key for an "escape valve"; we refer to this whenever a reply signals the end of the convo
      },
      {
        question: "What “other special things?”", // label for the reply option
        answer: "sidetrack" // key for a "side note" we can reference from multiple points in the chat
      }
    ]
  },
  end: {
    says: [
      "Thanks for your time and attention.",
      "<img src=https://media.giphy.com/media/xUOxeXsWhw6DCW1cSA/giphy.gif>",
      "The chat is over, but you can <strong>start over</strong> to see how this conversation could have gone differently."
    ],
    reply: [
      {
        question: "Start over 😁",
        answer: "ice"
      }
    ]
  }
  

AiChat.js
AI Chat uses a CSV file to list the Questions and responses. Words are weighted which allows for flexiblity in spelling

Question,Answer,Weights
Default Response,I don't have enough information to answer you,0.5 0.5
Talk to you later,Good bye,0.366827839826 0.140390901662 0.125953418687 0.366827839826
good bye,Good bye,0.282608695652 0.717391304348
hi you,Hello how are you?,0.621495327103 0.378504672897
What is your name?,My name is Aichat. Nice to meet you.,0.201140290501 0.207781932746 0.206877221863 0.384200554889
who is this?,My name is Aichat. Nice to meet you.,0.289940828402 0.246153846154 0.463905325444
ok thanks,Ok.,0.666666666667 0.333333333333
what is your favorite color?,It is Blue,0.101254823314 0.105387673245 0.104824704905 0.114755466423 0.573777332113
where are you from,From somewhere exotic,0.2555268079 0.214155800907 0.193022004765 0.337295386428
what do you do,I am a bot,0.25009029983 0.251937973278 0.246033753613 0.251937973278
how old are you,Less than 1 year old,0.248404374024 0.593617496095 0.135683999107 0.122294130774

Chatbot
Uses pattern matching to create personalised answers based from the question, such as telling the bot your name.

    ChatBot.addPattern("^hi$", "response", "Howdy, friend", undefined, "Say 'Hi' to be greeted back.");
    ChatBot.addPattern("^bye$", "response", "See you later buddy", undefined, "Say 'Bye' to end the conversation.");
    ChatBot.addPattern("(?:my name is|I'm|I am) (.*)", "response", "hi $1, thanks for talking to me today", function (matches) {
        ChatBot.setHumanName(matches[1]);
    },"Say 'My name is [your name]' or 'I am [name]' to be called that by the bot");
    ChatBot.addPattern("(what is the )?meaning of life", "response", "42", undefined, "Say 'What is the meaning of life' to get the answer.");
    ChatBot.addPattern("compute ([0-9]+) plus ([0-9]+)", "response", undefined, function (matches) {
        ChatBot.addChatEntry("That would be "+(1*matches[1]+1*matches[2])+".","bot");
    },"Say 'compute [number] plus [number]' to make the bot your math monkey");

What can Doug add to your website?

Web chat bots can make you site more interactive to your viewers. Rather than your site being a glossy magazine where the viewer turns the pages, they and chat to the bot, and be given a tour of your site and have their own personal assistant

If you want Doug to Collate and process data for you then ask for a quote. Basic cost is £20 ph, the time it take varies on the complexity of task but we can talk about capping the cost.
Just let contact me and we can discuss your needs over email or the phone.