|
|
Project notes for the natural language processing chatbot program WTalk.cpp, and about human use of language in general
This document contains project notes for the WTalk.cpp (formerly Talk.cpp) natural language parsing chatbot project. Similar in spirit to Complex.doc, it also consists largely of theorizing and
speculation on the general topics of language development and language use, plus an assortment of facts. This file was used mostly to get general and long-range ideas from. Some of
the "ideas" here are already implemented in the program.
Original concept for the chatbot (from a letter to a friend)
The goal of the program is to produce an "interesting" (to the user) conversation, not
repetitive, not predictable or canned, and making some sense.
Thinking to oneself and engaging in a conversation are similar in that the subject matter
usually has a coherent thread, but evolves due to associations that come to mind. What makes a
conversation interesting is the associations that the different people bring into it.
...
One of the things that defines what something is is that it's a subset of some larger class.
Actually, it's a subset (in different areas) of many different classes, and that's what relates
things to other things. When dealing with nouns, my program's memory will consist of a database.
Each noun will have attributes attached to it.(miscellaneous note from wtalk.cpp: might be useful
to have a flag indicating what KIND of attribute it is; e.g. for nouns, be/have/do/obj.)
Each list should be as restricted as possible to pertain only to the particular noun.
Attributes that are common to a larger class that it's a subset of should be listed with the noun
describing that larger class. Example: A car has wheels. Vehicles have wheels. Wheels should be
listed with vehicles, not cars, not any particular car. If the user mentions "car", as yet
undefined by the program, the program inquires what it's a subset of. User answers "vehicle", and
(assuming vehicle was previously described), the program now knows everything about a car that
follows from its being a vehicle. It could also be a subset of "container", so it has an inside
and an outside, etc.
A word has all attributes of all supersets above it, plus attributes specific to it. It is
important to keep all attributes as high as possible in the chains of words they relate to.
Should periodically update. If all elements in the subset list of a noun have an attribute, it
should be moved to the attribute list of the superset.
Roget's thesaurus might be a useful reference for categorizations.
If a human can interpret the string of words produced and make something of it to reply to,
I'll consider that a success.
Associations should grow in strength or fade away, giving the program some predilections and
preferences (personality that hasn't been wired in by the programmer).
A word's value (emotional charge) will be modified by the values of the words surrounding it
(context) when the word was first used by the user, or by the values of the words given back by
the user in response to the word's having been used by the program. Thus, the development of the
program's personality will depend on which users it interacts with. Values will be + or -
(positive or negative), with values closest to zero being neutral.
Learning
Observation and imitation: if the computer can't observe, it can't imitate. So it needs
senses. Senses also would help for learning: there was a statement earlier that hierarchical
categorization is the basis of our knowledge. Maybe, but it's not how we acquire the knowledge.
The previous example mentions car as a subset of container, which is true, but all that is
required to learn that fact is the simplest wire-frame diagram of a car (assembled from
edge-detection?) to determine that it has an interior and an exterior. The same for any other
object. A library of such wire-frame diagrams would be an important type of memory to have. In
other words, teaching the program categories and sub-categories textually would be too tedious to
be practical, but if a program could determine similarities and differences among its wire-frame
diagrams, it could develop its own categories by example and experience, same as we do.
familiarity with cause and effect - statistical relationships between events.
curiosity as a motivating force: requires input that isn't explained and a predilection to
discover how it might be made coherent or useful. This certainly could be emergent if through
experience the program discovers that uncovering previously unknown relationships brought
positive results. Things like curiosity - personality traits - should not have to be
pre-programmed in. A sufficiently complex and aware system will develop them. Also: curiosity is
not the random accumulation of all available facts; the system would overload quickly. There's
always some kind of goal and some kind of related filter.
Related to curiosity: a person learns very early that there are lots of things to know, that
he or she doesn't know, and that can be found out. We can recognize an "I don't know" situation.
Try thinking about the avenues a person follows when trying to fill in the holes in incomplete
information; how would a computer program do similar things? Such research seems to be an
advanced type of learning: You sense the need for information you don't have, determine where
useful facts might be found, sort through and organize them until you can create an answer from
them. How do you know when you have an answer and can quit looking? It's usually a
feeling. Probably created by a "satisfactory" amount of evidence pointing in the same direction,
by statistical probability, and by the existence of a good fit between the probable answer and
other elements of one's world view. One note says a testable goal is important. It is, but not
sure how it relates to this. Mere accumulation of facts is useless. How do you know that some
missing information is important to have?
Human Use of Language
[Information from PBS show Discovering Psychology, plus related thoughts]
The "development of language" means the development of an understanding that sounds (or other
symbols) have a regular, consistent correlation with other sensory events.
Language is used:
- As a coding device for memory (to record events)
(But KoKo's friend Mike (two gorillas) was able to relate what seemed to be details of his
mother's death, which had occurred long before he acquired language.)
- To produce results
- To describe and understand the environment within a logical framework
Language develops as a statistical association/correlation between sounds and the other senses
(what is going on), and later, the correlation between using it and the results (even
crying).
- Language/sentences are arbitrary utterances that are tools to us because they have
established a track record of producing favorable results when uttered. In other words, language
itself is an adaptive entity in which certain combinations of sounds evolve through natural
selection because their utility to their human users causes them to continue to exist, to
be used. This emphasizes the idea that the fundamental "entity" in any complex adaptive system is
a pattern. Of what it consists, or in what medium it exists is a secondary matter.
(See Complex.doc).
The Motivation to Communicate
Human language is not an abstract intellectual exercise. It is a practical tool that people
use to obtain things they need. Whether the needs are material (e.g. food) or social (e.g.
tribalism), they are biologically based and hard-wired into human construction. They are felt
biologically with the senses, and the satisfaction of them is also felt biologically with the
senses. These needs underlie, and thus precede, every instance of the use of language.
Within a conversation, it is the needs that inevitably cause a person to choose one
utterance over another, and that thus directs the flow of the conversation.
Motivations Why People Communicate
- Obtain information
- Manipulate others
- Establish dominance, social position
- Obtain approval or satisfy other psychological needs
- Establish or reinforce group cohesiveness, agreement, solidarity, bonding with shared values,
attitudes, moods.
Computer conversation is so difficult because the computer or program has no instincts, needs,
desires, or predilections at all, and thus any utterance, no matter how nonsensical, is always
just as good as any other.
Any program that is going to have any semblance of a human personality must have some
simulated biology built into it, including simulated instincts and needs. Only in light of those
needs can feedback it receives be interpreted as positive or negative.
Steps in the development of language
To create a language-using program, it should help to know how language develops in people. As
with other things, it may be possible, and sometimes even preferable to implement it completely
differently on the computer, but the understanding should help define starting points. For
example, things that are human instincts must be explicitly programmed in, while things that
people learn you can also expect your program to learn.
Some innate things generated by instinct, as evidenced by the facts that babies...
- Produce vocal sounds. Environmental feedback (learning) reinforces sounds used for the
language being learned, and extinguishes others.
- Have an inherent preference for human voices over other sounds.
- Turn toward sounds.
- Reach out (toward sounds?).
- Like sweets.
- React to facial expressions.
- Prefer novelty, not familiarity.
- Prefer complex and contoured shapes, not plain or simple regular ones.
- Prefer whole faces to disparate facial parts.
- Prefer strong, simple gestalts (strong differentiation). (From TV show?) (Probably important
throughout life, affecting much of human social behavior: one reason so much attention is focused
on the President rather than on Congress or Supreme Court, and for "celebrity" phenomenon in
general. People want a strong, parental leader, not a diffused tribunal.)
- Stare longer at something that contradicts its world knowledge (train on a blocked track
example). This is a common test, also used in animal experiments. Human results show that
babies...
- Acquire physical knowledge very early, long before having the language to describe or express
it.
- Generalize: discover that after sufficient examples, it is safe to infer that that is the way
things work. Every instance is not unique. Without that generalization, learning would be
impossible. This also implies that determining similarities and differences (pattern recognition)
is instinctive, since no two instances are exactly identical.
- Pattern recognition (see complex.doc).
Is the development of symbolic thought an innate ability, or learned? That something can stand
for something else. Parents don't regularly say, "Can you find the picture of a ball?" (in a
book), but children, no matter how young, never seem to be confused that the picture isn't
a real ball. (Koko the gorilla often uses the word "fake", for example, for something on TV.)
Seems to me that maybe symbolic thought is the area where we fail to give other animals
sufficient credit. Our languages mostly use sounds, and can be communicated, but a symbol should
be able to have any form (a dog language using smells?), some of which can't be communicated.
Most of the examples of animal intelligence in AI.DOC would seem to require symbolic thought. (Also
remember idea that a symbol can remain constant while the thing it symbolizes changes. (That is,
after all, a basic characteristic of a symbol!) Seems to me that most higher animals would be
nearly unable to function if their thought processes weren't fundamentally based on this
capability.)
Temperament is partly inherited (bold vs. timid, etc.) We saw that even in kittens: more vs.
less exploratory, aggressive, easily frightened, etc.
First whole words are connected with familiar rituals (such as bye, bye). Later, attempts to
express relationships or knowledge, then to produce effect. Later, 2-word sentences with proper
word order, exhibiting also standard rules for tenses, but not using irregular forms (e.g.
"She gived it to me" errors.) -- so they've picked up the rules, and are not just copying exact
usage. (Though I would contend that they are copying exact usage, and simultaneously figuring out
the rules, using the rules where they don't have the experience to draw on. Meaning that I think
people using their native language do not proceed by the application of rules, but by having
learned what sounds "sound right" together, from experience. When you hear someone misspeak, it
is the sound discordance that hits you first, not the awareness that a logical rule was broken.
This seems strange, because it would seem more efficient to maintain the library of rules than to
maintain an enormous library of individual instances, but I don't think that's what we do.
Supportive evidence is that so many native English speakers have so much trouble learning the
formal grammatical rules in school, and my elementary school friend who was French, and who spoke
only French at home, who nearly flunked French class, and my other, English speaking, friends who
struggled in English class!)
Subsequent progression to greater complexity is molded and guided by + and - feedback, and by
copying examples: Parents almost always restate and enlarge on a baby's first words,
completing the incomplete thoughts. Baby says, "ball". Parent says, "You want the ball?"
Baby says, "Yeah" (though not knowing what is being asked). So parent gives him or her the ball.
Baby cries (that's not what he/she wanted!, and now knows that "want" wasn't the right word to
say Yeah to). Parent says, "You want me to throw the ball?" Baby says, "Yeah". Parent
throws ball. Baby is happy, and has learned "throw ball", says it again, parent throws
ball again, and baby learns that language is a tool to get things done.
Children use their own names before learning to use "I" or "me" as substitutes.
Rules of dialog learned through ritual interactions with parent, ritualized question and
answer interactions.
One thing I believe is learned is sense of self, including one's physical boundaries. A baby
is born only with sensations and reflexes, and has no sense that anything it experiences occurs
outside of it, or alternatively, that anything it experiences occurs within it, either! There's
no differentiation. Over time, it learns that when some things move (its own limbs), it also has
other simultaneous sensations, but when other things move (other people), there are none. And
when someone touches its arm, there's a sensation, but when the person touches other things (a
blanket), it feels nothing. It similarly learns what things it can move voluntarily (itself), and
what it can't (the blanket).
The production of language
[Considerations of importance to Talk.cpp's sentence generator, which should be made a
separate module so it can be easily tinkered with, independent of the rest of the program.]
What process leads to appropriate articulate expression? You start with a desire to express
something. What chain of events leads to choosing a structure for the output that expresses the
point better than others might? How do the pieces of the thought, which feel more or less
parallel and simultaneous, fall into place for their linear output? A method for investigation:
present photos, describe each in 1 sentence, noting the process as you do so.
Possible factors:
- Order in which the elements of the thought occur to you, which is probably also the
importance each element has to the thought being expressed
- Situational demands. You learn, by previous results, what structures are appropriate to what
circumstances. E.g. speed vs precision.
- Habit, predilection for some structures over others
Steps:
- Impulse: You recognize a need or desire to communicate something. Some situation
exists for which language is the tool you need to get something accomplished.
- Generation: A small number of important words, probably nouns and verbs, occur to you
immediately. In many situations, this is all you need to express a halfway comprehensible
thought, even if you just speak the nouns and verbs in random order. In that case, those simple
words may be sufficient to create an image in the listener's mind that is intelligible, due
largely to the listener's instinctive ability to fill in holes and repair apparent
impossibilities by applying world knowledge. (A key concept here is probably that the ultimate
goal of language is to create an image in the listener's mind, with the listener doing much of
the work.)
At this "vocabulary assemblage" stage, much additional meaning can be conveyed by the specific
nouns and verbs that come to mind. Someone with a rich world view and vocabulary may be able to
convey more with these first words than someone whose instinctive knowledge of the language is
less rich. The less information that is built into these initial words, the more that may have to
be added with supplementary modifiers in the next step. "Instinctive" vocabulary is important
here, the first words that come to mind; any conscious modification of those initial words to
achieve greater precision is a function of the next step.
- Information Shaping: The output is shaped to meet the demands of the situation. How
exactly must the image in the listener's mind match the one in the speaker's mind to be
sufficient for the situation? (Recall Jay Leno's rendition of William F. Buckley calling
911 about a house fire.) How much explicit additional information needs to be provided for the
purpose, and consequently how much can the listener safely be left to fill in, even if some of it
is wrong?
- Grammatical Shaping: Given chunks of information to be included in the output, there
are grammatical rules for how those chunks should normally be strung together for linear output,
and the process may be merely something like letting blocks fall into place. The most important
thought usually goes first, usually the actor or subject. Does grammar dictate that the order of
thoughts in a sentence generally be from the most important at the beginning to modifying and
qualifying phrases of lesser importance toward the end? If so, it happily coincides with the
order that the thoughts (nouns and verbs, anyway) probably occurred to us in step 2. Within that
organization of the largest chunks, modifiers of the chunks also generally follow as closely as
possible the things they modify, an exception being adjectives, which precede the nouns they
modify.
A simple sentence framework:
MISC. LEADING MODIFIERS OF ANY PART OF THE SENTENCE (what they modify must be extremely
obvious from context, and should be important, because listener must keep the leading modifiers
in mind until the rest of the sentence has been heard)
Subject modifiers
SUBJECT
Subject modifiers
Verb modifiers
VERB
Verb modifiers
Object modifiers
OBJECT
Object modifiers
MISC. TRAILING MODIFIERS OF ANY PART OF THE SENTENCE (what they modify must be obvious
from context, and modifiers in this position are usually less important)
Constructing a sentence using this framework is fairly straightforward. Pulling the pieces
apart again is not, because the implicit dividing lines between the pieces get lost when
the pieces are all strung together into the sentence. Unlike Latin, there aren't explicit flags
to tell you which modifiers relate to what; you have to use context and world knowledge to a
greater degree to extract the information.
Development Of Social Responses Through Natural Selection
Consider a conversation. Prompted by a particular sentence given to you, your problem is to
construct a reply that brings a positive response (that meets your needs at that moment: see
Motivations!). In previous conversations on similar topics, you've tried replies based on various
associations, some of which interested your listener and some of which didn't. So in any given
situation, you have a pool of possible association-based responses, which has been built through
this process of "selection" (a.k.a. Reinforcement). Too narrow a pool produces an overly
constrained, dull conversation. Too large a pool creates a flighty conversation lacking a
coherent thread.
Remember "classifier systems", esp. "Complexity" page 186:
- topic posted on message board topic can be general (the conversation thread), or specific
related to emotional charge of key words in particular sentence
- "associations" (other key words) bid for the right to be said, based on the strength of their
association to the topic (above).
- System chooses association(s) by lottery. Each association's bid is its # of tickets in the
lottery, so weak ones could sometimes be chosen.
- Program emits its sentence (reply).
- [user now replies. Must have a way to calculate the reward value of the user's reply:
response time, keyword charge, etc. At first, this is a numeric value to substitute for (and
considerably condense) facial expression, vocal tone, etc.]
- Program apportions reward (or punishment) among the chosen associations(above).
(Regarding this idea of molding output based on what user responds to, see Genetic Sand
Painting on June page of Fractal Calendar in kitchen. Program evolves its painting technique
based on what the user responds positively to, and thereby produces a painting that is a
conglomeration of the various things the user liked.)
Learn syntax by keeping a file of allowable sentence structures (by type) as entered by user.
Select at random. Could make for some humorous replies. Once I get some sort of dictionary going,
try a syntax analyzer. Feed it a file and see how many different sentence structures it comes up
with. Below some limit, it might be possible to store some representation of these legal
structures and refer to them.
To do for WTalk.cpp
Continue trying to organize this To Do into sections.
Acquiring World Knowledge
- Use user sentences that contain is-verbs to fill in the noun database. And automatically
update noun database with inferred info from sentences such as "the man walked to the store"
->(implies) man can walk. The use of any positive verb means the subject can do it.
- Also make use of explicit "ability flag words" when encountered in user's input. Maybe create
a file of them, as for whenadvs, etc.: can, cannot, can never, can always, must, must..., is
<not, never> able to, has to, needs to, etc.
- Hit-and-near-miss procedures probably not useful here for filling in the noun
database.
- See expert system program for possibly usable ideas.
- Program should assume that nearby events are causally related until a lack of correlation
proves otherwise.
- Links table Prob (probability) could be calculated from (# times a possessor has had this
attribute / total # encounters with possessor). Field is a double; it never rounds to 0; thus, an
explicit value of 0 means "never".
Dictionary (World Knowledge Database)
- A commercial CDROM dictionary can be the starting point for each new entry, a place to look
up definitions for newly encountered words, but the main dictionary must be WTALK.MDB, where it can accumulate definitions
and attributes peculiar to its own experience.
- Most dictionaries use only the broadest categories for parts of speech. If I go to a CD
dictionary, the specificity that I use for parsing will be lost, and my "invented" types
certainly won't be there.
- One note said to search for a commercial "hierarchical" dictionary, but that is the structure
of most dictionary entries, anyway, which provide the superset, then the list of qualifiers
unique to the entry: a lion is a large cat native to Africa, etc.
- Create file IDIOMS.DAT for list of phrases that have meanings but interpreted literally are
nonsense. Maybe screen at the same point as contractions, and pre-mark the entire phrase with an
infotype. Maybe also store in the file a meaningful (more literal) interpretation for
substitution or at least for reference.
Procedural
- Could break in with additional comments during a long pause.
- When looking for topics to ask about, could also tally tokens from facts into a
SFreqArray<TOK> (TOKs are equal if they refer to the same DicEntry and have the same TYP)
Or just an SFreqArray<string> (ignoring usage). Then exclude words from the trivial word
list (littword.dat) from wphrases, and build topic from among the most-used words.
- Now that phrases are identified, you can be more specific in questions. That is, having
parsed user's sentence into subj,verb,obj, you can ask specifically about any of them, pulling
the phrase-marked tokens into the next response.
- Maybe keep a separate archive dialog file for each user, and at end of session, transfer to
that user's dialog archive file for continuity between sessions.
Grammar and Syntax
- Add pronoun substitution, like contraction substitution. replace each subject pronoun with
the most recent sentence subject, each object pronoun with the most recent object. Pronoun
substitution makes context reversal unnecessary on input. Still need it for output.
- Program should tokenize and parse its own sentences. 1. helps determine whether user IS
responding to its questions, 2. helps determine how good its own sentence construction is. (It's
good if subj, verb, obj can be identified).
- Split the VERB type into intransitive, transitive (VERBI, VERBT). All existing Legal phrase
seqs will need changing, but it would greatly improve parsing.
- Maybe add word type EXPLETIVE (filler), or merge it with interjection. For use with (it,
that: as in "It is raining"?). Useful because if a word has that type, few demands can be made of
it. I.e. you can let it go without an antecedent.
- One note said SCONJs (subordinate conjunctions who, which, etc.) should instead be relative
pronouns.
- When determining subject of a sentence, use world view in addition to syntax analysis: look
up "can do". Only 2 nouns in the sentence; man can walk, store can't, so man must be the
subject.
- American Heritage dictionary has interesting preface on syntax & grammar. MSWord's
grammar checker might be an interesting source of ideas.
- If a user sentence starts with a verb or "please", it's a command. (But many would be
ambiguous.)
- How might the program tell if the user is actually answering the questions? Look for yes, no,
& restatements of nouns & verbs from the question. Then fill in facts from the info &
program restates facts as it understands them. Ask user to fill in missing facts and rephrase
unparseable sentences.
- Program should be able to do some guessing if words are out of order or missing, etc. Might
also be able to guess about word types: a word after "the" is certainly going to be an adverb,
adj, or noun. (But could also be verb phrase used as a noun or somesuch).
- Program could start the processing of the user's input sentences by inferring new grammatical
rules from it, on the assumption that the user already knows the grammar, and thus can be used as
a model (learning by example). If possible, allow it to add newly learned rules to its state
machine. A huge number of "known good" rules could be created simply by scanning text from disk
files. An interesting result of this could be that the program might tend to use the same general
word sequences as the user, creating in the user a sense of identification with the program.
- While (or after) you determine via StateMachine which part of speech fits best, you can also
determine which meaning (instance of that part of speech) fits best, from context.
State Machine
- Add who, which, that phrases to nounphrase state machine so the search for the first verb
phrase won't start till after them. Or give them a separate phrase type and state machine. Then
later pull them in to the subject or object that they're part of.
- Verb phrase can't be legal until it contains a verb. add global?
- Maybe use more than 1 level of state machine: legal word order, legal phrase order... One
note says: Enumerate phrase types and break subphrases out of the state machines for nounphrase,
verbphrase, etc. Define those larger phrases in terms of the subphrases they can contain, instead
of the individual word types. Interesting possibility, but probably a poor idea. The current
state machines are already at the limit of complexity I can handle, and overall program evolution
should be away from the mechanistic state machine idea, anyway, towards a more
impressionistic use of language described elsewhere.
- For some phrases, add the additional transitions that make extended forms legal: aaaa ", and"
bbbb to build compounds. May need to make commas a special type of punct.
Phrase types and their components
Adverbial phrase =
adv [+ adv...]
adv [+ conj + adv]
rule = begins with (adv), ends with
(adv)
Verb phrase =
verb [+ conj + verb]
rule = begins with (verb), ends with
(verb)
Compound verb phrase =
adverbial phrase + verb phrase [+ conj +
compound verb phrase]
verb phrase + adverbial phrase [+ conj +
compound verb phrase]
rule = begins with (adv or verb) ends with
(adv or verb)
Adjectival phrase =
adj [+ adj...]
adj [+ conj + adj]
adv phrase + adj
rule = begins with (adv or adj), ends with
(adj)
Noun phrase =
[det +] [adj phrase + ] noun
rule = starts with (det or adj or noun),
ends with (noun)
Prepositional phrase =
prep + noun phrase
rule = starts with (prep), ends with
(noun)
An example parsing:
| |
The
|
man
|
walked
|
quickly
|
but
|
didn't
|
run
|
to
|
the
|
store.
|
| Clause type:
|
ind
|
ind
|
ind
|
ind
|
ind
|
ind
|
ind
|
ind
|
ind
|
ind
|
| word type:
|
5
|
1
|
2
|
4
|
8
|
4
|
2
|
6
|
5
|
1
|
| phrase, pass 1:
|
n
|
n
|
vb
|
adv?
|
adv
|
vb
|
p
|
p
|
p
|
|
| phrase, pass 2:
|
n
|
n
|
vb
|
vb
|
vb
|
vb
|
vb
|
p
|
p
|
p
|
| info type:
|
subject
|
|
didwhat
|
|
|
|
|
where
|
|
|
One note says: dependent clause can function as a noun, adj, adv, and starts with a
subordinate conjunction: that, who, which, where.
Conceptualizations
- The computer can't hear you laugh if it says something funny, but it's an absolute necessity
that it have that kind of feedback from its environment. Even if you type in your laughter, many
other cues and responses are lost.
- How to learn by association of words with "experience"?
- If it is ever desirable for program to remember its own actions, subroutine names (or goals
and subgoals, etc.) could be written to a transaction log.
- Our knowledge, and the language that encodes it, is sense-based. A good visual pattern
recognition module would be a great asset to a natural language program like Talk, and would
facilitate learning in a more human way. To learn wings, you scan in pictures of wings
themselves, and things with wings. Current vision technology (neural net or math function based)
can identify features (shapes) within such a scanned image. With repeated exposure to examples
(hit and near miss), it abstracts which feature is always present in the pictures identified with
the word "wings". After this process, it will have (at least implicit in the network) a highly
generalized shape that is the minimum it will recognize as a wing. Assuming that you can get at
this implicit information and turn it into a rendering, you save it as a file. This is then the
abstracted shape of a wing. The power of this is that it provides the basis for all sorts of
comparisons, such as things similar to wings, etc. (Further, most wings are part way down a
midsection of the thing they're on, which is easy to conceptualize and abstract visually, and
even draw in a generalizable way that is usable for reference and comparison, but not so easy to
describe in any way useful for database access.) This type of visual pattern processing would
eliminate the need for a lot of the semantic hierarchies, etc., whose purpose is usually just to
provide a (poor) substitute for it, anyway.
- Coherence is adaptive, but flexibility is also adaptive: the ability to jump out of the
current loop. Combining the two, an "inertial", interrupt-driven, system would be good: keep
doing what you're doing until interrupted by something more important. (For example, keep
producing associations to a recent high-heat keyword until user generates a higher-heat word.)
Maintaining balance between persistence and flexibility is important here, as it is in real life.
It is relatively easy to produce an incoherent schizophrenic program (with random, flighty
associations), or to produce an obsessive-compulsive program (that can't jump out of its current
set of associations). Strangely enough, it shouldn't be too hard to simulate mental illness; the
difficulty is simulating mental health.
The TALK Classifier System
The system is in the spirit of the original attempts to use if-then rules for processing
(Complexity:~p170), with the flexibility and
(hopefully) emergence of the classifier method. It eliminates the necessity of waiting for
"usable" symbols to "emerge" from random sequences of binary digits.
Classifier Rules
- Regular expressions should be used to encode the If clauses, and they might have other uses
in the program, as well.
- You could allow program itself to assemble any known words (even random groups) into a string
literal action list entry. Any words or phrase can also be made into a key.
- The fundamental General, Last Resort, and Always Applies rules should generally have
low bids, so they are only likely to win if they're the only bidder.
Misc.
- WTalk might make an interesting novelty website, giving people the opportunity to talk with a
quirky conversational computer, and better yet, giving the program a large amount of user
interaction for developing its world view.
- Expansion ideas for more varied program responses:
- look for whenwords and ask "what else happened (when)...?"
- find any noun longer than 4 chars and ask "tell me more about..."
- search facts database for previous mention of subjects(> 4 chars) and verbs (> 4
chars?) mentioned in current sentence and ask about the relationships
- If I could figure out how to intercept digital audio values (from the microphone) in real
time, it might be a useful input to detect user response.
Underlying Philosophy and Plans for New Version
This section is mostly from paper notes. Its purpose is to develop a coherent philosophy on
what language is and how it is used by people, and to develop plans for how that philosophy can
be specifically incorporated into the program. Wherever possible, relevant sections from
elsewhere should be moved here.
Passages in Arial 10 describe implications for Talk.cpp, or any other
incidental text.
What is a word? What is a definition? What is meaning?
Rather than thinking of sensory input triggering an association with a word, think of a word
as a name given to a bundle of sensory inputs.
A word is only operationally defined (has meaning) for a person if that person
has associated it with a memory of a group of sensory inputs. These are the true
definitions of words. It is what gives them meaning, and it is the foundation of
understanding.
For an action (verb), the sensory memories are of the procedures that
constituted the action, a procedure list. This is mainly important for how to define verbs in the
program.
The hope of every dictionary is to redefine a word that the user doesn't know in terms
of other words for which the user does have the kind of operational definition described
above, to help the user construct an imaginary composite mental (sensory) image that is
close to what the sensory input would be if the user were actually to experience whatever
the unknown word describes.
Referring to the CD dictionary for unknown words will only be useful if the
definitions eventually bottom out in operationally defined words. You must constantly try to
develop chunked sensory groups and action lists to store with the words. When you have
those for a word, you really do understand it, and it can then be helpful in understanding other
new words. Ex: Given an unknown verb, you can look it up, find reference to a verb you do
know, and copy over its action list for current use, subject to later refinements as you learn
more. Same for an unknown thing: Copy the sensory data from a related thing you do know and
revise it as you learn more details. Like a child, the program learns words as it has
experiences and learns to do things. More specifically, it learns what words to associate
with the experiences it has and with the things it learns to do.
The Computer's "Experience"
The program's experience (sensory input) consists of the values of its variables. A sensory
state is the set of values at a given time. Any word's operational definition must be in terms of
these variable values, the things it actually can experience.
This should be a useful guideline as to what variables are necessary for a
desired level of capability.
It must be able to get the names of states (words) from the user, by being told or by asking;
store the variable values with the word's definition (as its operational definition); and later
determine how closely a new state matches the stored one(s).
Obviously, the computer's experience is completely different from human experience. Any
desired analogs to human experience must be explicitly defined in terms of things it can
experience. To define anger or frustration, it first needs variables that might reasonably be
involved in measuring such things; then you can predefine a set of values for these variables and
store them as the operational definitions for the words.
This method actually allows training it on virtually anything. E.g. even a
pixel field for vision, just as long as you have a format defined for storing whatever data
operationally defines the word. Then it knows "that is happiness" or "that is a
dog". Save the name and the variables in the database. When a subsequent state matches, lookup
will discover "happiness" or "dog", or conversely when a word is encountered, it could reload its
variables from those found stored with the word, internally recreating the stimulation, and to
some degree simulating a resonating cell assembly. With "dog", you could have a bitmap outline, a
standard dictionary definition, a .wav file of a dog barking, etc., and activation resulting from
the lookup of any of them gives access to all of them.
With operational definitions, you can ask the program "Are you happy?", and
it can really answer because it knows what "happy" means in measurable terms from its own
experience.
Standard State Format
All state descriptions (sets of variable values) for dictionary reference, comparisons, etc
will have a standard format, which will be text based for all data types.
Program As Therapist
The original Eliza program was a pseudo-psychotherapist. These are guidelines for expanding
program back from a general conversationalist to return to a role as therapist. This section
adapted from a book on counseling.
Goals of Therapy
Keyword responses should be worded to promote these. And problems don't have to be defined as
personal problems; they can be organizing or planning a project, etc., in the spirit of the
various brainstorming-helper programs.
- Help user focus and define problem(s).
- Give clues to insights.
- Help user have "Aha!" insights.
- Help user discover unconscious motives.
- Help user discover unrecognized scripts (patterns of behavior).
- Help user develop solutions and goals.
- Help user recognize and assess progress.
Stages of Therapy, and Methods
Attending
Listen to user's story and concerns in an accepting, nonjudgmental manner.
(Before any significant dialog, have new users write a short essay about themselves -- at
least a long paragraph. Extract facts from it into a fact database about the user. Also extract
key phrases for later use. Ask some questions about information in the essay to get more
information, and restate some of the facts to show concern and understanding. User attribute
database will need to be somewhat enlarged from ordinary noun database. Needs a "Did"/History
section, that is, a historical record in addition to the normal is/has/does type of
attributes.)
Exploration
Discuss in greater depth topics that seem important to user. Using techniques of feedback
(nondirective interviewing, restating user's responses) and gentle confrontations and challenges,
help the user to determine which issues are most important to him or her, and why. Show concern
and caring. Provide empathetic responses. Focus on here and now (?).
Understanding
Advanced empathy? With trust established and important issues identified, user now is in a
position where he or she may be able to benefit from specific information, ideas, or perspective
that the therapist has (from training), or simply to benefit by being presented with alternative
perspectives. Direct and guide user into the more difficult areas. Provide more direct guidance
when necessary, presenting possible interpretations, etc., using your own experience and factual
or theoretical assistance to help bring user greater understanding. Use self-disclosure where or
if appropriate. Use confrontation to a greater degree.
Other misc. notes
- A variation of WTalk could assist user with keeping a daily journal, by allowing free text
entry, but then also asking questions about things that seemed important from prior entries, to
help assess and recognize progress and stimulate further thought.
- An important use for Wtalk-like programs would be for use by company customer service
departments on the internet, or with voice recognition, by telephone. This is an area of large
(and user-frustrating) company cutbacks. Even if the program can only understand the user well
enough to filter a list of Frequently Asked Questions for presentation, that alone is enough to
justify its use, but it might potentially be able to understand a simple question well enough to
route a phone call to the appropriate expert, or even understand and answer it if it is close
enough to one in a limited pool of FAQs. When in doubt, it could present and ask which of several
FAQs is most similar to what the user wants. Unfortunately the development for this use would
require a large company, and it would face an Aquanautics-like problem: other, larger,
competitors working on the same problem, some of them probably better positioned for success; on
the plus side, I suspect that my approach, though difficult to develop, is especially good
because it actually addresses the basic problem of learning language from context and through
experience, and thus can continually expand its own capabilities: learning how to answer a
question as the result of previous failures to do so.
- A basis of humor is counter-intuition: breaking the rules.
- Text-based adventure game makers (InfoCom: Zork) must have much experience with language
parsing and processing. Bill Gates mentioned Microsoft is actively working on NLP.
- An example of how difficult grammar and syntax must be is that MSWord's grammar checker has
an impressive set of things it checks, but it is only really successful at things that involve
fairly simple lookups. Oddly, it does a successful phrase/clause analysis for some of its checks,
but it can't even identify a simple run-on sentence.
- Tongue twisters are really brain twisters. It is as hard to imagine saying them as to
actually speak them.
Questions about language
- To what degree is language itself responsible for human intelligence? Are we intelligent and
also use language, or is language the key tool, allowing us to possess (or organize)
knowledge that couldn't even be thought without it?
- Do chimpanzees that learn sign language (or other animals that learn any language) also
become more capable or better organized as a side effect?
- Usually language is highly resistant to destruction in brain injury. However, are there ever
instances of injury that damage language (the symbolic thought usage aspect) but leave other
functions intact?
- One girl who had the left half of her brain removed to cure epilepsy lost her ability to
speak, but could still think the thoughts (Dateline, 1998 & 8/99), so it was her motor
skills, not basic use of language, that were damaged. But what would happen with right side
removal?
- If a person is deaf from birth but knows sign and written language, what is the form of their
internal dialog?
- What changes in form of thought occur in extended "shikan taza" meditation? Remember it is
possible to function in such a state, and it doesn't imply that symbolic thought isn't being
used, just not English. This whole section (and other discussions of "symbol" elsewhere here)
seem to me to reinforce the idea that use of symbols of some kind is a widespread animal
capacity, of which verbal language in humans is a particularly well developed and external
example. (Are parts of the human brain used for speech production newer than other areas
used for language but not speech? Presumably, other animals lack the speech production areas; do
they have areas analogous to our non-speech language centers? For that matter, MRI brain imaging
of other animals during problem solving, and comparisons to humans, should be informative.)
- How can you plan and execute anything more than a trivial project without symbolic thought,
for at least the minimal purpose of keeping the goal in mind?
|