[ABD] Forum AI v0.2.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony » Mon May 26, 2003 10:14 pm

I'm gona teach my bot to 1337!!!
I've Been Banned!

parad0x
Registered User
Posts: 93
Joined: Fri Apr 18, 2003 12:41 am
Contact:

Post by parad0x » Mon May 26, 2003 10:52 pm

preg_replace does come with a performance hit over using str_replace, that much is certain. It never has been an issue on my board, but then again, I have never had my bot respond to a very long post. A couple of things I would be curious to know ...
  • How long is one of the posts that timed out?
    How many active members on your board?
    What are the server specs (processor speed and memory)?
It may be that it is just too much work for your server to do the preg_replace routine on larger posts within the alloted time.

I just did some testing and you are correct. It looks like the 4 preg_replace might just be too much for the average server. I had never run into the problem as my bot has a very limited run on my board, and when she deals with a post it is usually a very small one. I knew it would be a performance hit, but I had no idea it would be this bad :cry:

The processor pegs at 100% until the sequence is completed, and anything over a page full of text will time out.

Oh well, I tried :? It works well, you just need a mainframe to run it, it seems 8O Well, I am open for suggestions on this. There has to be a way around this, doesn't there?

thanks for the input transwarp™

zemaj
Registered User
Posts: 267
Joined: Thu Mar 07, 2002 3:58 am
Location: Australia
Contact:

Post by zemaj » Tue May 27, 2003 7:07 am

Subforums *should* work fine with it. Try it and see.

-zem

User avatar
transwarp™
Registered User
Posts: 92
Joined: Fri Jul 19, 2002 11:34 pm

Post by transwarp™ » Tue May 27, 2003 8:53 pm

Code: Select all

Fatal error: Maximum execution time of 30 seconds exceeded in /home/u-t-ocom/public_html/UTO-HOME/mods/iai/includes/iai_functions.php on line 1555
Just happend again !! I'm the only active at this time and it happens between 30% and 38% of Page loading ! But this is really long ! I know this Server has no time out limit at this short times, so I don't know how this error was come !!

I replaced this new SUB.INC here posting much earlier and got everytime this message ! - I replaced the Original again and only getting sometimes this one if having some BB Codes inside or so I think ??

This AI System is an Main part of the forum and included anywhere !! And if an Members would posting something an Guide or something, it could happen all the times !! Maybe need back to the older version if not running or using your first litte code to try fix !!

Hope for an update and an newer version with smilies also too for this kind of AI system !!

Oh and ZEMAJ: Yes we know it works, but the subforums did not show up into the ACP AI control to check for any forum there. You only can set for the Subforum and all included Forums maybe will get the same settings ! This was, what I talking about.
- TERRA OCEANICA -

parad0x
Registered User
Posts: 93
Joined: Fri Apr 18, 2003 12:41 am
Contact:

Post by parad0x » Tue May 27, 2003 9:16 pm

@transwarp™ I'm afraid you would be better off to remove my code for the time being. My solution seems to cause more problems than advantages at the moment. It just requires way too much processing power to execute properly.

The earlier code (while not nearly as effective) is fine to use as it only uses the str_replace and doesn't have the performance hit of the latter. There is nothing wrong with the original code that zemaj had there. I was just looking for a way to allow the bot to post correctly formed URLs, where before it would throw a space in after each period(.) If that doesn't concern you, you can skip my code all together ... if it does, I'm afraid this is the best I have so far:

Code: Select all

# 
#-----[ Open ]------------------------------------------ 
# 
mods\iai\includes\iai_functions.php 
# 
#-----[ FIND ]------------------------------------------ 
# 
   $finalanswer = str_replace(".", ". ", $finalanswer); 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
   $finalanswer = str_replace("www. ", "www.", $finalanswer); 
   $finalanswer = str_replace(". com", ".com", $finalanswer); 
   $finalanswer = str_replace(". org", ".org", $finalanswer); 
   $finalanswer = str_replace(". net", ".net", $finalanswer); 
# 
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------- 
# 
# EoM
I'm a bit swamped with work and my own MOD at the moment, but I'll see if I can come up with a better solution (if there is one) when time permits.

I'll edit my earlier post to reflect our findings. Thanks for the input again, and sorry about the trouble :oops:

User avatar
transwarp™
Registered User
Posts: 92
Joined: Fri Jul 19, 2002 11:34 pm

Post by transwarp™ » Tue May 27, 2003 9:28 pm

There is no way to appologize about. You did nothing wrong and could not think about all issues could happen. So this is only for the URLs ?? Seems some other changes I read here and uploading some new AIMLS just improved the system again ! First I was thinking it was your code doing this one 8). We will see how it works and I will test this SUB.INC file again, if this could do some improve changes to the wrong chars and smile codes it is putting out ! But since your code update this smilie codes disappeared ? So I was thinking about an nice work for this MOD so far.
- TERRA OCEANICA -

njivy
Registered User
Posts: 48
Joined: Mon Aug 27, 2001 6:51 am
Contact:

Post by njivy » Thu Jun 05, 2003 3:54 pm

mr.luc wrote: couple of questions:
i installed the mod to keep the bot from posting when deleting!!!
it didn't really work. she kept on posting even if i deleted her last post!

so i came up with this one that seems to work at least for me:

in posting.php find:

Code: Select all

			// START IAI response and entry to db (if active)
			if ($run_iai)

BEFORE ADD:

Code: Select all

			if($mode == 'delete') {
				$run_iai = FALSE;
			}


That's a great idea, mr.luc. But to save processing power try this (still in posting.php):

Code: Select all

------------------------------------------------
FIND:
                                for($i = 0; $i < count($res_words); $i++)
                                {
                                        $words = str_replace($res_words[$i] . " ", " " . $res_words[
$i] . " ", $words);
                                        $words = str_replace(" " . $res_words[$i], " " . $res_words[
$i] . " ", $words);
                                        for($g = 0; $g < count($words); $g++)
                                        {
                                                if($res_words[$i] == $words[$g])
                                                {
                                                        $run_iai = TRUE;
                                                }
                                        }
                                }
------------------------------------------------
REPLACE WITH:
                                if( $mode != 'delete' ) 
                                {
                                for($i = 0; $i < count($res_words); $i++)
                                {
                                        $words = str_replace($res_words[$i] . " ", " " . $res_words[
$i] . " ", $words);
                                        $words = str_replace(" " . $res_words[$i], " " . $res_words[
$i] . " ", $words);
                                        for($g = 0; $g < count($words); $g++)
                                        {
                                                if($res_words[$i] == $words[$g])
                                                {
                                                        $run_iai = TRUE;
                                                }
                                        }
                                }
                                }
------------------------------------------------
One more thing to save some processing power. Add a break; to escape the to processor-heavy for-loops. After $run_iai is set to TRUE the first time, we don't need any more checking.

Code: Select all

------------------------------------------------
FIND:
                                                        $run_iai = TRUE;
------------------------------------------------
AFTER ADD:
                                                        break 2;
------------------------------------------------

User avatar
L0cke
Registered User
Posts: 426
Joined: Sat Aug 24, 2002 7:57 pm
Location: Missouri

Post by L0cke » Fri Jun 06, 2003 2:44 am

After I installed the iai_cron.php methon (one that doesn't actually use a cron process, but is used on page_tail.php), replies on threads are no longer counted if made by my bot. So the thread will only count 5 replies when there are 10, because the bot posted 5 of those 10. So how can I make the post count my bot's replies as authentic replies?

User avatar
L0cke
Registered User
Posts: 426
Joined: Sat Aug 24, 2002 7:57 pm
Location: Missouri

Post by L0cke » Fri Jun 06, 2003 2:57 am

Bah, her post count isn't increasing either. Nor her points. :(

njivy
Registered User
Posts: 48
Joined: Mon Aug 27, 2001 6:51 am
Contact:

Post by njivy » Fri Jun 06, 2003 3:55 am

it would be nice, IMHO, if iai_cron.php used phpBB's submit_post() ;) ;) might save some coding, but there may be a special reason for the redundancy. who knows

User avatar
L0cke
Registered User
Posts: 426
Joined: Sat Aug 24, 2002 7:57 pm
Location: Missouri

Post by L0cke » Fri Jun 06, 2003 4:51 am

Helps if I remove the comments from iai_upate_stats(), no? I'm sofa kingdom. Thanks to the njivy for the help! :D

User avatar
L0cke
Registered User
Posts: 426
Joined: Sat Aug 24, 2002 7:57 pm
Location: Missouri

Post by L0cke » Fri Jun 06, 2003 5:11 am

I still have problems with her intelligence. I have most AIML files installed. Basically Anna, Alice Standards, and some phobias and stuff (mostly the references provided by parad0x). But she's still dumb.

Example

Locke: Indie, why do I get the feeling that you're lying to me?
Indie: I don't have any reason to why do he or she get the feeling that you are lying to you.

And sometimes..

Locke: Hey Indie..
Indie: " "Me? Locke? What is your question, seeker?

And almost always..

Certain user: So what happens if I press this button?
Indie: Interesting gossip; do you mind if I tell what are you happens when button if you press button?

Just really random stupid crap.. And she has AIML files. Loads of em.

mr.luc
Registered User
Posts: 213
Joined: Mon Feb 24, 2003 4:09 pm
Contact:

Post by mr.luc » Fri Jun 06, 2003 7:40 am

hey! its a bot!
and will remain a bot.

to many files are not really good, i think it is better to have fewer, but good ones.. example:
anna has hard coded that she lives in atlanta
alice takes the location from the control panel.
if you have both installed it depends which you installed first and if you overwrote templates. but if the template is slightly differnt.. and you have NYC as location in your cp, she will sometimes say she's from new york, sometimes from atlanta, depending how the question was written.

i tested your sentence:
me: so what happens if i press this button
betty: Um, Try it.
variation:
me: what will happen if i press the red button
betty: I cannot predict the future.

in the second example she always gives the same answer... so i asked:
me: why are you repeating yoursel
(i forgot the f in yourself)
betty: I am not repeating myself too much. I am just checking to see if you are a robot.


she comes up with realistic answers for things:
example:
mike: www.xxxx.com The Photography Community would like to invite everyone over to the site... great place to get honest feedback from working pro's in the industry, ask questions, get tech help on gear, seek assistance in buying new gear. also have monthly photo assignments.

betty:Thanks for the link, I will check it out later.

actually on my forum, a some guys designed special photos for her. and as she answers pm with a 10 to 20 minute delay, people think she's crazy, but think she's real.

User avatar
L0cke
Registered User
Posts: 426
Joined: Sat Aug 24, 2002 7:57 pm
Location: Missouri

Post by L0cke » Fri Jun 06, 2003 8:00 am

I know she's a bot. That's what I want. A bot. Not a parrot.

I'd just like to find out what causes her to repeat the sentences so much. I'd be content with her idiocy if she didn't constantly just rephrase the question and leave it at that. lol :)

I have the Anna files and the Alice files, but I don't mind the stuff about her location. I just want her to be able to conjure up decent to half coherent sentences (she's getting better), and not repeat others so much. She's a very large part of my community.

Also, many of us wondered, does she really learn? Like, more than just names and last conversations, but like, actually learn to say things based on what the community talks about? Because over a period of time, it seemed as if she was getting smarter without new AIML files.

mr.luc
Registered User
Posts: 213
Joined: Mon Feb 24, 2003 4:09 pm
Contact:

Post by mr.luc » Fri Jun 06, 2003 2:19 pm

she does.. get smarter but you have to spend lots of database space on her!

Do this simple test:
ask her:
what is my husbands name?

if you have never asked before she will answer something very incoherents with html tags in the answer...

then you tell her:
my husbands name is george.

--> she will answer something like: when do i get to meet george.

-> then you repeat your first question:
what is my husbands name?

she then will give you a correct answer.

===> she learns because she logs all conversations.

If you clear the conversation log in the dbase her intelligence is back to scratch. (at least that is what i understood)

Locked

Return to “[2.0.x] MODs in Development”

Who is online

Users browsing this forum: No registered users and 19 guests