Giter Site home page Giter Site logo

php-chatman's Introduction

PHP Chatman

Chatman is a machine-learning based chatbot library build in PHP. It can generate responses by learning the conversations. Chatman is very easy to use. It can be used for generating auto responses for social media, customer support, ecommerce website, personal fun etc.

Read Documentation

Installation

First make sure your system has composer installed.

composer require yousuf/chatman

If you get any error like this :

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires yousuf/chatman ^1.0 -> satisfiable by yousuf/chatman[v1.0.0].
- yousuf/chatman v1.0.0 requires writecrow/lemmatizer dev-master -> found writecrow/lemmatizer[dev-master] but it does not match your minimum-stability.

Then run these commands :

composer require writecrow/lemmatizer:dev-master
composer require yousuf/chatman

Training Dataset :

{
"intents": [

{"tag": "intro",
  "patterns": ["Hello", "Hi", "Hi there", "hey", "Whats up"],
  "responses": ["Hi, how can I help you ?", "Hey, do you need any help ?", "How are you doing?", "Greetings !"]
},

{"tag": "age",
  "patterns": ["how old are you?", "can i know your age", "what is your age"],
  "responses": ["I am 19 years old", "My age is 19", "My birthday is Jan 5th and I was born in 2002, so I am 19 years old !"]
}]
}

Example Code :

require_once __DIR__ . '/vendor/autoload.php';

use Chatman\BotWithPatterns;

$bot = new BotWithPatterns("chatbot.json");
$bot->defaultMsg = "I did not understand !";
$bot->train();

$resp = $bot->getResponse("hello");

echo $resp['resp'];

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.