The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
TalkerBot Add-on - Learning System Details »» | |||||||||||||||||||||||||
TalkerBot Add-on - Learning System - Working Beta for VB3 RC2
This modification is an addition to the Talkerbot Hack by C.Birch, Rapid Gaming, eXtremeTim and a rendition of the ideas presented by Martin64 in the Teachbot hack for vb2.x This hack will not effect the code of the original Talkbot hack and works in a side-car fashion. Talkerbots and variants: VB2: C. birch https://vborg.vbsupport.ru/showthread.php?t=48053 VB3: Rapid Gaming https://vborg.vbsupport.ru/showthrea...t=60013&page=1 Extremetim https://vborg.vbsupport.ru/showthread.php?t=60329 Teachbot for Vb2 https://vborg.vbsupport.ru/showthrea...light=teachbot And based around Program E. Copyright 2002, Paul Rydell Portions by Jay Myers Program E is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. A major shout out to whoever wrote the Branch on Count functions, the guy who invented the internet and my mom of course... Wouldn't want to forget to credit anybody eh? Enough of that, here is the description: This hack allows you to teach your bot to answer questions that you specify. To teach the bot you simply post in a specified bot-teaching thread. The subject of your post is the question, and the body of your post is the answer. The subject can be a word, and the body can be the definition. The subject can be a phrase, and the body can be a response. Posts are accumulated in the bot-teaching thread until you run a botlearner script. This allows you to moderate the questions and answers your users might contribute before entering them into the bots knowledge base. Running the botlearner script will do the following: add posts to the bots knowledge move posts from learning thread into a "bot-learned" thread The bot-learned thread is an archive of everything you have taught your bot. This way you can reset your bot if necessary without losing all that knowledge. You can also SHARE! what you have taught your bot with other users of the Talkerbot Hack. Share what your bot has learned! Use http://www.yoururl.com/forum/externa...type=AIMLSHARE INSTALLATION INSTRUCTIONS: -------------------------- Backup your stuff if you desire. Create 2 threads where you want them, a bot-learned thread and a bot-teaching thread. Make note of the threadid numbers of both threads and the postid number of the first post in the bot-teaching thread. You will need them in a minute. In external.php: Find the switch statement. Code:
switch ($_REQUEST['type']) { case 'JS': case 'XML': case 'RSS2': break; default: $_REQUEST['type'] = 'RSS'; } case 'AIMLSHARE':into it. Like so: Code:
switch ($_REQUEST['type']) { case 'JS': case 'XML': case 'AIML': case 'AIMLSHARE': case 'RSS2': break; default: $_REQUEST['type'] = 'RSS'; } Still in external.php insert this block into the if-else chain. Replacing TEACHINGTHREADID,TEACHINGTHREADFIRSTPOSTID, and BOTLEARNEDTHREADID, BOTLEARNEDFIRSTPOSTID with the appropriate numbers. Code:
else if ($_REQUEST['type'] == 'AIML') { // XML/AIML output $posts = $DB_site->query(" SELECT post.title, post.pagetext, post.postid FROM post WHERE post.threadid=TEACHINGTHREADID AND post.postid!=TEACHINGTHREADFIRSTPOSTID"); $postcache = array(); while ($post = $DB_site->fetch_array($posts)) { // fetch the posts $postcache[] = $post; } // set XML type and nocache headers header('Content-Type: text/xml'); header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); // print out the page header echo '<?xml version="1.0" encoding="' . $stylevar['charset'] . '"?>' . "\r\n"; echo '<aiml version="1.0">'; foreach ($postcache AS $post) { echo "<category>"; echo "<pattern>"; echo strtoupper($post[title]); echo "</pattern>\r\n"; echo "<template> \r\n"; echo $post[pagetext]." \r\n"; echo "</template> \r\n"; echo "</category> \r\n"; $DB_site->query("UPDATE post SET threadid=BOTLEARNEDTHREADID WHERE postid=".$post[postid]); } echo "\r\n</aiml>"; } Still in external.php insert this block into the if-else chain. Replacing BOTLEARNEDTHREADID, BOTLEARNEDFIRSTPOSTID with the appropriate numbers. Code:
else if ($_REQUEST['type'] == 'AIMLSHARE') { // XML/AIML output $posts = $DB_site->query(" SELECT post.title, post.pagetext, post.postid FROM post WHERE post.threadid=BOTLEARNEDTHREADID AND post.postid!=BOTLEARNEDFIRSTPOSTID"); $postcache = array(); while ($post = $DB_site->fetch_array($posts)) { // fetch the posts $postcache[] = $post; } // set XML type and nocache headers header('Content-Type: text/xml'); header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); // print out the page header echo '<?xml version="1.0" encoding="' . $stylevar['charset'] . '"?>' . "\r\n"; echo '<aiml version="1.0">'; foreach ($postcache AS $post) { echo "<category>"; echo "<pattern>"; echo strtoupper($post[title]); echo "</pattern>\r\n"; echo "<template> \r\n"; echo $post[pagetext]." \r\n"; echo "</template> \r\n"; echo "</category> \r\n"; } echo "\r\n</aiml>"; } should be /forum/alice/src/admin/ In file learnwhat.xml change the line to fit your forum, Code:
<learn>http://www.yourforums.com/yourforumdir/external.php?type=AIML</learn> Code:
To get your bot to use this insert the line: <learn>http://www.shared.com/forum/external.php?type=AIMLSHARE</learn> on a sidenote if you changed the name of your bot and it's info in startup.xml you'll want to change it here in learnwhat.xml as well you can do this by making a copy of startup to be the new learnwhat.xml and changing the line <learn>*</learn> to: <learn>learnwhat.xml<learn> Back to the straight story: Upload learnwhat.xml to your AIML dir. should be /forum/alice/aiml/ Go test things out. Please let me know if I am an idiot and messed up the process here.. Show Your Support
|
Comments |
#92
|
|||
|
|||
I have this add on installed, and I post questions and answers on the learning thread, I run botlearner.php, and it runs and inserts the data in, but when I go back and ask the bot, it did not learn what it was supposed to. I tried using the snausages example verbatim, and it didnt work, and I tried a few other made up words that wouldnt already be in the database, and those didnt go in either.
Any ideas? |
#93
|
|||
|
|||
I'm thinking my problem may be that I havent put the two code segments in the correct place in the 'if/else chain' - could you please re-do the instructions, and pick a specific place to put the code, this will be easier for those of us who aren't exactly sure where to put it.,.(i.e. us non-programmers)
|
#94
|
|||
|
|||
Quote:
Loading learnwhat.xml Loading data aiml file: http://xxxxxx.xxx/forum/external.php?type=AIML XML error: mismatched tag at line 2 |
#95
|
|||
|
|||
The information is going in to the database, but nothing is moving to the learned thread. Nor is he learning any of it. :disappointed: Does anyone know what could be wrong?
|
#96
|
|||
|
|||
This was an easy hack to install, I got it to work, but there are potential problems:
Nice shell, but needs a lot of work. We can't use it in "production" at UNIX.COM..... YET! Great idea..... needs work! Thanks so much! Neo |
#97
|
|||
|
|||
Is there anything like this for 3.5 ?
|
#98
|
|||
|
|||
Is this going to be available for 3.6.1?
|
#99
|
|||
|
|||
Creating a more advanced shared learning database for the current 2.2.2 version of talkerbot. I decided having a non centralized version was really limiting the power of teaching the bot things when I can create a system on my site for users to contribute data for the bot to learn in different categories.
|
#100
|
|||
|
|||
Tim... i hope you can update this to 3.7
my bot is so useful in my forum... i need to make the bot learner to work. |
#101
|
|||
|
|||
For those about to rock, this can be made to work in 3.7.3.whatever I have!
I tried and tried to make the modifications as shown for external.php work out and finally drank myself to sleep. This morning, I discovered it working and here's what I had done. Rather than create the two cases mentioned, I created a single case and nested it as you see below (between a case xml and a case rss) - I didn't use the SHARE option as it doesn't appear any of the sites are still doing that. Working well for me though.. it's learning what the other aiml files didn't already answer and it's awesome. PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|