Mass import AIML files

Snippets and mods.

Mass import AIML files

Postby Philip » January 22nd, 2012, 2:27 am

The following mod adds an extra menu item to the admin panel that allows users to specify a directory and (re)upload ALL AIML files from it to the database. In addition, it attempts to convert/sanitize special/foreign characters from the AIML file before import.

It contains two new files, and a small modification to the side navigation bar in the admin menu. It requires "My Program-O" to be installed.

To install, simply unzip the file in your main program-o directory. It will add two new php files ( [botdir]/admin/pages/ph_aiml.php and [botdir]/admin/funcs/ph_aiml.php), and let it replace the admin side-nav file to add a line for easier navigation ( [botdir]/admin/pages/inc/side_nav_bar.php )

To use (after installing ;) ):
1. Create a subdirectory of [botdir]/admin/aiml (with proper read/write permissions for the web user)
2. Upload your AIML files there
3. Open "Mass Import AIML" from the side-navigation menu in the admin panel
4. Type the directory name in the form, and hit "update" - this will (re)load ALL files from that directory to the database.

Alternatively, you can simply add AIML files to the aiml directory, and just hit the [update] button without making/specifying directories. Warning: large files, and a large number of files importing can get pretty server-intensive, hence the ability to specify different directories.
Note: Similarly to upload.php, this will delete/replace all patterns in the aiml table in the database that have these filenames as reference. If successful, you will get a list of all loaded files. If not, you will get errors with filename and line number to look at.

Here are the files: ...

Note this is a fast hack copied from upload.php, with some added functionality for cleaning special characters and loading multiple files. I'm sure it could be done better given the time, but it works for me with the latest ALICE AIML files v. 1.7 from here: ... loads/list
(and a few others)

I hope this helps someone :)
Casual Member
Posts: 2
Joined: January 21st, 2012, 9:56 pm

Re: Mass import AIML files

Postby GeekCaveCreations » January 22nd, 2012, 4:22 am

Thanks for the links and files, Phillip. I'll give them a quick look-see either tonight or tomorrow. :)
Comforting the disturbed, and disturbing the comfortable
Chat with Morti
User avatar
Safe, Reliable Insanity, Since 1961
Posts: 1115
Joined: April 18th, 2011, 10:52 pm
Location: Nevada, USA

Re: Mass import AIML files

Postby AbbeyThomas » November 26th, 2013, 5:21 pm

I have no idea about it and looking forward to it?
Casual Member
Posts: 1
Joined: November 26th, 2013, 5:16 pm

Return to Mods and Snippets

Who is online

Users browsing this forum: No registered users and 3 guests