View Full Version : TalkerBot Add-on - Learning System
Geographic2
01-18-2004, 10:00 PM
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/showthread.php?t=60013&page=1
Extremetim https://vborg.vbsupport.ru/showthread.php?t=60329
Teachbot for Vb2
https://vborg.vbsupport.ru/showthread.php?t=48291&page=1&highlight=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 www.yoururl.com/forum/external.php?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.
switch ($_REQUEST['type'])
{
case 'JS':
case 'XML':
case 'RSS2':
break;
default:
$_REQUEST['type'] = 'RSS';
}
And insert the line case 'AIML': and
case 'AIMLSHARE':into it.
Like so:
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.
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.
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>";
}
Upload botlearner.php botlearnerinc.php and botlearnerfuncs.php to the same directory that botloader.php resides in.
should be /forum/alice/src/admin/
In file learnwhat.xml
change the line to fit your forum,
<learn>http://www.yourforums.com/yourforumdir/external.php?type=AIML</learn>
For each addition site you would like to get shared knowledge from insert a line:
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..
Geographic2
01-18-2004, 11:33 PM
Dog Treats. :)
Geographic2
01-18-2004, 11:33 PM
^^^ Would be an example of the format for botteaching thread posts.
If the question is already something that has been answered in the AIML files, ussually a very common question, your entry may be lower in priority and the bot will say the original answer....
apokphp
01-19-2004, 01:50 AM
case 'AIML';
Should that semicolon be a colon instead, like the other switches?
Either way, it's not working for me.
The questions from the teaching thread are moved to the learned thread successfully. But the bot hasn't learned anything from the teaching thread at all.
Geographic2
01-19-2004, 02:35 AM
Example:
In TEACHING thread, there are posts...
#1
#2
#3
#4
#5
I run botlearner.php
Learned Thread shows:
My original opening post
#2
#3
#4
The TEACHING thread now shows
#5
Seems to be fine way of doing it...is this what is supposed to happen?
No it should be only #1 remaining in the teaching thread. This way the first post in the thread should be a description of what the thread is all about, are you sure the postid is the correct #?
Are you sure the postid's are set up with the proper numbers?
It is with this query:
SELECT post.title, post.pagetext, post.postid
FROM post
WHERE post.threadid=TEACHINGTHREADID AND post.postid!=TEACHINGTHREADFIRSTPOSTID
That it transfers things over with, in plain english get all posts with threadid=TEACHINGTHREADID except when postid=TEACHINGTHREADFIRSTPOSTID....
The only thing I could think of is a wrong number or we're counting in different directions with our 1,2,3,4,5's.... But you should have 4 posts being moved over, and you say it's just 2,3,4 that got moved....
case 'AIML';
Yeah that should be a colon I imagine. :) Fixed in original post.
What questions did you make it learn?
Perhaps try some more specific things. Non-common things that aren't already defined in the AIML. When the bot runs into a looping error searching for an answer that's when it says "opps I wasn't paying attention, etc..." I noticed long questions can be problematic as the bot breaks down the sentence trying to make a match. If it goes down the wrong path you won't get your expected answer.
Try my 'What are Snausages?' Example...
You can also define words for the bot to pick up on...
apokphp
01-19-2004, 02:45 AM
No it should be only #1 remaining in the teaching thread. This way the first post in the thread should be a description of what the thread is all about, are you sure the postid is the correct #?
Was able to fix this issue. Not sure what started the problem...but it is resolved now (I think it was the semi-colon being used at first).
Still not working though.
Threads and post id's are correct.
I tried to teach it:
Who is Apokalupsis?
A: Founder of ODN.
Who is Eva?
A: A SuperModerator at ODN.
and a couple other questions re: staff members.
And how can I define words for the bot to pick up on?
---
Asked: Who is Yoda?
A: A Jedi Master.
ran botlearner.php, he didn't learn it...but it moved successfully to the learned thread.
Geographic2
01-19-2004, 03:11 AM
Try it like this:
Apokalupsis?
A: Founder of ODN.
Then ask the bot: Who is Apokalupsis?
Mine replies with :
No one that I have talked to.<br></br>
The founder of ODN.
Defining single words like that is the way to go for introducing your staff members when someone asks Who is soandso...
Try teaching it:
Q: What are snausages?
A: Dog Treats.
And then ask it. That will at least confirm that all the code is working properly.
I agree it does learn 100 percent, then again I am no pro at AIML yet, I do have a little exposure to Prolog but I'm no pro and therefore I have only implemented the simplest structure so far. I believe teaching it phrases that it can use in response to words will work well as much of the basic english and grammar is already programmed in the AIML... It has things like Who is *
So sometimes it gets itself finding "true" results when it's not really what you were looking for.
apokphp
01-19-2004, 04:54 AM
The answer to snausages:
I have to search the web for that information.
The ALICE chat robot can follow many things, like our discussion about Yoda. Try being more or less specific.
Yoda happened to be discussed prior to thelearning hack. The other instances of phrasing above, didn't work either.
I have the latest bot by extreme. Is your learning hack using that as well?
gmarik
01-19-2004, 07:14 AM
So this is something like a knowledge base or FAQ?
mello_mike
01-19-2004, 08:19 AM
When I run botlearner.php.. I get his error.
Loading learnwhat.xml
XML error: not well-formed (invalid token) at line 16
corsacrazy
01-19-2004, 08:43 AM
am i missing something ? i have no external.php !!!
apokphp
01-19-2004, 02:38 PM
external.php is a vb3 file...it is in your /forums/ dir.
Has anyone got this hack to work perfectly yet? It's a good idea for a hack...just havin' some difficulty.
mello_mike
01-19-2004, 05:27 PM
Ok!! I finally got it to work perfectly...
I tested it with my bot and it works great!! My members are now teaching my bot all kinds of things!! THANKS.
If you guys want to see how it works.. visit my forum at.
http://www.showtimemag.com/forum/forumdisplay.php?f=65
I have a sub forum in that forum that is used just for teaching my bot!!
GREAT MOD!!
BillaBongUSA
01-19-2004, 09:19 PM
Dang it, I keep getting this message when I try to load the botlearner.php script:
Loading learnwhat.xml
could not open XML input
I don't know what's wrong, I checked all the files and file locations and everything, but I keep getting that error.
corsacrazy
01-19-2004, 09:23 PM
its werkin but wen someone clicks reply to the teach thread the url is actually replying to the last post which may bit be the 1st one it maybe a question by another user therefore wen i run the botlearner file it only adds the 1st post to the databse and the others just dissappear :S
eXtremeTim
01-19-2004, 10:01 PM
I have it installed but he does not seem to learn the stuff.
corsacrazy
01-19-2004, 10:03 PM
I have it installed but he does not seem to learn the stuff.
run botlearner
eXtremeTim
01-19-2004, 10:08 PM
I already did that its in the database. He just doesn't always pickup on the keywords is what it is. Becuase he replied correctly to a few of the things we taughthim already and not to a few of the other things. Heres our learnshare feed for you all. :) http://www.extremechatforums.com/forum/external.php?type=aimlshare
eXtremeTim
01-19-2004, 10:09 PM
Everybody who gets this working will you please post your aimlshare link so others can use it to teach our bots. :)
eXtremeTim
01-19-2004, 10:12 PM
Dang it, I keep getting this message when I try to load the botlearner.php script:
I don't know what's wrong, I checked all the files and file locations and everything, but I keep getting that error.
billabong i was getting that error till i check the dbprefs file and madesure the rootdir path was correct becuase it had changed since i had installed the bot.
BillaBongUSA
01-19-2004, 11:15 PM
Yeah, I tried that, and the path was correct, so I don't know what else could be wrong. I dunno, I guess I'll just keep messing with it and looking at the code.
eXtremeTim
01-19-2004, 11:29 PM
Make sure its chmodded 777. That might make a difference
eXtremeTim
01-20-2004, 12:00 AM
Another good idea might be to add the bot learner script to the cron. If you dont want to have to do it by hand just maybe have that run every hour or day.
Xyphen
01-20-2004, 12:43 PM
Anyone got it installed on RC2 without any errors?
eXtremeTim
01-20-2004, 02:26 PM
I have. It works perfectly. You just have to find the right phrases that will not conflict with anything in its database like instead of "What are the lyrics for songname" I must use "Lyrics songname" and he will reply with the correct lyrics if they have been added to his database.
BillaBongUSA
01-21-2004, 12:34 AM
Okay, well, I finally got the botlearner.php file to run by specifying an exact path to the /aiml directory in dbprefs.php. After I ran it, I got this message:
Loading learnwhat.xml
Loading data aiml file: .../forums/external.php?type=AIML
DONE LOADING
Inserted 11 categories into database
But whenever I use key words in questions, or even just key words by themselves, the bot doesn't know what I'm talking about. Does anyone know what could be wrong?
eXtremeTim
01-21-2004, 01:31 AM
Try more unique keywords. Its kinda tricky. Like i used at frist "what are the lyrics for songname" Then i started using "Lyrics songname" becuase the other keywords didn't work but that one did but now im using "Lyrics bandname songname" Thats just one example from my site.
BillaBongUSA
01-21-2004, 01:45 AM
Yeah, most of the key phrases that I've used are just single words, and a lot of them are the names of staff members, which are all pretty unique. Oh well, I guess I'll just keep messing with it to see if I can find the problem.
Okiewan
01-21-2004, 04:30 AM
Can the bot's database be limited to ONLY what he is taught?
eXtremeTim
01-21-2004, 10:50 AM
Yes just never run botloader.php. botlearner should take care of everything but only load in what he is tuagh each time. Im also going to make an aimltest extension tonight if anybody is interested. Im tired of running botlearner and find out that there was an error so all the posts were moved but not added into the db.
Okiewan
01-21-2004, 01:55 PM
I guess I misunderstood then? I thought running botleaner was the only way to get the learned posts into the bot's database?
eXtremeTim
01-21-2004, 02:21 PM
I guess I misunderstood then? I thought running botleaner was the only way to get the learned posts into the bot's database?
It is. Botloader.php is the file you run the first time when your first setting him up that puts all the other info in the database. If you have run the sql files that setup the bots tables then just use botlearner without using botloader he will only know what you guys teach him.
Okiewan
01-22-2004, 12:59 PM
Okay.. so I screwed-up and ran botloader, having troubles getting him going.
How can I removed the database entries loaded? As I said I want him to only know what we teach him (going to use it as a FQ of sorts, specific to my site's audience)
It's installed and learning, but is NOT moving the posts from "Teach" to "Learned"
Question: is the post ID (the first in either thread) supposed to be the post NUMBER (ie; "1") in the thread or the actual post ID number?
I have to admit I got a little confused during installation with this part:
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>
Someone care to make that a little more clear? I have learnwhat and startup in the same directory and they contain different info... I modified "learnwhat" only. Do I just copy the contents of learnwhat into startup, then put <learn>learnwhat.xml<learn> in it (into startup)?
eXtremeTim
01-22-2004, 02:04 PM
Dont even read that part its not needed. Just start with bot learner and modify it to make your bot custom. To reset the bot you need to drop the tables that the sql file setup. I would list all the tables but i dont have the files handy.
Okiewan
01-22-2004, 07:46 PM
Got it working, he does learn and the teach and Learned threads work.
When you ask him who someone is, he returns the right answer but always starts his reply with something like "I don't know the name". Ugg.
Dang it, I keep getting this message when I try to load the botlearner.php script:
I don't know what's wrong, I checked all the files and file locations and everything, but I keep getting that error.
I am having a simular issue. Mine is saying
XML error: junk after document element at line 2
I think it may be in my external.php as when I go to my AIML I get this error
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
Okiewan
01-22-2004, 08:30 PM
Okay, I give up. What table is the learned (via this mod) data stored in?
eXtremeTim
01-23-2004, 01:27 AM
I am having a simular issue. Mine is saying
XML error: junk after document element at line 2
I think it may be in my external.php as when I go to my AIML I get this error
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
Yes thats from your external.php not being hacked correctly.
Okiewan drop these tables "bot,bots,conversationlog,dstore,gmcache,gossip,pat terns,templates,thatindex,thatstack" then run the sql file included in my talkerbot hack then run botlearner.php to start teaching it stuff.
Geographic2
01-23-2004, 02:30 AM
Okay, I give up. What table is the learned (via this mod) data stored in?
pattern and template.
Geographic2
01-23-2004, 02:38 AM
Im tired of running botlearner and find out that there was an error so all the posts were moved but not added into the db.
What errors are you running into? DB errors or something? I don't have any traffic flowing through mine so it's hard to test for everything. What is happening?
Yes thats from your external.php not being hacked correctly.
I really need some help and I am sure its simple. I think I am putting the formats of the threadids and such in wrong. Also, I was not exactly sure where to put the else if stuff as you just said put it in there. Can you help me and just treat me like a dumbass. :nervous:
bigtime
01-23-2004, 03:07 PM
Which hacks are required to be installed before installing [vB3.0.0] - TalkerBot Add-on - Learning System?
I saw this but it is unclear to me what is required to be installed:
"Talkerbots and variants:
VB2:
C. birch https://vborg.vbsupport.ru/showthread.php?t=48053
VB3:
Rapid Gaming https://vborg.vbsupport.ru/show...?t=60013&page=1
Extremetim https://vborg.vbsupport.ru/showthread.php?t=60329
Teachbot for Vb2
https://vborg.vbsupport.ru/show...hlight=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."
Thanks in advance!
Xyphen
01-23-2004, 05:41 PM
Ok, something is wrong with my Bot.. I teach him stuff and he just comes up with his own stuff...
I teached him "Who is Ali?"
Answer "Ali is the owner of sitename."
Asked him "Who is Ali?"
response "I do not recognize the name.<br></br>
Oh now I see."
Teached him "What is your name?"
Answer "My name is Mr. Boto"
Asked him "What is your name?"
Response "My name is Program E."
eXtremeTim
01-23-2004, 05:57 PM
some of that stuff will conflict. Its a matter of finding the right keywords.
I give up, I have tried just about everything and can get it to work correctly. Oh well, guess my bot will never learn anything at all.
Thanks Tim for trying to help me out.
Xyphen
01-23-2004, 08:41 PM
I don't think the learning addon works for me :(
I don't think the learning addon works for me :(
Me neither. :(
Geographic2
01-24-2004, 05:47 PM
Which hacks are required to be installed before installing [vB3.0.0] - TalkerBot Add-on - Learning System?
I saw this but it is unclear to me what is required to be installed:
"Talkerbots and variants:
VB2:
C. birch https://vborg.vbsupport.ru/showthread.php?t=48053
VB3:
Rapid Gaming https://vborg.vbsupport.ru/show...?t=60013&page=1
Extremetim https://vborg.vbsupport.ru/showthread.php?t=60329
Teachbot for Vb2
https://vborg.vbsupport.ru/show...hlight=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."
Thanks in advance!
Either of these will operate fine with this hack add-on for VB3.
VB3:
Rapid Gaming https://vborg.vbsupport.ru/show...?t=60013&page=1
Extremetim https://vborg.vbsupport.ru/showthread.php?t=60329
If you are using VB2, then use the VB2 version and the Teachbot hack by martin64.
;)
Geographic2
01-24-2004, 06:22 PM
Me neither. :(
To all those having trouble, extremeTim asked me if he could integrate this with the next version of Talkerbot, I think it's an excellent idea, and hopefully this will make the installation process easier for those having trouble. He's even fixed a couple of the quirks that I left out of my code, such as post count data. ;)
Geographic2
01-24-2004, 06:35 PM
I really need some help and I am sure its simple. I think I am putting the formats of the threadids and such in wrong. Also, I was not exactly sure where to put the else if stuff as you just said put it in there. Can you help me and just treat me like a dumbass. :nervous:
an if - else chain is a way to execute different code under different circumstances.
In this example of external.php we have these options JS, XML,RSS
if ($_REQUEST['type'] == 'JS' AND $vboptions['externaljs'])
{
//A BUNCH OF CODE
}
else if ($_REQUEST['type'] == 'XML' AND $vboptions['externalxml'])
{
}
else if (($_REQUEST['type'] == 'RSS' OR $_REQUEST['type'] == 'RSS2') AND $vboptions['externalrss'])
{
}
We want to insert that else if block I posted into that structure,
to make it easy... just go to the end of the file, find
/*================================================= =====================*\
|| ################################################## ##################
|| # Downloaded: 22:41, Thu Jan 8th 2004
|| # CVS: $RCSfile: external.php,v $ - $Revision: 1.49 $
|| ################################################## ##################
\*================================================ ======================*/
and insert the else if block i posted for external.php right above the big comment block.
SRozhon
02-11-2004, 03:20 PM
Great Hack!
Ok, I got it to move the thread from the teaching to learning thread when I run botlearner but I am not getting a response in the forum when I ask the question. Any ideas what I need to fix here?
BTW Anyone who wants my learned files they are going to be at
<learn>http://www.rozhon.com/forums/external.php?type=AIML</learn>
<learn>http://www.US-ships.com/forums/external.php?type=AIML</learn>
Moosehunter
02-23-2004, 05:25 AM
Does it matter if the tables have a prefix of vb3 in front of them? When i installed the forums i made a vb3 prefix in the config.php file.
Thanks for any responses. :squareeyed:
Gio Takahashi
03-05-2004, 04:41 PM
Loading learnwhat.xml
Loading data aiml file: http://www.unitedempire.net/forum/external.php?type=AIML
XML error: syntax error at line 1
Anyone?
Osterling
03-07-2004, 01:12 AM
does it learn just by over time, or is there a proccess i must do as an admin to teach it?
Osterling
03-07-2004, 05:00 AM
can some one please explain how i can teach it.. like after i do the threads, what do i run to insert that into his brain
Osterling
03-07-2004, 05:16 AM
I'm not feeling very well at the moment, try again later.
^^ it keeps saying that only.. is something wrong with my Bot?
Osterling
03-08-2004, 03:00 AM
has anyone figured out how to make him answer math problems? like 4+3 or 3434/34343
Geographic2
03-15-2004, 01:56 AM
Hi exasko.
Sorry I haven't been able to offer much support for those using this.
Unemployed recent college grad = busy stressed out broke ass mo'fo me....
For those who haven't installed this, please check out the newest implementation of talkerbot hack in full release section.
I believe there is already a math AI file? Check the file names... I believe it is already capable of math problems...
try asking it
"What is two plus two?" perhaps....
Try using words instead of the symbolization and such...
DaveLogic
03-16-2004, 11:08 AM
Where or what table is the learned info stored..My teach / Learn forums appear to work ok but the bot simply learns nothing. Not even simple keywords. I've emptied the original TalkBot AIML stuff that botloader put in.Run botlearner & now have 26 IDs from the learnwhat.xml ..Nothing else seems to get added??
Geographic2
03-17-2004, 11:20 PM
All info is pushed into the pattern and template tables.
I had success teaching it like this:
Loading this entry from the learning thread:
Thread Title: What are snausages?
Thread Body: Dog Treats.
Then asking the bot: What are snausages?
and it would return the correct answer.
I've also had success giving it Dictionary style entries where the
thread title is a single word and the body is the definition.
I'd also like to note that I have tried to teach it things that it failed to learn.
The reason for this failure is likely due to the bot being taken away to a different success result in it's DB. Sort of distracted by too many paths to take.
Hope you get it going ;)
DaveLogic
03-18-2004, 02:52 AM
All info is pushed into the pattern and template tables.
I had success teaching it like this:
Loading this entry from the learning thread:
Thread Title: What are snausages?
Thread Body: Dog Treats.
Then asking the bot: What are snausages?
and it would return the correct answer.
I've also had success giving it Dictionary style entries where the
thread title is a single word and the body is the definition.
I'd also like to note that I have tried to teach it things that it failed to learn.
The reason for this failure is likely due to the bot being taken away to a different success result in it's DB. Sort of distracted by too many paths to take.
Hope you get it going ;)
I've checked my PATTENS table and all BOT entries seem to have a value of 1 for parent and 1 for isend.They don't follow sequence...Is this correct..If not could it be an error with the first thread / first post config???- It's the only thing I can think of...
bot id word ordera parent isend
0 287801 NULL 3 287800 1
0 287802 <topic> 2 287801 0
0 287803 NULL 3 287802 1
0 287804 2 287803 0
0 287805 MYWORD 2 1 1
0 287806 <that> 2 287805 0
rockergrrl
03-27-2004, 05:59 PM
I can't seem to get this to work on my board.
Everything is loaded, and I'm pretty sure I got the IDs correct.
But the thing doesn't seem to want to run at all :/
Someone care to take a look at it for me?
PM, let me know.
Gracias!
Geographic2
03-27-2004, 06:17 PM
What's happening/Not Happening...?
When you make posts and run botlearner do the posts get moved?
Do you get any output when using the external.php URL?
rockergrrl
03-27-2004, 07:08 PM
Posts have been made, but the bot isn't responding.
When I run botlearner, I get:
Loading learnwhat.xml
Loading data aiml file: /forum/external.php?type=AIML
DONE LOADING
Inserted 0 categories into database
And when I run the external.php?type=AIML file, I get a blank page
Suggestions?
If you want, PM me your email address, and I can send you over whatever is needed if you want to look at it specifically.
Thanks for your help!
Geographic2
03-27-2004, 07:50 PM
If you get a blank page in the external.php then there is nothing to be read when you go and run botlearner.
My first guess is that there must be something wrong with the threadids.
Look at the external.php changes and check the threadids.
Make a few more posts in the thread and try to see if you can get external.php running.
When it works and you follow the external.php?type=AIML you should get results on the screen which should be your entries in an xml type format... If it's blank that's no good.
I don't have a email I like to share but you can PM me things here if you like.
I have to go to family party now.
Be back later this evening.
rockergrrl
03-27-2004, 08:13 PM
At the end of external.php before:
/*================================================= =====================*\
I have:
else if ($_REQUEST['type'] == 'AIML')
{ // XML/AIML output
$posts = $DB_site->query("
SELECT post.title, post.pagetext, post.postid
FROM post
WHERE post.threadid=182 AND post.postid!=536");
$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=183 WHERE postid=".$post[postid]);
}
echo "\r\n</aiml>";
}
else if ($_REQUEST['type'] == 'AIMLSHARE')
{ // XML/AIML output
$posts = $DB_site->query("
SELECT post.title, post.pagetext, post.postid
FROM post
WHERE post.threadid=183 AND post.postid!=537");
$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>";
}
I'm pretty sure I got everything correct (I double checked the thread ids, etc. They're correct.
Unless I missed editing something in there.
Geographic2
03-29-2004, 05:38 AM
Check your PM's.
Bro_Joey_Gowdy
04-10-2004, 03:39 PM
/me clicks install
mikeee
04-20-2004, 07:45 AM
Can someone help? I keep getting this error:
=========================
Loading learnwhat.xml
Loading data aiml file: http://www.MYSITE.com/external.php?type=AIML
XML error: syntax error at line 1
Mijae
04-20-2004, 12:56 PM
My bot wont use smilies :(
mikeee
04-21-2004, 03:08 AM
Can someone help? I keep getting this error:
=========================
Loading learnwhat.xml
Loading data aiml file: http://www.MYSITE.com/external.php?type=AIML
XML error: syntax error at line 1
Sorry to bump this again but I really can use some help. Anyone have any clue what this error means?
InsaneContender
05-12-2004, 04:14 AM
It looks like you edited the file incorrectly.
InsaneContender
05-12-2004, 04:20 AM
I am as well having difficulties though.
I did all the file edits and everything correctly (I checked maybe 30 times)
and I am doing this off a fresh install (I only want him to learn what we teach 'em)
It says it loads everything, in the learner; the posts get moved - yet he still responds with his universal error message...
Is there anything I might have done wrong?
Database is clean too... hmmm...
InsaneContender
05-16-2004, 03:51 AM
*bump*
Geographic2
08-22-2004, 07:12 PM
Can someone help? I keep getting this error:
=========================
Loading learnwhat.xml
Loading data aiml file: http://www.MYSITE.com/external.php?type=AIML
XML error: syntax error at line 1
It means there is a problem with the AIML feed...
when you put http://www.MYSITE.com/external.php?type=AIML in your browser, what do you get for output?
It would help if you cut and pasted that output here...
It's probably something wrong with external.php, check your modifications there.
Or you are missing your stylevar charset... try changing the line above:
echo '<aiml version="1.0">';
to:
echo '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\r\n";
It says it loads everything, in the learner; the posts get moved - yet he still responds with his universal error message...
Is there anything I might have done wrong?
Database is clean too... hmmm...
What are the contents of tables pattern and template in the DB after you have run the botlearner?
Are you matching the questions exactly when you ask him?
Try matching just a single word.
See if it can correlate that.
So put in the post title: what
and in the message: huh
And see if it can match that up.
I haven't tried it from a clean slate, but I will give it a shot when I get a bit of time. Right now I'm without a testing version of my board.
ambrosious
08-28-2004, 12:22 AM
See below.
ambrosious
08-28-2004, 12:24 AM
Hang on, I do see a mistake, check back.
ambrosious
08-28-2004, 12:26 AM
See below.
ambrosious
08-28-2004, 03:23 PM
I must have been tired when I posted that, please look at 'this' code and see where I messed it up please?
Is there support for this?
// bot learning cycle
else if ($_REQUEST['type'] == 'AIML')
{ // XML/AIML output
$posts = $DB_site->query("
SELECT post.title, post.pagetext, post.postid
FROM post
WHERE post.threadid=http://www.adultadventurers.com/vbulletin/showthread.php?t=30093 AND post.postid!=http://www.adultadventurers.com/vbulletin/showthread.php?t=30093#post496060");
$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=http://www.adultadventurers.com/vbulletin/showthread.php?t=30094 WHERE postid=".$post[postid]);
}
echo "\r\n</aiml>";
}
else if ($_REQUEST['type'] == 'AIMLSHARE')
{ // XML/AIML output
$posts = $DB_site->query("
SELECT post.title, post.pagetext, post.postid
FROM post
WHERE post.threadid=http://www.adultadventurers.com/vbulletin/showthread.php?t=30094 AND post.postid!=http://www.adultadventurers.com/vbulletin/showthread.php?t=30094#post496062");
$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>";
}
/*================================================= =====================*\
|| ################################################## ##################
|| # Downloaded: 22:08, Sat May 22nd 2004
|| # CVS: $RCSfile: external.php,v $ - $Revision: 1.51 $
|| ################################################## ##################
\*================================================ ======================*/
Thanks for the help.
I've done verything without error
This is what I got when I ran the botlearner
Loading learnwhat.xml
Loading data aiml file: http://www.123.com/forum/external.php?type=AIML
could not open XML input
Any idea what is wrong here?
Thanks
94DROPTOPZ
10-22-2004, 10:50 AM
Has anybody else gotten this to work out for them with success?
94DROPTOPZ
10-25-2004, 03:24 PM
We have gotten this to work on my forums & is a great add-on!
Clicks install.
Although I am wondering if there is a way to put in "key words" such as dogs, cats, birds,fish, gerbils
And if somebody says any of the key words in a sentence "Do you like dogs?" Then it will come back with the responce that I programmed in??
peterska2
10-27-2004, 06:51 PM
Does it work with 3.0.3?
Are there any special instructions I need to be looking out for or things that I need to watch?
I don't have a bot on my localhost and don't want to risk killing my live one by trying it if the chance of success is low.
Sounds like a great addition but every time I run the botlearner script :-
DONE LOADING
Inserted 0 categories into database
WARNING! You should password protect the admin directory or remove the botloader.php script or people may be able to abuse your server.
Click here to talk to the bot
execution time: 0.220095
Templates per second=0
Templates per minute=0
Ok .. got the bot learning, but not transferring. Guess I can live with that and just delete the messages after running the botlearner script.
Solved it .. bot now learns and moves learned items into Botlearned category after running botlearner script.https://vborg.vbsupport.ru/external/2004/11/5.gif
bigtime
02-26-2005, 06:06 PM
I've got it working with VB 3.06. Just follow the instructions carefully and it will work! Here's my site if anyone wants to take a look.
Link for the talkerbot:
http://defend.net/deluxeforums/forumdisplay.php?f=42
Here is the link to my learning forum:
http://defend.net/deluxeforums/forumdisplay.php?f=46
username - testing
password - test
Tim
kylek
04-24-2005, 03:58 AM
"threadid numbers of both threads and the postid number "
Okay I know how to get the threadid but how does one find the postid number? Sorry for the newbie question.
kylek
04-27-2005, 11:37 PM
Loading learnwhat.xml
Loading data aiml file: http://www.xxxxxxxxxxxxxxxxxx/forum/external.php?type=AIML
XML error: mismatched tag at line 2
When I run botlearner I now get this, what do I need to look for?
laeth
05-05-2005, 06:16 AM
Loading learnwhat.xml
Loading data aiml file: http://www.xxxxxxxxxxxxxxxxxx/forum/external.php?type=AIML
XML error: mismatched tag at line 2
When I run botlearner I now get this, what do I need to look for?
Also getting this error.
kylek
05-13-2005, 11:45 PM
Also getting this error.
Just wondering if you figured out the tag problems Laeth, still can't get mine working.
jilly
05-14-2005, 07:10 PM
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?
jilly
05-19-2005, 07:13 PM
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)
kylek
06-06-2005, 02:47 AM
Loading learnwhat.xml
Loading data aiml file: http://www.xxxxxxxxxxxxxxxxxx/forum/external.php?type=AIML
XML error: mismatched tag at line 2
When I run botlearner I now get this, what do I need to look for?
Still getting this same error, reinstalled 2 times, and error pops up when I run botlearner.
Loading learnwhat.xml
Loading data aiml file: http://xxxxxx.xxx/forum/external.php?type=AIML
XML error: mismatched tag at line 2
Ambie
06-08-2005, 11:32 PM
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?
unixdotcom
10-28-2005, 05:58 AM
This was an easy hack to install, I got it to work, but there are potential problems:
The external.php URL in the botlearner.php routine has the potential to wipe out existing AIML files - a lobotomy!
The AIML transformation is too simple.... too basic.
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
GuaRRand
10-28-2005, 06:32 AM
Is there anything like this for 3.5 ?
bigtime
09-18-2006, 03:26 PM
Is this going to be available for 3.6.1?
eXtremeTim
09-21-2006, 10:11 AM
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.
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.
gpc10347
09-13-2008, 05:43 PM
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.
case 'XML':
if (!$vbulletin->options['externalxml'])
{
exit;
}
break;
// HERE'S THE BEGININNG MY MODIFICATION
case 'AIML':
{ // XML/AIML output
$posts = $db->query_read("
SELECT post.title, post.pagetext, post.postid
FROM post
WHERE post.threadid=**TEACH THREAD** AND post.postid!=**FIRST POST ID**");
$postcache = array();
while ($post = $db->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->query_write("UPDATE post SET threadid=**LEARNED THREAD** WHERE postid=".$post[postid]);
}
echo "\r\n</aiml>";
}
// HERE'S THE END OF MY MODIFICATION
case 'RSS':
$vbulletin->GPC['nohtml'] = 0;
case 'RSS1':
case 'RSS2':
Hope this helps someone else out!
space?
09-13-2008, 07:09 PM
nice one ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.