PDA

View Full Version : ProjectALA



LP
02-09-2005, 01:56 AM
Greetings everyone!
For my masters degree I started making a program that "learns" from written text. Then, it can use its knowledge database to spell-check, etc.

It's in early development stage and I've made a simple function that generates random phrases using knowledge obtained from text. The unexpected thing was that sentences resulted very funny!!!

Right now I've selected all text from PGD News page, pasted it to the pogram and it learned. Now here are random phrases generated from it:

1) "post mortem by ceo john carmack last week trip"
2) "i have the newest registered user requests in the offered playback engine planned"
3) "thus we all the quake translation women in english so that binds all major shading modes languages"
4) "afterwarp interactive has been no defined amount of moon"
5) "preperations for the man was born to help make the main portion of august"
6) "what can buy new wiki system for sure other great topics by sulaco s community is described as an enhanced webpage and excess folders in this weekend will free pascal available on pgd for the game development isn't notice yet"
7) "compatible with every new cars and members coming aswell"
8 ) "will free pascal in the articles in it s own berotracker seemingly unnoticed on pgd for musicians"
9) "what can be gradually reducing a hidden gem amoung the game you now several speed improvements in the creation of august"
10) "will be possible with armed vehicle fighting with your bank account grows you use render targets with asphyre"

If there is interest, I could upload my program :)
Cheers!

Traveler
02-09-2005, 07:48 AM
Sounds like a fun, but difficult project.
I'm not sure I understand what it is supposed to be doing though.
Should it give a summary of a given text?

Its an interesting subject though. Main question that comes to mind is how you make a computer to understand a text if it has no understanding of the words?

cairnswm
02-09-2005, 09:47 AM
I think its based on sentance structure and word association. So it can identify nouns etc and what adjectives can desribe those nouns. It can then build sentances based on the subject matter that sort of make sense :)

Balaras
02-09-2005, 10:55 AM
Hehe :)

Takes me back to good ol' mark v chaney :P

By all means upload. This sound like a cool project.
What methods do you use for learning and sentence generation?

LP
02-09-2005, 08:28 PM
The program at its initial stage "learns" from written text by identifying word associations, without having any knowledge about any specific word. The purpose of this project is the following:

1) Make phrases for some specific purpose (e.g. "Please, click here to continue") without having knowledge about that specific language. This will require to configure learned words with some sort of "decision marks".
2) Guess or find missing words (e.g. "I want eat" to "I want to eat"), again, language independent.
3) Get a vague idea of specific text (similar to (1), uses heuristics to determine the purpose)
4) Determine the language of the text: you give few words specific to one language and based on associations it propagates this information to the rest of known words.

Anyway, there are many more applications that can come out of this. The project is not easy and it will require a lot of processing and database queries.

Right now it can retreive basic word associations and based on that, generate a random sentence that may or may not have any sense in it (it may even be even incorrect).

Even now I took the text from this thread (and my current post), gave to the program and it generated the following phrase: "I started making a program at its an enhanced webpage and it is not have any specific word associations."

Since it takes completely random turns around the knowledge databases, the sentences can be cyclic, large or simply wrong. This is because there is no purpose for generating the phrase yet.

You can download the project from:
http://www.afterwarp.com/downloads/projectala010.zip.

Usage: copy text from somewhere, paste it to the "source text" box, press Add or Replace database and then "Generate".

Feel free to post any funny or other interesting sentences generated with the applicaion in this thread :)

Traveler
02-09-2005, 09:26 PM
Heh, this is quite fun :D

I used it on a story found : here (http://kids.mysterynet.com/solveit/)

:arrow: You can check to see who doesn't have an alibi between nine.
:arrow: I was a bummer all right.
:arrow: And max helped coach thornton replant the log book.
:arrow: Let's see who could have alibis.

Its pretty cool to see some sentences are contructed correctly.
:arrow: He turned off his eyes

Good idea. Time to get some sleep :)

WILL
02-09-2005, 10:12 PM
Hmm... well when I get some time I'll be playing with this. :)

Maybe you can find a way to incorporate some sort of NNA 'brain' to learn what combinations make more sense? Learning can be as simple as it reading the story, ask it a question and have it give you back a series of answers. You pick the 'best' questions out of a series... Eventually it 'in theory' would make more sense out of it's sentances. :)

WILL
02-09-2005, 10:21 PM
Hmm... thinking further on it...

It could be work on in two steps.

1st) Adapt the first NN to support proper sentence learning.

AND

2nd) Adapt a second NN to seperately learn how to properly address the question properly. :)

Both layers being independant, except for the obvious linking of the decisions to give back peoper information...

LP
03-09-2005, 02:06 AM
@ WILL: Indeed there are several techniques that can be applied to this. Additionally, something related to common sense would help construct more logical sentences. I'm still researching though...

I have googled for some joke stories and added them to database.

The results aren't that bad:
1) "I smiled and the girl he did the bed where he went out with."
2) "He was sick and got pregnant last night."
3) "You want me to call him and the man awoke as soon as he went through."
4) "The san francisco and i smiled and mop the one arm and i was sounding pretty badly in his own."
5) "My wife's being able to live by the phone."
6) "But you want him to have learned your lesson and milk and they always want me to work every day while my name definitely is she."
7) "They always want me as they also discovered something they are."
8) "The man awoke and the parents flew to help us."
9) "My son hung up the heart you got the phone."
10) "He went through so wrong number and snapped fresh beans for his wife."

What I'll try to do next is this: you give two words and it should create a sentence with both of them; or, you give two words and a number of words between them and it should attempt to find a match. Example: for input "John employee" it should say something like: "John is a good employee"; or for input: "Work fishing" it should say: "I'll go fishing after my work". Of course, the program is more creative than expected and would also give some crazy combinations nobody ever heard about...

Robert Kosek
04-09-2005, 11:47 PM
FABULOUS! This is one smart application!

Here's a few semi-intellegent ones I got (Programming Post, rec.games.roguelike.development):
1) When dealing with significantly reduced development has a script is the old method of all loaded through scripts.
2) That comes to the image initialization scripts.
3) A monster might look something like this.

They also seem to be majorly funny by normal generation. ;)

WILL
05-09-2005, 12:19 AM
I was playing with the FPCBot that Almidor, Pepe_Le_Pew and FPC_fan on #fpc are working on. And a few things came to my mind.

1) The AI should be able to make some distinction between a question "?" or a stamement or remark. "." and "!"

2) Some control must be laid out as to what can and cannot be said to the AI's learning routeen. ie. have it turn learn mode on and off will have some effect in improving it's learning pattern? For those of you that have kids, how many times do you have to watch what you say or what others say around them? And how much do you pay for it later when you cannot get them to 'un-learn' some really dumb thing?

3) The human brain has many layers of though. You have your logical brain that is very aware and is very active and easily manipulated. Then there is your more evolved and more sub-concious layers where it is relying on more instinct that concious deduction. If an AI is to truely have some thoughts towards what it is going to say, it may pay to have such layering in it's 'descition process'.

4) There is no punishment/reward system in a markov table. Which means that the two behave very differently. SO this may aid in a layer effect. The older layers of the brain that act as a concious... evolve this over time and it may be of some use rather than a babbling idiot. :) Then again a few 'private' english and grammar lessons would be required.

Balaras
07-09-2005, 10:19 AM
Programming Post, rec.games.roguelike.development
You know, apart from these forums, this is the one sure thing on my daily must read list. I've been a lurker for the last ten years, never even posted once :roll: , but lots of ideas and knowledge to harvest. Very smart people there.

Sorry for the OT, but if you do not subscribe to r.g.r.d you ought to :)

Sly
07-09-2005, 12:33 PM
Sounds a lot like Niall (http://www.spaceports.com/~sjlaven/niall.htm). I used to play with an implementation of Niall on the Amiga back in the early 90's.