Skip to content

zhiftyDK/chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 

Repository files navigation

chatbot.js the neural network chatbot library

Get Started

Include the library in your .html file

<script src="https://zhiftydk.github.io/chatbot/chatbot.js"></script>

How to use

Example: How to train your neural network from intents

const bot = new chatBot("./intents.json");
bot.train();

Example: How to train your neural network from new intents untop of your current model

const bot = new chatBot("./intents.json", "./model.json");
bot.train(); // When training is done model.json file will be downloaded

Example: How to run your model after training

const bot = new chatBot("./intents.json", "./model.json");
bot.run("Hello there!").then((response) => {
    console.log(response); //Greeting response
});

Create intents.json file and format the intents like this:

{
  "intents": [
    {
      "tag": "greeting",
      "trigger": false,
      "patterns": [
        "Hi",
        "Hey",
        "How are you",
        "Is anyone there?",
        "Hello",
        "Good day"
      ],
      "responses": [
        "Hey :-)",
        "Hello, thanks for visiting",
        "Hi there, what can I do for you?",
        "Hi there, how can I help?"
      ]
    },
  ]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published