The A.I. thread

Thanks, I did a really basic implementation, it's more to demonstrate the use of a decision tree. It's not the first time I've written something like that so it didn't take very long :p

You should maybe look up heaps, so you can get an idea of how to store tree structures in arrays, maybe it'll help you.



Check out 4shared you can sign in with a Google account/Open ID and get 5gig free storage.

Your code looks pretty sweet, when I was at Varsity all we did in AI was Prolog

Haha... That's mad.

Admittedly, it isn't the best code I've turned out. I probably should have functionised the evaluation and selection stages too, but I kind of got sidetracked with something else. Probably would be more illustrative :o
 
man, i have absolutely no idea what a heap is dequadin, even after reading it :erm:

and *blush* i'll even admit I have no clue what a binary tree is even. :eek:

but i'll get it right....

If it just has *Some* form of AI/realism and a bit of learning i've achieved my goal. :o
 
Fantastic thread and hope we all are able to learn and share awesome code and methods in implementing the use of AI in various areas.

Interface looks great Keeper !

Language
I think you need to decide what language you would like to code the AI thoughts, memory and responses in. I would opt for the standard natural language of AIML see for more info. Also read upon the use of XML files to understand the use of AIML better which is a deritive of XML.
I prefer using mIRC script as I have created some very powerful AI Bots using mIRC scripting that can calculate, can open any program on your PC, can keep an intelligent conversation, can store data to any format i.e .txt, .ini, sql db etc.. But unfortunately uses mIRC as the interpreter and parser. If someone could create a interpreter based on mIRC scripting I would be over the moon in glee :)
For you in your case I would definately settle for using AIML as your natural language as the output and function options are quiet adequate for what you would like to do.

Code:
[B]Example use of AIML[/B]
<aiml>

<category>
  <pattern>HI *</pattern>
  <template><srai>Hi</srai></template>
</category>

<category>
  <pattern>HELLO *</pattern>
  <template><srai>Hi</srai></template>
</category>

<category>
  <pattern>HI</pattern>
  <template>Hello how are you ?</template>
</category>

<category>
<that>Hello how are you ?</that>
  <pattern>* FINE *</pattern>
  <template> 
<random>
<li>Oh!! Just fine ?</li>
<li>Everyone says Fine, come be different</li>
<li>Fine, try be good :)</li>
</random> 
</template>
</category>
</aiml>

Editor
Then get yourself an AIML editor unless you prefer using Notepad or Notepad++(which I prefer by miles)

Interpreter/Parser
Now you need to decide what enviroment you are comfortable with i.e Java, Ruby, Python, C++, C#, Pascal etc.

For quick testing of the AIML files I would use J-Alice, it is dormant so I would code my main AI program in either C#/.Net, C++/Qt, PHP/mySQL or Java/J2EE

For some examples and free AIML sets get more info here

If you decide to use ProgramD(Java/J2EE) and it's listeners get more info here

Hope that helps Keeper and best of luck with your project.
I am busy coding an AIML interpreter/parser from scratch in C# using the aiml.dll library for the various outputs and functions I intend to use AI for and will upload examples when I feel I am ready to do so.

If anyone is able to look at the mIRC program and code an interpreter/parser for the mIRC scripting language I would be truly greatful as I believe that would create giant steps in the ability to use unlimited functions on various platforms as I believe the AIML language versus mIRC scripting is still somewhat limited.
 
Last edited:
man, i have absolutely no idea what a heap is dequadin, even after reading it :erm:

and *blush* i'll even admit I have no clue what a binary tree is even. :eek:

but i'll get it right....

If it just has *Some* form of AI/realism and a bit of learning i've achieved my goal. :o

ROFL! :D And I thought that I tackle ambitious projects. You've raised the bar.
But, like they say... the first step to learning to swim is to get into the pool
 
ROFL! :D And I thought that I tackle ambitious projects. You've raised the bar.
But, like they say... the first step to learning to swim is to get into the pool

well i've been coding on and off as a hobbie for like 10 years so i know a few things :p

@Kasbah - Thanx for the comments, just wait till it's complete!

I hope more of you guys get more involved in some small AI project, that we can show off in this thread :)

even if you can only code something with the brain capacity of a bug! :D

----

on the news side from me, i've thought about getting all the "brains" together from everyone who would like to contribute to it's knowledge, or that simply chats for a few minutes with the program - maybe an update option or something....

maybe I can enable it to have multiple personality's, where you pick one before you start - everyone could theoretically upload their own version with it's unique persona.
 
Last edited:
i'm currently busy with some other projects at the moment, but I do update my ideas for it and DO keep them in a file...

But err...this thread isn't about my project, it's a thread for everybody.......seems as i'm the only one to attempt stuff like this though?

I'll start working on it soon - will have a prototype ready in a month or so (not promising anything)
 
AI coding has always fascinated me. I think when programming AI its helpfull to think about how the human brain works. We deduce answers and respond to circumstances based on past experiences which is stored as millions of pieces of information.

A simple example would be when you get an unexpected knock on the door. You're brain immediately digs into your database and in a split second you traverse through dozens of events throughout the week or month to think who might've said they going to visit. And while you're brain is doing this, it does a split second memory read and tells you to do a quick 10 second cleanup if you're house is not tidy, if you're not decent, if you're house is in order to receive whoever it might be. If your brain deduces that you receive a phone call from you're brother on Wednesday telling you he visited then you won't bother and you're brain will immediately skip the above steps and you'll simply go and open the door.

However, if the visit is unexpectant, you're brain will trigger off another split second memory scan of everybody who's told you to be carefull of simply opening the door, or every news article you've read of people who might try to rob you and, depending on what you're database deduces based on you're environment, your brain will kick in the chemical adrenalin telling you to be on alert.

All this happends in less than a second. One could almost chart these kinds of responses onto a white board although it would take a pretty big white board! :)
 
AI coding has always fascinated me. I think when programming AI its helpfull to think about how the human brain works. We deduce answers and respond to circumstances based on past experiences which is stored as millions of pieces of information.

A simple example would be when you get an unexpected knock on the door. You're brain immediately digs into your database and in a split second you traverse through dozens of events throughout the week or month to think who might've said they going to visit. And while you're brain is doing this, it does a split second memory read and tells you to do a quick 10 second cleanup if you're house is not tidy, if you're not decent, if you're house is in order to receive whoever it might be. If your brain deduces that you receive a phone call from you're brother on Wednesday telling you he visited then you won't bother and you're brain will immediately skip the above steps and you'll simply go and open the door.

However, if the visit is unexpectant, you're brain will trigger off another split second memory scan of everybody who's told you to be carefull of simply opening the door, or every news article you've read of people who might try to rob you and, depending on what you're database deduces based on you're environment, your brain will kick in the chemical adrenalin telling you to be on alert.

All this happends in less than a second. One could almost chart these kinds of responses onto a white board although it would take a pretty big white board! :)

Actually, a situation like the one you describe is largely deterministic, and not "intelligent" at all!

What happens if a situation occurs with which the program has no prior experience?

It's easy enough to make something that takes an endless amount of prior experience and regurgitates an output if one fits, but then the hardware becomes the limitation (i.e. storage capacity and processing speed). But such a system would not be very useful. In fact, humans usually don't act in the optimal way! So why create a system to emulate humans when we clearly have enough suboptimal beings on the planet? ;)

Rather, the goal is to create a system where you can say

Code:
Input0: 1 + 1
Output0: 2

Input1: 2 x 3
Output1: 6

InputX: ∫x dx ; 0 < x < 2
OutputX: 2

Now whether it does this by extrapolating ideas from your training set, or by using general problem-solving techniques, I think we can all agree that things like this can usually be considered "intelligent".

AI is such a broad field at the moment, with ideas coming from almost all branches of mathematics (probability theory, combinatorics, number theory), philosophy (on how beings reason), sociology (on how beings interact), biology (evolutionary computation), physics (physical models and their applications to computing, e.g. simulating annealing), etc.
 
ah, I see I have a rival here :p

care to post a few of eliza's abilities? (just for interest's sake)

good work man

? hello
HOW DO YOU DO--PLEASE STATE YOUR PROBLEM.
? i'm addicted to mybroadband
DID YOU COME TO ME BECAUSE YOU ARE ADDICTED TO MYBROADBAND?
? what should i do?
WHY DO YOU ASK?
? because you said you can help me
WE WERE DISCUSSING YOU-- NOT ME.
? you are useless
WHAT MAKES YOU THINK I AM USELESS?
? you can't give any real answers
OH, I CANT GIVE ANY REAL ANSWERS?
? why are you repeating me?
WHY ARE YOU INTERESTED IN WHETHER OR NOT I AM REPEATING ME?
? you should have change the me to you
YOU'RE NOT REALLY TALKING ABOUT ME, ARE YOU?
? no i'm not
HOW LONG HAVE YOU BEEN NOT?
? since you are an idiot
DOES IT PLEASE YOU TO BELIEVE I AM AN IDIOT?
? yes it does
ARE YOU SURE?
? would you like me to commit suicide?
WE WERE DISCUSSING YOU-- NOT ME.
? should i commit suicide?
YOU ARE BEING A BIT NEGATIVE.
? you are being stupid
PERHAPS YOU WOULD LIKE TO BE BEING STUPID?
? you are the worst AI ever!
DO YOU SOMETIMES WISH YOU WERE THE WORST AI EVER?
? bye

it might still need some work. :rolleyes:
 
it might still need some work. :rolleyes:

Hmmm, ok guys im am probably the N00best n00b around so please don't get angry. I just want to know does "eliza" generate those words buy "her"self or did you throw in a bunch of if statements with words(strings) "she" can put together depending on you last and 1st word?:o
 
Rather, the goal is to create a system where you can say

Code:
Input0: 1 + 1
Output0: 2

Input1: 2 x 3
Output1: 6

InputX: ∫x dx ; 0 < x < 2
OutputX: 2

Now whether it does this by extrapolating ideas from your training set, or by using general problem-solving techniques, I think we can all agree that things like this can usually be considered "intelligent".

AI is such a broad field at the moment, with ideas coming from almost all branches of mathematics (probability theory, combinatorics, number theory), philosophy (on how beings reason), sociology (on how beings interact), biology (evolutionary computation), physics (physical models and their applications to computing, e.g. simulating annealing), etc.

WolframAlpha FTW? Their math engine is amazing.

dade said:
it might still need some work.
It would also be nice if Eliza didn't shout at you the whole time :)
 
So i'm working on this problem to concoct cocktails.

The data files looks as follow for several recipes. (this is just some of the dataheaders)

RECIPEID, STYLE, INGREDIENT, COOKMETHOD, QUANITY, INGREDIENT2, COOKMETHOD2, QUANITY2

I was thinking about approaching as follow.

1. Group the data per ingredient linked to the style.(group includes, ingredient, quantity and cooking method)
2. Work out the probability using Bayes Theorem for each group to appear in the specific style.
3. Train model based on the recipes and probability.
4. Apply model, user gives style and then it will automatically concoct a cocktail.

I've chosen to use groupings per ingredient instead of using the individual variables for every recipe and style, would this be considered as a bad choice?

How would you have approached this instead?
 
Cool thread. I was lucky enough to qualify with an AI degree abroad, but mostly focussed on machine learning (ML) & natural language processing (NLP). I was lucky enough to previously work @ Google on part of their speech recognition pipeline - 'Ok Google' - which uses a lot of AI.

Feel free to message me if you want to chat more. I have set up a few learning materials for programming some simple NLP and ML algorithms in Python.
 
Top
Sign up to the MyBroadband newsletter
X