This article introduces a small chat robot program implemented with PHP. It uses php to operate DOM related knowledge and MySQL database, which can be used for learning. The code can be downloaded from https://github.com/kompasim/c…
Artificial Intelligence Markup Language (AIML) is a programming language which is an Extensible Markup Language (XML) specification used by chatbot, verbot, pandorabot, superbot, and other talking robot. It was developed by Dr. Richard Wallace and followed by other likeminded programmers (AIML free software community). Xml Editor For Coding Aiml For Mac. MOSO Xmplify XML Editor for Mac OS X is a powerful new XML editor built specifically for Mac OS X. Xmplify provides a fully XML-aware editing environment with DTD and XML Schema-based auto-completion, automatic document validation, XSLT and XPath support, live HTML preview and much. Jan 25, 2012 Gender.aiml. Last update: 3rd May 2010. The bot now knows the gender of a first name. This stops people from saying things like, 'My name is Eric. I am a girl'. It can also answer what sex the user is from their first name. This file is updated regularly as I find new names. This is the start of a hangman game I created in AIML.
English
0. Reminder
The chat robot is written with reference to AIML 2.5 and Proram-P. The AIML tag implemented by the chat robot is different from the standard AIML tag, so the AIML corpus downloaded from the Internet may not work properly. For UTF-8 coded languages, word suffixes vary according to different tenses. Interested friends can study for themselves.
1. Introduction
This is an AIML parser written in PHP, which currently works well in PHP 5.4 environment.
2. Database Configuration
This program uses MySQL database, you need to
chatbot.sql
Files are poured into your database, and thenchatbot/Config.php
Modify the relevant database configuration variables in the file.4. AIML corpus resources
You can edit it directly.
aiml/chatbot.aiml
File or create a new oneaiml
File thenaiml/chatbot.aiml
Documentationinclude
Labels introduce it.5. About AIML files
chatbot.aiml
It’s the entry file. It’s inside.aiml
Labels can contain multiplecategory
Label, onedefault
Labels and multipleinclude
Label.- Other things you add
aiml
File at rootaiml
The label must contain onetopic
Tag, this topic tag can contain more than onecategory
Labels and onedefault
Label (other AIML files here cannot be written)include
Label,include
Labels can only appearchatbot.aiml
It’s in the document.
6. Testing chat robots
You can open it.
index.php
Chat with the robot for testing.7. Call chat robots
If you want to call a chat robot in your application, we can call its API in this way.
Api. php? RequestType = talk & input = hello
8. On Matching Rules
Film impact transition pack 1 full download. The modified matching rule:
9. About AIML Tags
The Chat Robot
aiml
Labels and standardsaiml
Labels are different. I personalize the tags according to the requirements. We can find more tags supported by chat robots in the AIML. MD file.10. Return data about api. PHP
11. About userId
Xml Editor For Coding Aiml For Mac Pc
When you give
api.php
withGET
When you send a request in a way, you take it with you.userId
Parameter, which is used as the unique identifier of the user. If you don’t give this parameter, the program will use the user’s IP as the only indication.12. About Multiple Chatbots
If you put’chatbot/Config.php’in the file
multiChatbot
Set tofalse
All users will share onedefault
Ofchatbot
。 When you set it totrue
Every user will have its ownchatbot
Thesechatbot
Yes.userId
As a unique label, each user gives its ownchatbot
Set the relevant name, gender, age and other attributes. When you’re writing a voice assistant or something like that, more than onechatbot
Functions will be particularly useful because users can name their voice assistants.13. About userInfo and botInfo
UserInfo and botInfo refer to some attributes of users and chat robots, such as name, age, gender and so on. Users can change these attributes. Of course, this is achieved by some tags when we write AIML corpus. We can learn about set, get, del, user, BOT and other tags from AIML. MD.
Xml Editor For Coding Aiml For Mac Computer
14. About databases
log
A table that stores logs.property
It’s storage.user
andbot
The table of attributes, which is equivalent to the head of our chat robot, helps us remember some attributes. Labels such as set, get, del, user, BOT are used to manipulate the table.data
Tables are used to store user input and robot responses.input
, that
, topic
Wait for labels to operateParser::$_data
Freja win 5.1 software free download. Array. Every time the program starts running, the program loads data from the table into the array, and then stores it in the table when the program ends. The only indication of the table isuserId
。https://github.com/kompasim/chatbot