GithubHelp home page GithubHelp logo

riswandans / mellowbot Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 48 KB

PHP Library Natural Language Processing (NLP)

License: GNU General Public License v3.0

PHP 100.00%
nlp nlp-machine-learning artificial-intelligence natural-language-processing natural-language bot bot-framework telegram-bot telegram nlp-library

mellowbot's Introduction

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"}

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.