JavaScript AI Mind Programming Journal
AI4U Blog -- Tues.19.AUG.2008


1. Outposts of Artificial Intelligence en Route to AI Mind Installations

[ ] Use differential activation in audRecog to recognize word-stems.
[ ] Prime the JSAI to traverse its KB and ask questions about gaps.
[ ] Make Tutorial mode show slosh-over concepts about to be selected.
[ ] Program the JSAI to think on its own at start of running the AI.
[ ] Induce Stephen Reed to build TexAI on the MindForth AI engine.
[ ] Achieve proper balance of determinants of conceptual activation.

[16may2008] In reEntry() implement the "upnext" MWA code from MindForth.
[17may2008] From the verbClear() module fashion a verbClip() module.
[ 16aug2008] Bring JSAI audRecog up to par with MindForth audRecog.
[ 19aug2008] Enable audRecog to recognize plural forms of singular nouns.


2. Mon.18.AUG.2008 - audRecog WORD-STEM RECOGNITION

Today on Mon.18.AUG.2008 we would quickly like to see
if we can get audRecog to recognize a word-stem within
a plural noun, so that the AI can identify a singular noun
within a plural form. We have been working with the JavaScript
AI (JSAI), but we figure that it may be easier to develop,
test and debug the new audRecog feature in Forth than in
JavaScript.

We might introduce a singular noun by saying,
Dogs chase a cat.
Then we can say,
people like cats
and see if the AI will recognize "cat" within "cats".

Possibly the AI will develop two separate concepts,
one for "CAT" and one for "CATS". We might then need
to code a takeover mechanism that takes the psi concept
number of the singular noun and uses it to forcibly
replace the psi concept number of the plural noun.

We already know that audRecog can easily pick out
psi ultimate-tags found on any auditory phoneme during
pattern-matching. We could test the auditory ctu
continuation flag for a non-continuation psi that
becomes the value of a "subpsi" or other variable.
If the "subpsi" were "CAT", but the word "cats" is
coming in, then two possibilities emerge for our
consideration: that the AI knows, or does not know,
the plural form of "CAT". If the AI does not know
"CATS" but does know "CAT", then we could simply let
"CAT" be activated as the recognized word. However,
if the AI system knows both CAT and CATS, we could
have audRecog report one recognition of a word, or
report two recognitions but with differing activation
values -- even a higher activation on CAT and a lower
activation on CATS. In any case, we would like to have
the AI do what a human brain could probably also do --
nothing too contrived or too complicated or in violation
of Occam's Razor.

For a word like "bookcaseshelf", we might eventually
want the AI to recognize all three conceptual morphemes
contained in the compound word. However, we are first
designing audRecog routines that will handle only initial
parts of words from the very beginning, and not morphemes
that start after the beginning of a word to be recognized.

We probably do not want to throw away the "S" at the end
of "CATS" as a plural form, even if we get audRecog to
recognize the "CAT" concept within the plural form. But
what should we do with the "S" ending?

To the perceiving human mind, there is a big difference
between "Do you like chicken?" and "Do you like chickens?"
The first is a question about food, and the second is a
question about animals.

Bingo! We might have to have special forms of the Activate
module to receive multiple reports from future versions of
the audRecog module. There could eventually be modules to
activate "subpsi" concepts, and "infix" concepts, and
first, second or third component-morpheme concepts.
After all, the result of recognizing a concept is the
activation of that concept.

The most basic (general) situation is probably when the AI
has heard both the singular and plural forms of a noun.
If so, our current AI Minds may recognize both a "subpsi"
and a psibase concept. We could have both be activated,
perhaps favoring one over the other.

In cases where the AI knows the singular noun, but has
not recently or ever heard the plural form, we would like
to activate the "subpsi" concept for sure. Then there is
the question, should a new concept be instantiated for the
plural form of the noun? We could let Instantiate do its
work, but with the "subpsi" concept number. Bingo! In that
way, the plural form would have the same concept number as
the singular form. The "S" ending on the plural form would
be another matter, something requiring a semantic solution.

In audRecog, it would be rather simple to keep track of "subpsi"
and then turn "subpsi" into a reported "psi" recognition if
an unfamiliar plural input caused no known psi to be reported.
We might need to prevent a short "subpsi" component from being
reported as the same concept of a much longer plural. For instance,
we would not want a CAT "subpsi" to be reported by audRecog as
a recognition of the word "catalogs" during user input. We can
imagine a human asking, "Do you have catalogs?" and the AI
answering, "A CAT IS AN ANIMAL." Then the human user might say,
"A catalog is a book."


3. Tues.19.AUG.2008 - MORE IDEAS ON WORD-STEMS

Although yesterday we were thinking of coding MindForth
in order to try out the new ideas for word-stem recognition,
today we realize that we can easily make minor experiments
with test variables in the JavaScript AI (JSAI). Once again
over the lifetime history of the Mentifex AI project, we
probably have a situation here where making the first
primitive move towards word-stem recognition will give us
something to react against and will lead to a wide branch-out
of sophistication and functionality in the AI Mind source code.

We have been realizing today that we could create a whole queue
of morpheme variables ready to hold subpsi recognitions of
word-parts with a length of anywhere from one character up to
a reasonable estimate of how long a word of input might come in.
We could easily start with about twelve such morpheme variables
just to see if they do the job, and then add additional variables
with higher ordinal identifiers, such as "morph13" and "morph14",
so as to accommodate really long words that might come in.

Towards the end of the audRecog source code, we would test
for any values present in the uppermost range of the morph-queue,
where any word-stem found would be most similar to the incoming
whole word by dint of being closest in length to the input word.
The lower ranges of the morph-queue might not be very useful
at first, but their early presence might become a point of
departure for future efforts to break input words down into
the constituent elements ( morphemes) of compound words.


4. Tues.19.AUG.2008 - PREPARING TO RE-CODE audRecog

In our actual JSAI audRecog source code, where should we
first insert a variable to catch hold of a word-stem
that is followed by "S" at the end of a plural noun form?
We could tentatively use a "subpsi" variable that catches
all penultimate psi ultimate-tags in auditory memory, so
that the value held in "subpsi" might be updated several
times during an audRecog sweep through auditory memory,
but the final "subpsi" value would be for a word-stem
closest in length to the input word being recognized.
Then we need a way for audRecog to report the "subpsi"
to the rest of the Mind, and a receiving module to act
upon the subpsi report from audRecog.

Actually, audRecog reports "subpsi" just by assigning a
value to "subpsi". Of course, there could be a hand-off
where the final audRecog "subpsi" value is transferred to
an output-report variable such as...? What would be a good
name for such a tentative word-stem report variable?
How about "morphpsi" as a report-variable, so as to guide
future development towards dealing with the breakdown of
long compound words into multiple morphemic elements?

Now, the quick and easy way of proceeding is to avoid
the problem of creating a receiving module for "morphpsi"
by simply transferring the "morphpsi" value to the "psi"
of output from audRecog -- especially if audRecog has
failed to find a "psi" concept simply because the AI Mind
specimen has not yet heard the plural form of the noun
entering the auditory memory channel. If we adopt this
exploratory algorithm, albeit tentatively, we may have
designed a very simple test for a very simple introduction
of innovative new code for the auditory recognition of
noun-stems lurking inside plural noun forms. Now let's
write some open-source AI code!


5. Tues.19.AUG.2008 - CODING THE JSAI

First we create a file of the 19aug08A.html version of the
JavaScript AI Mind and we carry on the following baseline
conversation with the AI to see how the AI deals with the
input of first the singular noun "book" and then the word
"books" as a plural form of the same noun. We shift the AI
into Diagnostic mode in order to see what psi concept numbers
the software is assigning to each word of input by the user.
Human: cats eat fish
Robot: FISH WHAT
Human: fish eat bugs
Robot: FISH EAT BUGS
Human: bugs eat germs
Robot: BUGS EAT GERMS
Human: germs kill cats
Robot: CATS EAT FISH
Human: i have a book
Robot: YOU HAVE FEAR
Human: i like books
Robot: BOOKS WHAT
Human: books teach people
Robot: PEOPLE HAVE FEAR
(mental function suspended)
When the human (Mentifex, in this case) says, "i have a book",
the software assigns the psi number 82 to the "BOOK" word.
When the user says, "i like books", the plural form "BOOKS"
gets the psi concept number 84, because audRecog can not yet
recognize "book" as a noun-stem of the input word "books".
(The psi number 83 has been assigned to the verb "like".)

Next, near the end of the audRecog module we insert
alert("audR: subpsi psibase psi = " +subpsi+ " & " + psibase+ " & " +psi); //19aug2008 
as an alert-box to show us all three quasi-psi concept values as
each character of ASCII input goes into the auditory memory channel.
We keep having to click the alert-box to close it, but we get a
pretty good idea of what values are showing up in all three variables.

After some experimenting, we put the following code at the end of audRecog:
  if (psi == 0) {    // 19aug2008
    psi = morphpsi;  // 19aug2008 Replace unknown plural with a known singular.
  }  // 19aug2008

  psibase = 0;  // 16aug2008 Reset.
  morphpsi = subpsi;  // 19aug2008 A hand-off to report a word-stem.
  subpsi = 0;   // 19aug2008 Reset.
We then had the following conversation with the AI Mind:
Human: i have a book
Robot: BOOK WHAT
Human: people make robots
Robot: ROBOTS NEED I
Human: people have books
Robot: BOOKS WHAT
(mental function suspended)
In the above conversation conducted in Diagnostic mode,
the word "book" is assigned psi concept number 76 by
the newConcept module. A little later, when the user
types in "people have books", the software no longer
treats "books" as a totally new concept, but instead
recognizes the noun-stem "BOOK" within "books" and
assigns the same psi concept number 76 to "BOOKS".
The newConcept module is probably not even called
(we could check by using an alert-box in newConcept)
and the Mind.html AI simply treats "BOOKS" as a form
of the "BOOK" concept.

This simple enhancement of our AI software is actually
a major step forward in Mentifex AI, because now for the
first time the AI Minds are able to activate a singular
concept even when its unknown plural form is encountered.
We stumbled into the groundwork for this improvement back
on 5.DEC.2007 in MindForth, when we hit upon the idea of
using incremental activation to help audRecog distinguish
between "MAKE" and "ME" in the course of human user input.

We should now upload our JSAI source code, for several reasons.
If a lightning bolt came down here right now and killed us,
it would be a shame not to have released our best AI ever.
We also want to archive the current JSAI with its minor advance,
so that the worldwide user base can run the AI through its paces.
If we were to continue coding today, we might actually make
the code worse or more cluttered than it is right now. So we
will upload the Mind.html code with an "AI Lab Notes" link to
this particular calendar-date entry in the JSAI coding journal.


6. Notes

[X] This page needs to have links to:
- the JavaScript AI Mind;
- the JavaScript AI programming language page.


7. Resources

JavaScript for Artificial Intelligence
http://mentifex.virtualentity.com/js.html

For discussion of the JSAI Mind, see the
comp.lang.javascript newsgroup on Usenet.


8. Associated pages

Modules of the AI-Complete Mind-Expansion
23.AUG.2008 -- the Article module;
03.SEP.2008 -- the kbTraversal module;
17.SEP.2008 -- the kbSearch module.
25.SEP.2008 -- the beVerb module.

http://mind.sourceforge.net/computationalization.html

http://mind.sourceforge.net/mind_faq.html

http://mentifex.virtualentity.com/actrules.html

JavaScript AI Mind Programming Journal
http://mentifex.virtualentity.com/js080815.html
http://mentifex.virtualentity.com/js080816.html
http://mentifex.virtualentity.com/js080819.html
http://mentifex.virtualentity.com/js080822.html
http://mentifex.virtualentity.com/js080823.html
http://mentifex.virtualentity.com/js080826.html
http://mentifex.virtualentity.com/js080904.html

MindForth Programming Journal
http://mentifex.virtualentity.com/fp080824.html
http://mentifex.virtualentity.com/fp080825.html
http://mentifex.virtualentity.com/fp080827.html
http://mentifex.virtualentity.com/fp080829.html
http://mentifex.virtualentity.com/fp080831.html
http://mentifex.virtualentity.com/fp080901.html
http://mentifex.virtualentity.com/fp080903.html
http://mentifex.virtualentity.com/fp080912.html
http://mentifex.virtualentity.com/fp080917.html
http://mentifex.virtualentity.com/fp080925.html
http://mentifex.virtualentity.com/fp080927.html


Return to the
top of this page or to the
main index page.