tigoCaval / chatterbot

building a simple chatbot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chatterbot

Example of a simple chatterbot for educational purposes.

  • Download package: composer require tigo/chatterbot
  • MIT license: License
  • Feel free to use this project. Leave a star ⭐ if you liked!

If you found this project useful, consider making a donation to support the developer.

paypal | paypal

Introduction

This project is based on question and answers. Example: a array with the following information

"Hi"=> ["Hi","Hello"]

Question = "Hi" | random answer = ["Hi","Hello"]

Using Database

Getting started

Starting with composer

  1. Install composer
  2. Download package: composer require tigo/chatterbot
  3. PHP >= 7.3;
  4. Update command: composer update
//Somewhere in your project, you may need to use autoload
include __DIR__ ."/vendor/autoload.php";

Example

 use Tigo\ChatterBot\Bot\BotUniversal; // import class
 use Tigo\ChatterBot\Response; //import class

$response  = new Response(new BotUniversal);

//using local array data | return string
print $response->check("Good Afternoon"); // random result = ["Good Afternoon","Hi","Hello"]

//fetching information from a database | return string
print $response->checkDataBase("Good Afternoon"); // random result = ["Good Afternoon","Hi","Hello"]   

Configuration

  • To configure the database connection using this modeling example click here (project tigoCaval/crud).
  • It is necessary to create the data tables according to this database modeling.

Contributors

About

building a simple chatbot

License:MIT License


Languages

Language:PHP 100.0%