RuNounPhrase Russian Noun-Phrase Module

of ghost.pl First Working AGI

Artificial General Intelligence


1. Diagram of the RuNounPhrase Russian Noun-Phrase Module


   /^^^^^^^^^\ RuNounPhrase finds noun or pronoun  /^^^^^^^^^\
  /   EYE     \              _____________        /   EAR     \
 /             \    | | |   /   Volition  \      / auditory    \
|               |   | | |   \_____________/     |  memory       |
|   _______     |   | | |    _____|_______      |  channel      |
|  /image  \    |   | | |   /   RuThink   \     |               |
| / percept \---|-----+ |   \_____________/     |               |
| \ engram  /   |  a| | |    _____|________     |               |
|  \_______/    |  b|c| |   / RuIndicative \    |               |
|               |  s|o|f|   \______________/    |               |
|   visual      |  t|n|i|  ____|___     |       |               |
|               |  r|c|b| /RuNoun- \----|-------|---СТУДЕНТЫ    |
|   memory      |  a|e|e|( Phrase   ) __V___    |               |
|               |  c|p|r| \________/ /RuVerb\   |               |
|   channel     |  t|t|s|           ( Phrase )  |               |
|               |   | | |            \______/---|---ЧИТАЮТ      |
|               |   | | |               |       |               |
|               |   | | |             __V___    |               |
|   _______     |   |_|_|            /RuNoun\   |               |
|  /fresh  \    |  / Psy \          / Phrase \  |               |
| / image   \   | /concept\        (  direct  )-|---КНИГИ       |
| \ engram  /---|-\ array /         \ object /  |               |
|  \_______/    |  \_____/           \______/   |               |


2. Purpose

RuNounPhrase finds a Russian noun or pronoun to serve as the subject of a sentence or as the direct or indirect object of a verb being thought by RuVerbPhrase. RuNounPhrase may also call RuPrep to insert a preposition or RuAdjective to insert a Russian adjective describing a noun.


3. Function

For the subject of a sentence of thought, RuNounPhrase typically finds the most active noun-concept in the Psy array of concepts. The Russian verb-phrase module RuVerbPhrase may call the RuNounPhrase module for both an indirect object of a verb and for a direct object. If an AI Mind embodied in a robot can recognize and name objects with a VisRecog module, the noun naming the recognized object may go directly into the slot for a direct object in a sentence being generated. The robot might say, "Я ВИЖУ СОБАКУ" for "I see a dog." VisRecog may first identify the concept being recognized and then call RuNounPhrase to express the noun of the concept in a thought.

When the RuNounPhrase module must recall a noun or a pronoun in response to an external query, such as, "Who are you," first the SpreadAct module will use the $qv1psi variable to find and activate the needed noun or pronoun and the $qv2psi variable to identify the verb associated with the target noun, first in the query itself, and then in the response to the query. Since both the noun and the verb are combined in the search for memories responding to the query, the AI will not recall some random statement about the subject of the query, but will instead recall any available memory expressing both the subject of the query and the verb expressed in the query. For the query "Who are you", the AI must find both the ego-concept "I" and impute a non-spoken Russian be-verb correspnding to "am" in English, as in "I am."


4. Code of RuNounPhrase() from ghost294.pl First Working AGI in Perl

sub RuNounPhrase() {  # 2016feb24: thinking with Russian nouns and pronouns
  $act = 0;  # 2016apr01: so comparisons may be higher.
  $aud = 0;  # 2018-09-28: same as in the EnNounPhrase module.
  $audjuste = 0;  # 2016feb24: prevent carry-over
  $defact = -64;  # 2017-06-17: for default comparisons with?
  $motjuste = 0;  # 2016feb24: 
  $subjpsi = 0;   # 2017-06-17: how can there already be a subject-psi? TEST
  my $tsels = 0;  # 2016may25: de-globalize the time-of-selection-of-subject.
  if ($verblock > 0) {  # 2016apr28: positive verblock?
    my @k=split(',',$psy[$verblock]);  # 2016apr28: inspect t=verblock row;
    $svo1 = $k[1];  # 2017-06-17: keep track of subject-concept. 
    $nounlock = $k[13];  # 2017-06-17: dirobj tkb becomes nounlock value.
    $subjnum = $k[8];    # 2017-06-17: from number of verb; 
  }  # 2016apr28: end of test for a positive verblock;
  if ($nounlock > 0) {  # 2016apr28: already a nounlock? 
    $dirobj = 1;  # 2016apr28: nounlock is specifically for a direct object.
    $subjectflag = 0;  # 2016apr28: needed for conditional tests below;
    my @k=split(',',$psy[$nounlock]);  # 2016apr28: inspect t=nounlock row;
    $motjuste = $k[1];  # 2017-06-17: in case a search is needed for non-zero $rv
    $act = $k[3];   # 2017-06-17: let activation-level play its role here;
    if ($k[7] == 4) {   # 2017-06-17: if acc. case as for any nounlock;
      if ($k[14] > 0) { $aud = $k[14] }  # 2017-06-17: find positive $rv; 
    } else {  # 2017-06-17: if only a zero $rv $k[14] is found...
      for (my $i=$t; $i>$midway; $i--) {  # 2016apr28: search backwards in time.
        @k=split(',',$psy[$i]);  # 2016apr28: inspect @psy flag-panel
        if ($motjuste == $k[1]) {  # 2017-06-17: find motjuste for sake of rv
          if ($dirobj == 1 && $k[7] == 4) {   # 2017-06-17: direct object?
            if ($k[14] > 0) { $aud = $k[14] }  # 2017-06-17: find positive $rv; 
            if ($k[14] > 0) { last }  # 2017-06-17: exit loop if $rv is found.
          }  # 2016apr28: end of test for direct object and accusative case.
        }  # 2016apr28: end of test to find $motjuste with valid $rv.
      }  # 2016apr28: end of for-loop in search of a positive recall-vector.
    }  # 2016apr28: end of else-clause to find a non-zero k12 $rv.
    $actpsi = $k[1];  # 2017-06-17: send direct object into SpreadAct()
  }  # 2016apr13: end of test for a positive nounlock;
    if ($nounlock == 0) {  # 2017-06-17: if nouns are free to compete...
    $subjectflag = 1;  # 2017-06-17: a default until countermanded.  
    $dba = 1;  # 2017-06-17: default nominative until countermanded.  
    if ($dirobj == 1) { $subjectflag = 0 }  # 2017-06-17: countermanding default
    for (my $i=$t; $i>$midway; $i--) {  # 2017-06-17: include input for topical response
      my @k=split(',',$psy[$i]);  # 2017-06-17: inspect @psy knowledge-nodes.
      if ($k[2] == 3) {  # 2018-09-27: select only Russian words
        if ($k[6]==5 || $k[6]==7) {  # 2017-06-17: select $pos noun or pronoun
          if ($k[13] > 0 ) {  # 2017-06-17: retrieve ideas, not single words.
            if ($k[3] > $act) {   # 2017-06-17: k3 activation as criterion. 
              $motjuste = $k[1];  # 2017-06-17: Select the most active concept.
              $svo1 = $k[1];      # 2017-06-17: keep track of subject.
              $mjact = $k[3];  # 2017-06-17: if too low, motjuste defaults to "I"
              if ($k[3] > $act && $k[12] > 0) {  # 2017-06-17: if k1-psi has k12-seq
                $verblock = $k[13];  # 2017-06-17: assign $tkb value to verblock.
              }  # 2017-06-17: end of test for a k1-subject with a k12-seq.
              if ($k[3] > $act && $k[13] > 0) {  # 2017-06-17: if k1-psi has k13-tkb
                $verblock = $k[13];  # 2017-06-17: assign $tkb value to verblock.
              }  # 2017-06-17: end of test for a k1-subject with a k13-tkb.
              if ($dirobj == 1) { $actpsi = $k[1] }  # 2017-06-17
              $subjpsi = $motjuste;  # 2017-06-17: for selection of verb-form.
              $snu = $k[8];  # 2017jun17: for parameter in verb-selection; 
              $aud = $k[14];      # 2018-09-28: normal recall-vector for Speech()
              $audjuste = $k[14]; # 2017-06-17: temporary recall-vector for Speech
              $tseln = $i;        # 2017-06-17: use time-point for inhibition. 
              $tsels = $i;        # 2017-06-17: use time-point for inhibition. 
              $act = $k[3];       # 2017-06-17: noun must have higher act to win
            }  # 2017-06-17: end of test for a higher activation $act
          }  # 2017-06-17: end of test for a k[13] tkb verblock
        }  # 2017-06-17: end of test for noun or pronoun as subject
      }  # 2017-06-17: end of test for human language code $hlc == 3
    }  # 2017-06-17: End of (for loop) searching for most active "motjuste"
  } # 2017-06-17: end of test for absence of a $nounlock.
  my @k=split(',',$psy[$tsels]);  # 2017-06-17: inspect subject at time of selection;
  $psy[$tsels]="$k[0],$k[1],$k[2],-90,$k[4],$k[5],$k[6],"
  . "$k[7],$k[8],$k[9],$k[10],$k[11],$k[12],$k[13],$k[14]"; # 2017-06-17: concatenate
  if ($subjectflag == 0) {  # 2017-06-17: i.e., dir.obj or pred.nom;
    if ($nounlock > 0) {  # 2017-06-17: if verb is locked to a particular $seq...
      my @k=split(',',$psy[$nounlock]);  # 2017-06-17: inspect t=nounlock row;
#     print " t= $t nounlock= $nounlock ";  # 2017-06-17: DIAGNOSTIC reserve
      $motjuste = $k[1];  # 2017-06-17: nounlock psi pre-empts search.
      $act = $k[3];  # 2017-06-17: let activation-level play its role here;
      $aud = $k[14]; # 2017-06-17: k14 recall-vector to auditory engram. 
    }  # 2017-06-17: end of test for a positive nounlock.
  }  # 2017-06-17: end of test for not-a-subject before using ELSE
  if ($audjuste > 0) {  # 2017-06-17: avoid "I" for "YOU" or "YOU" for "I"
    $aud = $audjuste;  # 2017-06-17: for transfer into Speech() module
  }  else {  # 2017-06-17: 
    for (my $i=$t; $i>$midway; $i--) {  # 2017-06-17: search backwards in time.
      my @k=split(',',$psy[$i]);  # 2017-06-17: inspect @psy flag-panel
      $act = $k[3];  # 2017-06-17: let activation-level play its role here;
      if ($motjuste == $k[1]) {  # 2017-06-17: find motjuste for sake of rv
        if ($subjectflag == 1 && $k[7] == 1) {   # 2017-06-17: subject?
          if ($k[14] > 0) { $aud = $k[14] }  # 2017-06-17: find positive $rv; 
          if ($k[14] > 0) { last }  # 2017-06-17: exit loop if $rv is found.
        }  # 2017-06-17: end of test for subject and for nominative case.
        if ($dirobj == 1 && $k[7] == 4) {   # 2017-06-17: direct object?
          if ($k[14] > 0) { $aud = $k[14] }  # 2017-06-17: find positive $rv; 
          if ($k[14] > 0) { last }  # 2017-06-17: exit loop if $rv is found.
        }  # 2017-06-17: end of test for direct object and accusative case.
      }  # 2017-06-17: end of test to find $motjuste with valid $rv.
   }  # 2017-06-17: End of (for loop) searching through @psy conceptual array. 
  }  # 2017-06-17: end of else-clause for when recall-vector is zero.
  if ($nounlock == 0) {  # 2017-06-17: if no nounlock override; 
    if ($mjact < 20) {  # 2017-06-17: if no subject active enough for chain-of-thought
      if ($subjectflag == 1) {  # 2017-06-17: default to "I" only as subject
        $actpsi = 1701;  # 2017-06-17: send 1701=I ego-concept into SpreadAct()?
        $motjuste = 1701;  # 2017-06-17: 1701=I default concept of AI Mind
        for (my $i=$t; $i>$midway; $i--) {  # 2017-06-17: search for "I"
          my @k=split(',',$psy[$i]);  # 2017-06-17: examine @psy
          if ($k[1]==1701 && $k[13]>0) { # 2017-06-17: I=1701 with $tkb verblock?
            if ($k[3] > $defact) {  # 2017-07-16: if higher k3 act is found;
              $tseln = $i;  # 2017-06-17: retain time of motjuste; 
              $tsels = $i;  # 2017-06-17: retain time of Russian subject;
              $actpsi = $k[1];    # 2017-06-17: psi with activation to spread
              $defact = $k[3];    # 2017-06-17: dynamic metric;
              $verblock = $k[13]; # 2017-06-17: k13 $tkb as verblock; 
              $aud = $k[14];      # 2017-06-17: recall-vector for auditory engram
            }  # 2017-06-17: end of test for higher-act ego-concept;
          }  # 2017-06-17: end of test for "1701=ego" with seq-check;
        }  # 2017-06-17: end of search for least-inhibited "1701=ego"; 
        $dba = 1;        # 2017-06-17: From RuAi; subject requires nom. case; 
        $nphrnum = 1;    # 2017-06-17: for RuVerbPhrase();
        $nphrpos = 7;    # 2017-06-17: prevent article "A" with "I"?
        $prsn = 1;       # 2017-06-17: for use elsewhere; 
        $subjnum = 1;    # 2017-06-17: for use elsewhere;
        $subjpsi = 1701; # 2017-06-17: for use elsewhere;
        $topic = 1701;   # 2017-06-17: for question-asking modules; 
        for (my $i=$t; $i>$midway; $i--) {  # 2017-06-17: parameters for 1701=ego.
          my @k=split(',',$psy[$i]);  # 2017-06-17: examine @psy
          if ($k[1] == 1701) {  # 2017-06-17: if 1701=ego is found;
            if ($k[7] == 1) {  # 2017-06-17: k7/dba must be nominative=1; 
              $audjuste = $k[14];  # 2017-06-17: "ego" recall-vector;
              $aud = $k[14];  # 2017-06-17: "ego" recall-vector for Speech()
              if ($k[14]>0) { $aud=$k[14] }        # 2018-09-28: insurance
              if ($k[14]>0) { last }             # 2018-09-28: insurance
            }  # 2017-06-17: end of test for nominative "ego"; 
          }  # 2017-06-17: End of search for 1701=ego;
        }  # 2017-06-17: end of 1701=ego search based on parameters.
      }  # 2017-06-17: end of test for "ego" to become subj. not obj.
    }  # 2017-06-17: end of test for low activation warranting a default
  }  # 2017-06-17: end of test for absence of pre-ordained nounlock;
  Speech();  # 2017-0617: speak the word starting at the $aud time. 
  $dirobj = 0;    # 2017-06-17: reset for safety
  $mjact = 0;     # 2017-06-17: reset for safety.
  $motjuste = 0;  # 2017-06-17: reset for safety. 
}  # 2018-09-28: RuNounPhrase() returns to Russian RuIndicative() module


5. Variables for First Working Artificial General Intelligence

$motjuste -- (from French) best word for inclusion in a thought.


6. Troubleshooting and Robotic Psychosurgery

6.1.a. Symptom: (Something goes wrong.)
6.1.b. Solution: (AI Mind Maintainer devises solution.)


7. Future Development


8. Resources


Please see also

http://ai.neocities.org/EnNounPhrase
http://mind.sourceforge.net/n-phrase.html

http://cyborg.blogspot.com/search/label/Russian -- is a special weblog URL which invites Netizens to view blog-posts discussing the RuNounPhrase and other Russian mind-modules.


9. AiTree of First Working AGI Mind-Modules


Return to top; or to
http://www.gotai.net/forum -- Russian-language AI forum;
http://ai.neocities.org/Dushka.html -- obsolete Russian AI;
http://github.com/kernc/mindforth/blob/master/wiki/RussMan.wiki
http://en.wikipedia.org/wiki/Natural_language_understanding -- solved.
http://old.reddit.com/r/ControlProblem -- NOT SOLVED.
javascript subreddit for AI Mind discussion;
Forth subreddit for MindForth discussion;
Perl subreddit for ghost.pl AI Mind Maintainers.