Skip to content

riswandans/mellowbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MellowBot

PHP Library Natural Language Processing (NLP) with Artificial intelligence (AI)

Requirement

  • php 5.6 / 7.0 / higher
  • php-curl
  • say (for library speech)

Example

Webhook for Telegram BOT

<?php
require 'app.php';
require 'telegram.php';

$telegram = new TelegramBot();
$telegram->token = "BOT:TOKEN";
$telegram->start_webhook();

$MellowBot = new MellowBot();
$MellowBot->text($telegram->last_message);
$telegram->message = $MellowBot->response();
$telegram->send();

Usage Translate (api based on google translate)

<?php
require 'app.php';

$MellowBot = new MellowBot();
$MellowBot->text('translate english to french Hello World');
$MellowBot->reply();

Result

Bonjour le monde

Usage Artificial intelligence (api based on wikipedia)

<?php
require 'app.php';

$MellowBot = new MellowBot();
$MellowBot->text('what is google?');
$MellowBot->reply();

Result

Google LLC is an American multinational technology company that specializes in Internet-related services and products, which include online advertising technologies, search engine, cloud computing, software, and hardware.

Result to JSON

<?php
require 'app.php';

$MellowBot = new MellowBot();
$MellowBot->text('who is mark zuckerberg?');
$MellowBot->json();

Result

{"status":"200","question":"who is mark zuckerberg?","reply":"Mark Elliot Zuckerberg (; born May 14, 1984) is an American technology entrepreneur and philanthropist.\n\nhttps:\/\/en.wikipedia.org\/wiki\/Mark_Zuckerberg"}