language for non gaming ai

Started by
11 comments, last by blackplasma 16 years, 2 months ago
hi, i wanted to delve into the world of AI,and i had the idea of creating a small self learning AI program. Basically what it does is learn how to speak by communicating with users through a text box. The program itself is made up of two programs. One is just for operating the other. What i mean by this, is that the first program edits the code of the second to correct or modify existing code. for example if the ai spat out a sentence like (the apple i ate.) i would correct the sentence to (i ate the apple.) the second program will signal the first to modify its code to produce a sentence with proper grammar. I will not go into details because my question is this: the first program is going to either be written in java or c++ so when it is compiled it can not be changed codewise. for the second program i want to use should not need to be compiled because it is always going to change thus compiling is going to slow it down. What do u recommend? ( i was thinking of html, but i am hoping for alternatives) thank you.
Advertisement
Unless, instead of rewriting the program, you were simply to rewrite the grammer rules that it has learned. The rules could then be processed all the time without recompiling.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

uh html isn't a programming language. do you mean &#106avascript? Lisp has been traditionally used in AI and supports just what you are talking about while the program is running. It is called Macros in there language.
I recommend you begin with something simpler. Why is it everyone beggining AI wants to do crazy learning schemes?

If you insist on going on, use scheme, its great for symbol manipulation.
You can do AI in any language you want. The classical AI languages are LISP and Prolog, though. Chances are, unless you are very advanced at the language of choice, that you get stuck in issues concerning how you represent classical AI structures in you language and API. Hence the specialized languages.

Prolog, for example, makes the creation of parsers comparatively easy and allows you to outsource your grammar into a file that you can maintain without changing the actual program. This, however, assumes that you are familiar with parsing, context-free grammars and general techniques of logic programming.

As to your project, I highly recommend you read into the basics of Natural Language Processing.

To cut it short: Unless you intend this to be a pure fun project, expect to face a serious threshold to overcome.
@InnocuousFox yeah all i want is to rewrite the grammar rules.


@Steadtler my program starts simple. First i give my program three sets of words each set containing a subject a verb and either i/me (one set would be i, ate and apple) so first it randomly gives me a combination of the words where it would use a or an depending on the noun it uses starts with a vowel or not. then if it was wrong i would correct it and then writes/rewrites the grammar usage rule in its non compiled code. Then i would tell it to do the second set. Now with a new rule it has less chance of making mistakes and so on. Then when i do this i start making more advanced features. I start making a database for new words, their usage and what other words are associated with them. one step at a time.
It sounds like you want to just write this stuff in Prolog.

But two hard questions that you should probably think about:

1, for any correction you do, there are many possible rules that are consistent with that correction. How does it know which rule to use?

If I give the system three sentences:
1) "the apple i ate." (which you correct to be "I ate the apple")
2) "the car i drove." (should be "I drove the car")
3) "he and i agree."

It might just learn that "if the third word is 'I', then put the third and fourth words at the beginning". Then it would change sentence 3 to "I agree he and".

2, How are you going to handle the incredible computational demands of solving this system once it learns more than 10k to 100k rules? The phrase "combinatorial explosion" applies here.
@pinacolada the answers are as follows.
1: Well basicly i drove the car is complete sentence, while the car i drove isnt. secondly it will not look at word position as the number of the word but with reference to other words (eg before a noun(subject) or after)

2:AS i said imm starting small, but when it reaches to that many rules i wiil do the following(atleast thats what im planning):

1- divide rules into different types eg. one set for the usage of conjunctions(and, but, so, because etc..) so whan it comes to using a conjuction it only searches for rules having to do with conjunctions. Another set would be for the usage of i,me, he, she etc...
so basically it doesnt try to apply each rule at once.
oh and one more thing. If for example i wanted,after succeeding with my primary goal, to go a little further maybe like speech synthesis or maybe by doing certain commands like writing a text file, is it possible in prolog.
Quote:Original post by blackplasma
@pinacolada the answers are as follows.
1- divide rules into different types eg. one set for the usage of conjunctions(and, but, so, because etc..) so whan it comes to using a conjuction it only searches for rules having to do with conjunctions. Another set would be for the usage of i,me, he, she etc...
so basically it doesnt try to apply each rule at once.


... again, read about NLP before you tell people how easy this is supposed to be.

Your grouping of rules into subjects idea is essentially a division of the production rules according to the Nonterminal symbols that they use. If you do not know what Nonterminals and production rules are, go and read about context-free grammars.

To answer your last question: Yes, you can write text files in Prolog. What you mean by speech synthesis is unclear to me. If you want to take a brief glimpse as to how parsing stuff works in Prolog on a small English example, check out the following link:

http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/7_2.html

Don't get us wrong here. We're not trying to kill your enthusiasm. But the bulk part of AI (or CS in general) is to understand the real-world problem and conceptualize your model before you start coding.

This topic is closed to new replies.

Advertisement