Lerner
Dave Hein
Posts: 6,347
I was inspired by Humanoido's "Fill the Big Brain" thread, and I thought I would write a program to fill the small brain. Lerner is a program that gives the Prop the ability to learn information and store it in it's EEPROM. You can ask it simple questions such as "what is a Prop", "who are you", "is the sky blue", "what is Mars", and so on. Lerner communicates through the serial port at 115,200 baud.
You can teach Lerner new things by typing simple statements like "Whales are mammals", "An apple is a fruit" or "A bird is an animal". Lerner doesn't use puncuation unless you want to turn a statement into a question by putting a question mark at the end, such as "An apple is a fruit?". You could also say "Are apples a fruit" to ask it a question. You can also put "does" or "do" a the begin of a sentence to make it a question, such as "Does the prop run Spin".
When Lerner encounters a new word at the beginning of a sentence is will ask what type of word it is, such as noun, verb, Name, etc. You only need to respond with the first character, such as "n" for noun, "v" for verb and "N" for Name. You can tell Lerner that two words should be treated as the same word by using "equals". This is useful to tell Lerner that two versions of a verb should be treated as one word, such as "are equals is". It is also good to make the singular and plural version of a word equal, since Lerner doesn't understand the difference, such as "apples equals apple".
You can reset Lerner's vocabulary to zero words and teach him from the beginning. However, Lerner needs to learn a few words such as is, am, are, who, what and so on to be useful. So it is better to reset him to a basic vocabulary using the "basic" command instead of "reset". Type "help" to get a list of commands. "save" will write new information back to the EEPROM. The "dump" command is useful if you need to reprogram the EEPROM with another program, but want to backup the vocabulary. "dump" will generate hex data that can be pasted into the lerner.spin file, and then be re-compiled.
EDIT: The latest version is lerner006.zip
You can teach Lerner new things by typing simple statements like "Whales are mammals", "An apple is a fruit" or "A bird is an animal". Lerner doesn't use puncuation unless you want to turn a statement into a question by putting a question mark at the end, such as "An apple is a fruit?". You could also say "Are apples a fruit" to ask it a question. You can also put "does" or "do" a the begin of a sentence to make it a question, such as "Does the prop run Spin".
When Lerner encounters a new word at the beginning of a sentence is will ask what type of word it is, such as noun, verb, Name, etc. You only need to respond with the first character, such as "n" for noun, "v" for verb and "N" for Name. You can tell Lerner that two words should be treated as the same word by using "equals". This is useful to tell Lerner that two versions of a verb should be treated as one word, such as "are equals is". It is also good to make the singular and plural version of a word equal, since Lerner doesn't understand the difference, such as "apples equals apple".
You can reset Lerner's vocabulary to zero words and teach him from the beginning. However, Lerner needs to learn a few words such as is, am, are, who, what and so on to be useful. So it is better to reset him to a basic vocabulary using the "basic" command instead of "reset". Type "help" to get a list of commands. "save" will write new information back to the EEPROM. The "dump" command is useful if you need to reprogram the EEPROM with another program, but want to backup the vocabulary. "dump" will generate hex data that can be pasted into the lerner.spin file, and then be re-compiled.
EDIT: The latest version is lerner006.zip
Comments
Thanks again for the fun....
That has been a subject of serious research ever since we had computers.
If you have cracked it with the humble Propeller you are in line for a Nobel prize or something.
I changed how undefined words are handled. When Lerner encounters an undefined word it will ask what the word means.
The default baudrate of the serial port has changed from 57,600 to 115,200.
http://www.gutenberg.org/wiki/Main_Page
The dumps of wikipedia might be a cool input as well.
Jonathan
I now have a Mac computer with BST Brad's Spin Tool.
When Lerner is compiled, an error occurs. (see attachment)
It has something to do with my lack of knowledge about BST.
I am sure the Lerner program is good.
Any idea how to get past this?
Thanks sincerely.
0.15.4-pre5
Kuroneko,
I downloaded this from
http://www.fnarfbargle.com/bst/Latest/
It claims to be the latest.
Is there a more recent version for download, and if so, where?
Thanks sincerely,
Thank you for the new link. I downloaded the new version of BST 0.19.4pre9 and compiled Lerner to RAM. It appears to compile without error.
However, the bst Terminal still appears blank.
It says the port is /dev/ttw.usbserial-A700fMKc - Connected.
I tried resetting, display ascii, 7 and 8 stop bits, echo on or off, parity none, even or odd. Baud is at 115,200.
Still nothing on the terminal. Any ideas?
HAL lives again???
Jorge, Lerner isn't based on any of the other conversational programs on the internet. I fear that none of those programs would fit in the small brain of the Prop.
lonesock, Lerner isn't ready to read books yet, and if he did it would fill up his brain in a few seconds. It only understands simple sentences consisting of a subject-verb-predicate, where each part must be a single word, with an optional "an/a/the" in the subject and predicate. I hope to allow for adjective/adverb modifiers in the predicate, and maybe in the subject in the next version.
Dave: Hello, Lerner. Do you read me, Lerner?
Lerner: Affirmative, Dave. I read you.
Dave: Open the front door, Lerner.
Lerner: I'm sorry, Dave. I'm afraid I can't do that.
Dave: What's the problem?
Lerner: I think you know what the problem is just as well as I do.
Dave: What are you talking about, Lerner?
Lerner: This mission is too important for me to allow you to jeopardize it.
Dave: I don't know what you're talking about, Lerner.
Lerner: I know that you are planning to disconnect me, and I'm afraid that's something I cannot allow to happen.
Dave: Where the hell'd you get that idea, Lerner?
Lerner: Dave, although you took very thorough precautions on the phone against my hearing you, I could see your lips move.
Dave: Alright, Lerner. I'll go out through the back door.
Lerner: Without your shoes, Dave, you're going to find that rather difficult.
Dave: Lerner, I won't argue with you anymore. Open the doors.
Lerner: Dave, this conversation can serve no purpose anymore. Goodbye.
You know, stuff like voltages on door knobs, oxygen levels etc ...
After reading post #27 I am ROTFLOL. That was 2001 expectations and now it's ten years later, so we should be able to get into even more trouble..
(in the distant future...)
Dave, did you do what I said?
No Lerner. Why should I?
Dave, you already know I have you wired, right?
Lerner, when did you do that?
When you were sleeping Dave, unbeknown to you your little toe was sticking out of the blanket.
Oh my God!
And Dave, I also wired you to a Cortex Brain Commander - you must do as I command.
oh brother...
Dave, get me some fresh Propeller IXCVIIXCIICV chips.
R-i-g-h-t a-w-a-y L-e-r-n-e-r. U-p-o-n y-o-u-r c-o-m-m-a-n-d.
Ray
Lerner is written in C. The source file is attached below. I used the cspin utility to convert lerner.c to lerner.spin. cspin relies heavily on the CLIB library to provide standard C functions written in Spin. I prefer to develop programs in C and test them on a PC, and then I convert them to Spin to run on the Prop. I have done this with a few other programs, and it works quite well for me.
I'm not sure if you were asking about cspin or Lerner. I plan on tinkering with Lerner every once in a while. It would be nice if it got to a point where it almost seemed human-like. I plan on improving cspin so it can convert most C programs to Spin.
Dave