All Projects → kompasim → Chatbot

kompasim / Chatbot

Licence: mit
chatbot, an aiml interpreter for PHP

Labels

Projects that are alternatives of or similar to Chatbot

Fb Botmill
A Java framework for building bots on Facebook's Messenger Platform.
Stars: ✭ 67 (-22.09%)
Mutual labels:  chatbot
Karmabot
🤖 A Multipurpose Discord Bot with a Music System & Utility commands used by 160K+ users!
Stars: ✭ 73 (-15.12%)
Mutual labels:  chatbot
Tensorflow seq2seq chatbot
Stars: ✭ 81 (-5.81%)
Mutual labels:  chatbot
Talkify
Talkify is an open source framework with an aim to standardize and model conversational AI enabling development of personal assistants and chat bots. The mission of this framework is to make developing chat bots and personal assistants as easy as spinning up a simple website in html.
Stars: ✭ 68 (-20.93%)
Mutual labels:  chatbot
Korean restaurant reservation
Implement korean restaurant reservation dialogue system based on hybrid code network.
Stars: ✭ 73 (-15.12%)
Mutual labels:  chatbot
Botframework Webchat
A highly-customizable web-based client for Azure Bot Services.
Stars: ✭ 1,198 (+1293.02%)
Mutual labels:  chatbot
Convai Bot 1337
NIPS Conversational Intelligence Challenge 2017 Winner System: Skill-based Conversational Agent with Supervised Dialog Manager
Stars: ✭ 65 (-24.42%)
Mutual labels:  chatbot
Dialogue Generation
Generating responses with pretrained XLNet and GPT-2 in PyTorch.
Stars: ✭ 86 (+0%)
Mutual labels:  chatbot
Telegram.bot.framework
Simple framework for building Telegram bots
Stars: ✭ 73 (-15.12%)
Mutual labels:  chatbot
Laibot Client
开源人工智能,基于开源软硬件构建语音对话机器人、智能音箱……人机对话、自然交互,来宝拥有无限可能。特别说明,来宝运行于Python 3!
Stars: ✭ 81 (-5.81%)
Mutual labels:  chatbot
Rasa nlu chi
Turn Chinese natural language into structured data 中文自然语言理解
Stars: ✭ 1,166 (+1255.81%)
Mutual labels:  chatbot
Mojo Weixin
使用Perl语言(不会没关系)编写的个人账号微信/weixin/wechat客户端框架(非GUI),可通过插件提供基于HTTP协议的api接口供其他语言或系统调用
Stars: ✭ 1,181 (+1273.26%)
Mutual labels:  chatbot
Text Dependency Parser
🏄 依存关系分析,NLP,自然语言处理
Stars: ✭ 78 (-9.3%)
Mutual labels:  chatbot
Microsoftbotframework
Microsoft Bot Framework is a wrapper for the Microsoft Bot API by Microsoft
Stars: ✭ 68 (-20.93%)
Mutual labels:  chatbot
Mixer Mixitup
Streaming bot application for handling chat, events, moderation, and other streamer assistance features
Stars: ✭ 83 (-3.49%)
Mutual labels:  chatbot
Unilmchatchitrobot
Unilm for Chinese Chitchat Robot.基于Unilm模型的夸夸式闲聊机器人项目。
Stars: ✭ 67 (-22.09%)
Mutual labels:  chatbot
Chatterbox
Python library for Kakaotalk chatbot
Stars: ✭ 74 (-13.95%)
Mutual labels:  chatbot
Chaskiq
A full featured Live Chat, Support & Marketing platform, alternative to Intercom, Drift, Crisp, etc ...
Stars: ✭ 1,263 (+1368.6%)
Mutual labels:  chatbot
Omeglemiddleman
Lets you connect strangers to each other, and intercept messages AKA Man in the Middle Attack
Stars: ✭ 85 (-1.16%)
Mutual labels:  chatbot
Conversational Ui
Conversational interface web app example
Stars: ✭ 78 (-9.3%)
Mutual labels:  chatbot

An aiml parser for PHP


中文


0. notice

the chatbot is writen according to AIML 2.5 and Program-P,it uses utf-8 and i made some customizaton , there are some differences between standard aiml tags and the tags uses in this program.

1. description

it is working well on PHP5.4 and Apache server .

2. database configuration

you should use MySQL database and import the chatbot.sql file to your database . then, you should configure your database information in chatbot/Config.php file .

4. aiml sourses

you can edit aiml/chatbot.aiml fiel directly or create an aiml file in aiml directory and include it in aiml/chatbot.aiml file。

5. about aiml files

  • aiml files should be paleced in aimldirectory.
  • chatbot.aimlis the entrance ,the aiml tag in it can contain various category tag , a defaulttag and various includetag。
  • other aiml files writen by you should contain a topic tag in root aiml tag , and the topic can contain various category tag and a default tag (it should not have include tag)。

6. test

you can visit index.php to test it.

7. using the chatbot

if you want to use the chatbot in your application, you can request api.php?requestType=talk&userInput=hello

8. about the regular expressions

Modified matching rules :

* ---> (\S+)
# ---> \S+
_ ---> .*
= ---> \S*

9. about aiml tags

it is different from the standard aiml,i made some customizaton to aiml tags , you can see the tag rules in AIML.MD file。

10. about the response of api.php

{
    "status": "success",
    "type": "talk",
    "message": "haha ...",
    "data": {
        "arr1": {
            "name11": "value11",
            "name12": "value12"
        },
        "arr2": {
            "name21": "value21",
            "name22": "value22"
        }
    }
}

you will get above response when you visit api.php?requestType=talk&userInput=haha and you have a category like this .

<category>
    <pattern>haha</pattern>
    <template>
        <data name="arr1">
            <attr name="name11">value11</attr>
            <attr name="name12">value12</attr>
        </data>
        <data name="arr2">
            <attr name="name21">value21</attr>
            <attr name="name22">value22</attr>
        </data>
        haha ...
    </template>
</category>

11. about userId

when you send a userId param as a get param , this will be used as a unique identity of user , or the program will use user's ip instead of it .

$userId = isset($_REQUEST['userId']) ? $_REQUEST['userId'] : $_SERVER['REMOTE_ADDR'];

12. about multi chatbot

if you set the multiChatbot variable false in 'chatbot/Config.php' , all users share a default chatbot . and if you set it true , every user will have a unique chatbot and we will set the chatbot informations in template tag , like botName , botAge , botSex and others , this will be verry usefull when you are building a voice assistant app and hoping the users can reaname your app . the multi chatbot also uses the userId(ip or the value you send it to chatbot) as a unique identity .

$user = $this->getUser($this->_unique);
if ($this->_config->multiChatbot){
    $bot = $this->getBot($this->_unique);
} else {
    $bot = $this->getBot("default");
}

13. about userInfo and botInfo

userInfo is user's properties like name , sex and age . then , botInfo is similar too . botInfo is the bot's information serving for the user . if you using multi chatbot mode , every user can change their bot's informations , they can rename it , and give it a age . for usage you can view the AIML.MD file and study about the tags like set, get, del, user, bot.

<category>
    <pattern>my name is *</pattern>
    <template>
        ok , your name is
        <star/>
        <set type="user" name="name">
            <star/>
        </set>
    </template>
</category>

<category>
    <pattern>what is my name</pattern>
    <template>
        oh , your name is
        <get type="user" name="name"/>
        , i remembered it last time ...
    </template>
</category>

14. about database

log table is for logging .

property table is for storing the userInfo and botInfo , it is the memory of the chatbot . set ,get, del, user, bot tags are operating this table .

data table is for storing the words spoken by user and bot . input , that, topic tags will operate Parser::$_data array and the array will be saved to data table when the program is finishing . then , it will be loaded at the next time users requests the chatbot program . the unique key in data table is userId(ip or the value you send it to chatbot) too.


Enjoy it

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].