tigo/chatterbot

v0.0.2 2021-11-08 18:20 UTC

This package is auto-updated.

Last update: 2024-09-28 17:00:17 UTC


README

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