| 07-05-2007, 12:54 PM | #1 | |
i've seen a couple of sourceforge projects about this but they seem to require a number of external files or they are in archive formats i do not use. Is there any simple way to programmatically identify the parts of english speech from a sentence, using a limited knowledge base? I want to have this ability because it would enable me to create a basic AI, which would be fun. This could probably be extended to warcraft III after its completion, which in turn would allow for more intuitive map designs. So does anybody know anything about doing this programmatically? (samples follow...)
With the recognition of each words purpose, they would then be checked against a seperate database which would contain a listing of words and what each word 'was' (like a good thing, bad thing, insult, neutral) and somehow, its actions. [in war3 there would be 3 additional databases; one that holds the words; one that defines the type of word; one that defines its actions] Once the parts of speech are identified then it would be possible to deconstruct each word that was not recognized to try and get some meaning from it. For instance you can look at destroyed: de|stroy|ed de is usually a bad occurence ed is usually past tense we now know that something bad has happened, even though we don't know what it is. I know this may seem like a long post but any ideas would be great! [so do you have any?] |
| 07-17-2007, 04:26 PM | #2 |
the easiest way would be just to use if statements with the chat string eg. (i dont know jass that much so this is exampole and wont work) if (entered chat string) contains (kill) then if (entered chat string) contains (red) then 'attack red code end if if (entered chat string) contains (blue) then 'attack blue code ... end if you get the idea. |
| 07-17-2007, 04:41 PM | #3 |
I don't have anything particularly concrete to say, but maybe looking into the arcane art of sentence diagramming would help you get started. |
| 07-20-2007, 06:05 PM | #4 |
umm, i was not talking about doing this for jass, i was talking about doing this for programming with a side possibility of jass conversion... and sentence diagramming only works because the diagrammer knows what each word is. A program with a limited knowledge base might not have a clue what a 'Planet' is but if the sentence was 'He flew around the planet.' then it could figure out that planet was the Object of the Preposition and Flew is a verb and He is the subject and The is an article. That is what i would like to be able to do, since you could base actions off of the part of speech a word is and what the meaning that is derivable is. (like 'He Destroyed the Bunker' could be known that 'He' did something bad to 'The Bunker' so we need to send troops to attack him. |
| 11-06-2007, 08:22 PM | #5 |
Breaking a sentence into discrete parts and then attributing them values does not result in "understanding". |
| 11-06-2007, 09:44 PM | #6 | |
Quote:
In a limited sense it does. Such that in the sentence "He destroyed the bunker." the context could be controlled by preprogrammed questions by npcs. Like "What happened over there?" Then will the negative idea of destroyed and the object bunker the npc would do actions to send troops there based on the words said. To answer to this thread, and I hope you will come back to read this... The best way would be making a list of all the words and being able to call apon them, thus displaying their grammar classification. The = article, house = noun Then when someone says "The house is on fire." The ai should be able to equate the as a sort of grammatical device (thus ignoring it) and the house as an object thus something to talk about,know, or understand. I have been experimenting with the idea of artificial intelligence and I can share more ideas through pms or someplace. |
| 11-06-2007, 10:50 PM | #7 |
Take a look at these if you want to learn about chat interactive AI's. http://windowsliveagents.spaces.live.com/ |
| 11-06-2007, 11:38 PM | #8 | |
Quote:
You need to make the leap from the generation of a parse tree, to the ordering of the troops. It is easy for us to say "well, 'the bunker' must mean the only bunker in the area and 'he destroyed' must mean that the enemy who precipitated the destruction of the bunker has changed the state of the bunker to 'destroyed'". It may be significantly less easy for a program to do this without incredibly complex coding. |
| 12-03-2007, 01:19 AM | #9 |
The main thing i need is to be able to take for example the sentence "Destroy any window named Untitled - Notepad'" or "Delete 'C:\abc.txt'" or "What is the size of 'C:\abc\'" and "Show window 'Untitled - Notepad'" and "Show file 'C:\abc.txt'" as well as "Run file 'C:\abc.txt'" (the same as show file) I imagine that you could have an index of the question words, but it would still be nice to understand yoda's commands. "'C:\abc.txt', Run, you must, file" which would require advanced deconstruction. The main implementation would be having a program and then as a help item a textbox where users could submit commands/requests to the application, which would parse the commands with a synonym system just in case the said 'destroy' instead of 'decimate' or 'decimate' instead of 'destroy' and so on. Then you have to recognized the Indirect object and then recognize the Direct object. Then you could apply the action to Indirect object with the Direct object as its guideline. -- Diagram of parsing -- "Give ten dollars to bob" __|_____|________ | action___|________| ________|____direct object ___indirect object so we now know that the action is to give, the object to be given is ten dollars and the person to give it to is bob. An example that would be incorrectly parsed (for a game) would be this... "Hit bob with a rock" it would miss the prepositional phrase, thus it would run over there and punch bob. Possibly making the player lose. So you would have to analyze the prepositional phrase to see what they modify and how they modify what they modify. |
