AudRecog auditory recognition module of the

First Working Artificial General Intelligence

ghost.pl for webservers -- MindForth for robots


1. Diagram of AudRecog Auditory Recognition Mind-Module

   /^^^^^^^^^\  Auditory Recognition of "c-a-t-s"  /^^^^^^^^^\
  /    EYE    \ REACTIVATED                       /   EAR     \
 /             \ CONCEPTS                        /"CATS"=input \
|   _______     |   | | |    SEMANTIC MEMORY    |               |
|  /old    \!!!!|!!!| | |                       |  C     match! |
| / image   \---|-----+ |             ___       |  -A    match! |
| \ fetch   /   |   |c| |            /   \      |    R    stop  |
|  \_______/    |   |a| |           /     \     |     S   drop  |
|               |   |t| |          / Old-  \    |               |
|  visual       |   |s| |         ( Concept )   |  C     match! |
|               |  e| | |          \       /    |  -A    match! |
|  memory       |  a| | |          /\     /!!!!!|!!!!T   match! |
|               |  t| | |   ______/  \___/------|-----S  recog! |
|  reactivation |   | |f|  /      \             |               |
|               |   | |i| ( Parser )            |  C     match! |
|  channel      |   | |s|  \______/             |  -A    match! |
|   _______     |   | |h|      |                |  --T   match! |
|  /old    \    |   |_|_|     _V_________       |  ---S   busy  |
| / image   \   |  /     \   /           \      |      U  drop  |
| \ store   /---|--\ Psi /--( InStantiate )     |       P drop  |
|  \_______/    |   \___/    \___________/      |               |


2. Purpose

The AudRecog() module uses quasi-neuronal activation to recognize words by matching up a chain of activated phonemes until the end of a word of input is reached and a matching word in auditory memory is either found, resulting in a call to the OldConcept mind-module, or not found, resulting in a call to the NewConcept mind-module.

The ghost.pl AI Mind in Perl uses an AudRecog() algorithm much simpler in construction than the older algorithm used in the older AI Minds. Since the introduction of the Perl AI, the @aud auditory array no longer uses the beg flag to hold on to the beginning of a word in memory, or the ctu continuation-flag to indicate whether a word continues from one phonemic character to the next. Instead, the ghost.pl AI and the newer versions of the MindForth AI dynamically ascertain whether a phonemic character is the beginning of a word in memory, and whether a phonemic character is the final character of a word stored in the auditory memory.

AudRecog() must eventually make the switch from keyboard entry of characters as if they were phonemes and morphemes, to actual acoustic input of sound-wave phonemes and morphemes.


3. Algorithm

AudMem() calls AudRecog() to process each character of dynamic input from the keyboard or from the Speech() module during re-entry of output back into the AI Mind. For the first character of an input word, AudRecog() finds every initial instance of the same first character starting a word stored in memory as far back as the $midway time-point, which may be set to zero in early versions of the first working artificial intelligence.

As each additional character comes in, AudRecog() activates the next-in-line character in the thus-far matching stored word, for the sake of continuing the match-up with the next incoming character. The next incoming character continues the next-in-line activation only if the found character not only matches the input character but also carries the arbitrary activation ordained in the software by the AI Mind Maintainer. In that way, some partial recognitions die out and do not result in a final match, as soon as one stored character fails to match the input stream.

As the match-up process approaches the end of a word stored in the @ear auditory memory channel, enough of the stored word as to constitute a stem of an inflected word should have an $audpsi concept-number at the end of the row holding the final stem-character, such as the letter "K" in the stored plural word "BOOKS". Then the final letter itself will also have the $audpsi concept-number, so that either the stem or the full word for a concept may be recognized. As part of the same process for word-recognition, the AudMem() module stores not only the $audpsi concept-number at the end of a word being stored, but also at the end of an array-row holding the character calculated to be the end of the stem of a word.


4. Code of AudRecog() from the ghost273.pl AI Mind in Perl

sub AudRecog() {  # http://ai.neocities.org/AudRecog.html
  if ($len > 0 && $finlen == 0 && $pho eq chr(32)) { $finlen = $len }  # 2017-12-26
  if ($pho ne chr(13)&& $pho ne chr(32) && $pho ne "\N{U+0}") { # 2017-12-24: 
    if ($audrec  > 0) {  # 2017-03-16: if positive $audrec before end of word...
      if ($pho ne chr(83)) {  # 2017-03-15: keep audrec if current pho is 83=S  
        if ($audrec > 0) { $prc = $audrec }  # 2018-09-16: preserve non-final $audrec
        $audrec = 0;  # 2017-03-16: zero out non-final audrec.
      }  # 2017-03-15: end of test for final "S" as inflectional ending.
    }  # 2017-03-15: end of test for $audrec before word-end
  }  # 2017-03-15: end of test for an alphabetic character
  if ($pho eq chr(32) || $pho eq chr(13) || $pho eq "\N{U+0}") {  # 2017-126 
    if ($fyi > 0) {  # 2017-12-26: show message
    # print " AudR after audrec= $audrec finds CR-13 or SP-32 \n";  # 2017-12-26
    } # 2017-04-05: end of test for fyi=4 Diagnostic Mode.
    if ($audrec > 0) {  # 2017-03-15: if positive audrec before 32=SPACE...
      $audpsi = $audrec;  # 2017-03-15: recognized item becomes storage item.
    }  # 2017-03-15: end of test for a positive audrec before 32=SPACE
  }  # 2017-03-15: end of test for a positive audrec before 32=SPACE
  for (my $i=$spt; $i>$midway; $i--) {  # 2017-03-15: search backwards in time.
    if ($pho ne chr(32)) {  # 2017-03-15: disregard 32=SPACE pho until end of input. 
      my @aud=split(',',$ear[$i]);  # 2017-03-15: separate @ear rows into parts.
      if ($pho ne $aud[0]) { $ear[$i] = "$aud[0],0,$aud[2]" }  #2017-03-15: de-activate
      if ($pho eq $aud[0])  { # 2017-03-15: If incoming pho matches stored aud0;
        if ($aud[1]==0) { # 2017-03-15: if matching engram has no activation;
          my @prv=split(',',$ear[$i-1]);  # 2017-03-15: "@prv" for "previous" row.
          if ($prv[0] eq chr(13) || $prv[0] eq chr(32) || $prv[0] eq "\N{U+0}") { # 2017-12-24:
            if ($audrun < 2) { # 2017-03-15: "if comparing start of a word"
              my @nxr=split(',',$ear[($i+1)]);  # 2017-03-15: for next-in-line char
              if ($nxr[0] ne chr(13) && $nxr[0] ne chr(32)) {  # 2017-12-24
                $ear[$i+1] = "$nxr[0],8,$nxr[2]"; # 2017-03-15: "activate N-I-L charcter"
              }  # 2017-03-15: end of test for continuation of stored comparand. 
              my @aud=split(',',$ear[($i)]);  # 2017-03-15: for current char
              if ($aud[2] > 0)  {  # 2017-03-15: if concept number present
#               $audrec = $aud[2];  # 2017-03-15: automatic recog for single char.
                $prc = $aud[2];  # 2017-12-26: provisional recognition
              }  # 2017-03-15: end of test for potential monopsi ultimate-tag
            }  # 2017-03-15: "end of test for audrun=1 start of word"
          }  # 2017-03-15: "end of test for a beg(inning) non-active aud0" 
        }  # 2017-03-15: "end of test for matching aud0 with no activation"
        my @aud=split(',',$ear[$i]);  # 2017-03-15: break apart @ear auditory array.
        if ($aud[1] > 0) {  # 2017-03-15: "If matching aud0 has activation"
          my @nxr=split(',',$ear[($i+1)]);  # 2017-03-15: for next-in-line char
          if ($nxr[0] eq $pho) {  # 2017-12-26: TEST
            $ear[$i+1] = "$nxr[0],8,$nxr[2]"; # 2017-12-26: "activate N-I-L character"
          }  # 2017-12-26: end of match-test
          if ($nxr[0] eq chr(13) || $nxr[0] eq chr(32) || $nxr[0] eq "\N{U+0}") { # 2017-12-26
            if ($aud[2] > 0) {  # 2017-03-15: check for an audpsi tag
              $prc = $aud[2]; # 2017-10-20: provisional recognition of a stem 
            }  # 2017-03-15: end of test for an available audpsi.
          }  # 2017-03-15: end of test for next-in-line non-alphabetic character.
          if ($aud[2] > 0) { $prc = $aud[2] }  # 2018-09-16: provisional recognition.
          if ($fyi > 0) {  # 2017-12-26: show message only during Diagnostic Mode    
          }  # 2017-04-05: end of test for fyi=4 Diagnostic Mode.
          if ($pho eq chr(32) || $pho eq chr(13) || $pho eq "\N{U+0}") { # 2017-12-26
            if ($audrec > 0) {  # 2017-03-15: if an audrec has been found...
              $audpsi = $audrec;  # 2017-03-15: send audpsi into AudMem
            } # 2017-03-15: end of test for a positive audrec
          }  # 2017-03-15: end of test for SPACE-32 or CR-13
          if ($pho ne chr(32)&& $pho ne chr(13)&& $pho ne "\N{U+0}") { # 2017-12-26
            my @nxr=split(',',$ear[($i+1)]);  # 2017-03-15: for next-in-line char
            if ($nxr[0] ne chr(32) && $nxr[0] ne "\N{U+0}" && $finlen==0) { # 2017-12-26
              $ear[$i+1] = "$nxr[0],8,$nxr[2]"; # 2017-03-15: "activate N-I-L character"
            }  # 2017-03-15: since next engram is a letter...
          }  # 2017-03-15: end of test for 32-SPACE after input word.
        }  # 2017-03-15: "End of test for matching aud0 with activation."
      }  # 2017-03-15: "End of test for a character matching 'pho'."
    }  # 2017-03-15: end of test for alphabet letter 
  }  # 2017-03-15: End of backwards search through auditory memory. 
  if ($audrec > 0) { $audpsi = $audrec }  # 2017-12-26: TEST 
  if ($prc > 0) {    # 2017-10-20: 
    $audrec = $prc;  # 2017-10-20: from Dushka RuAi; prov. recog;
    if ($audrec > 0) { $audpsi = $audrec }  # 2018-09-16: for passage to AudMem()
  }  # 2017-10-20
  $audrun++;   # 2017-03-15: audrun is only a counter, not a factor.
}  # 2017-03-15: End of AudRecog(); return to AudMem()


5. Troubleshooting and Robotic Psychosurgery

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

A team of AI Mind Maintainers may debug the AudRecog() module by first inserting, and later commenting out, diagnostic messages to inform the AI coder what is happening inside the AudRecog() module at various stages of its operation, and what values are carried by variables used within the AudRecog() module.


6. Variables

$audpsi -- concept number of word in @ear auditory memory array.

$audrec -- auditory recognition concept-number.

$audrun -- in the AudRecog() module, which increments audrun, it is a counter of how many times the incrementing module has been called. If the audrun count is at unitary one or below two, then the initial character at the start of a word is being processed. audrun is reset to one in the AudInput() and FileInput() modules.

$finlen -- (obsolete) fin(al) len(gth) or end-of-word for AudRecog.

$fyi -- (for your information) 2 = Tutorial mode; 3 = Diagnostic mode

$len -- length, for avoiding input non-words. The len variable increments with each additional character during AudInput, and is reset to zero at the end of OldConcept and NewConcept.

$midway -- dynamically adjustable time-limit for searching backwards in the experiential memory of the AI.

$pho -- a "phoneme" or character of auditory input.

$prc -- provisional recognition in AudRecog()


7. Future Development

AudRecog() must eventually be made to work with acoustic phonemes for speech recognition, instead of keyboard characters representing phonemes.


8. Resources

Please see

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

http://theintercept.com/2018/06/25/interpol-voice-identification-database

http://thoughtistblog.wordpress.com/2018/08/03/on-morphology-and-contra-some-current-machine-learning-techniques

  • https://www.youtube.com/watch?v=yFEiIWW-heE
    Making My Own Speech Recognition -- Published on October 14, 2018


    9. AiTree of First Working AGI Mind-Modules

    Return to top; or to
    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.
    If you have any questions about the First Working AGI, please Join the Discussion.
    Cyborg shows AI Mind Programming Journals.