Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Buy land. They've stopped making it." -- Mark Twain


devel / comp.lang.perl.misc / EnParser Module of AI4U Artificial Intelligence

SubjectAuthor
o EnParser Module of AI4U Artificial IntelligenceA.T. Murray

1
EnParser Module of AI4U Artificial Intelligence

<70fb4e8d-b294-4723-98d2-42bd02aca272n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9989&group=comp.lang.perl.misc#9989

  copy link   Newsgroups: comp.lang.perl.misc
X-Received: by 2002:ac8:5b05:0:b0:403:3683:62a2 with SMTP id m5-20020ac85b05000000b00403368362a2mr4327qtw.11.1690519083298;
Thu, 27 Jul 2023 21:38:03 -0700 (PDT)
X-Received: by 2002:a05:6870:c8a7:b0:1bb:734c:eb8b with SMTP id
er39-20020a056870c8a700b001bb734ceb8bmr7123640oab.0.1690519082807; Thu, 27
Jul 2023 21:38:02 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.perl.misc
Date: Thu, 27 Jul 2023 21:38:02 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=174.165.126.120; posting-account=rS-ITgoAAAC4XLmmHKI5_C5lMSeqZBAF
NNTP-Posting-Host: 174.165.126.120
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <70fb4e8d-b294-4723-98d2-42bd02aca272n@googlegroups.com>
Subject: EnParser Module of AI4U Artificial Intelligence
From: mentific...@gmail.com (A.T. Murray)
Injection-Date: Fri, 28 Jul 2023 04:38:03 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 609
 by: A.T. Murray - Fri, 28 Jul 2023 04:38 UTC

EnParser English Parser Module of the
English and Russian bilingual ghost.pl AI in Perl
Mens Latina in Latin -- MindForth for Robots

1. Diagram of the EnParser English Parser Module

/^^^^^^^^^\ EnParser Tags Subject-Verb-Object /^^^^^^^^^\
/ EYE \ MINDCORE _____ / EAR \
/ \ CONCEPTS /New- \ / \
| _______ | | | | _____ (Concept)-|-------------\ |
| /old \ | | | | /Old- \ \_____/ | Audition | |
| / image \---|-----+ | (Concept)------|---|----------\ | |
| \ recog / | | | | \_____/-------|---|-------\ | | |
| \_______/ | a| | | |________V | c | | | |
| | b|C| | / EnParser \ | a | | | |
| visual | s|O|f| \__________/ | t | | | |
| | t|N|i| |noun? | s-/ | | |
| memory | r|C|b| |verb? | | | |
| | a|E|e| |adj.? | e | | |
| channel | c|P|r| |adverb? | a | | |
| | t|T|s| |prep.? | t-----/ | |
| _______ | | | | |conj.? | | |
| /new \ | |_|_| ______V____ | f | |
| / percept \ | / \ / \ | i | |
| \ engram /---|--\ Psi /-----( InStantiate ) | s | |
| \_______/ | \___/ \___________/ | h-------/ |

2. Purpose of the EnParser English Parser Module

EnParser serves the purpose of not only identifying a part of speech such as a noun, preposition or verb, but also of comprehending the part of speech in context by helping to assign associative tags among concepts in the Psy conceptual array. Thus EnParser and its Russian counterpart RuParser serve the purpose of Natural Language Understanding (NLU).

3. Algorithm of the EnParser AI Mind-Module

Since the main feature of the concept-based AI Minds is their demonstration of solving the AI-hard problem of natural language understanding (NLU), the EnParser module for parsing English is the main instrument of achieving the NLU goal.

The ghost.pl AI Mind in Strawberry Perl Five is becoming a conversational agent that may be installed to run in either the background or the foreground on any host computer.

The JavaScript AI Mind requires no download of either source code or programming language. Simply clicking on the link brings the tutorial AI Mind into your MSIE browser, where you may use the AI to teach students or AI coders.

If you want to issue verbal instructions to your autonomous humanoid robot, MindForth as the robot brain enables you and the robot to engage in a discussion of what work the robot should be doing, and how the work should be done, and how the robot should engage in back-and-forth communication using English for you to clarify youe instructions and for the robot to report to you its completion of tasks.

3.A. Words included in the MindBoot sequence lighten the load of EnParser.

Populating the MindBoot sequence with English words, the AI mind maintainer tries to include the most frequent English nouns and verbs, all the conjunctions, all the prepositions, and all the pronouns. Except for disambiguation, the embedded words do not need further parsing as to their parts of speech.

3.B. The first AI Minds could only parse SVO sentences into nouns and verbs..

The subject-verb-object (SVO) format of admissible inputs made it simple for the earliest AI Minds to classify English words as nouns or verbs. The parsing module could skip over the known English articles and an important adverb like the word "NOT" being used to negate an English sentence.

3.C. The ghost112.pl AI became able to parse prepositional phrases.

Since the MindBoot sequence innately contains all the English prepositions identified as such, the AI Mind easily detects the input of a known English preposition and sets the $prepcon flag to a positive number one and loads the $tpp time-of-preposition flag with the ending time-point at which the input preposition is being instantiated as a node in conceptual memory. Then $tpp is used to zero in on the associative-tag flag-panel of the preposition, filling in the next noun or pronoun as the $seq of the preposition. Then the $tvb time-of-verb flag is used to insert the concept-number of the preposition as a $seq of the verb.

3.D. The ghost114.pl AI began to parse the indirect objects of verbs.

To parse and comprehend an indirect object, EnParser tentatively fills the time-of-indirect-object $tio flag with the input-time of the first noun being input after a verb. The $tio flag is set only once by requiring that it be at zero for it to be set. Simultaneously, the time-of-direct-object flag $tdo is filled with the same value as the $tio flag for an indirect object, because it is not yet known whether one noun or two nouns are being entered subsequent to the input of a transitive verb. If and when a second noun comes in, the value for the time-of-direct-object $tdo flag, originally filled with the same value as the indirect-object $tio flag, is replaced or overwritten with the new time of the second post-verb noun in the input stream.

If only one noun comes in after the verb, the identifier of the direct object is set only once. If two post-verb nouns come in, the first noun becomes the indirect object and the second noun becomes the direct object.

3.E. The ghost309.pl AI became able not only to parse the input of a prepositional phrase but also to think with a prepositional phrase.

4. Code of EnParser() from ghost327.pl AI source code in Perl

# 2017-09-03: Requirements of English Parser module:
# 2017-09-13: EnParser shall at first assume that a new word is a noun.
sub EnParser() { # http://ai.neocities.org/EnParser.html
if ($pos == 5 || $pos == 7) { # 2019-10-19: if noun or pronoun....
if ($tsj == 0) { $dba = 1; } # 2019-10-19: if not subject has been declared...
if ($tult == $tdo) { $dba = 4; } # 2019-10-19: acc. dir. obj.
} # 2019-10-19: end of test for noun or pronoun.
$act = 48; # 2016apr27: an arbitrary activation for InStantiate()
$bias = 5; # 2015jun04: Expect a noun until overruled.
$tkb = 0; # 2019-10-22: BUGFIX
if ($fyi > 2) { # 2016feb08: if mode is Diagnostic
# 2018-07-01: Diagnostic or tutorial message.
} # 2016feb07: end of test for Diagnostic or Tutorial mode.
InStantiate(); # 2019-08-08: first instantiation during parsing Stage One
if ($pos == 5) { $bias = 8 } # 2016feb10: after noun, expect verb.
if ($pos == 7) { $bias = 8 } # 2016feb10: after pronoun, expect verb.
if ($pos == 8) { $bias = 5 } # 2016feb10: after verb, expect noun
if ($prepcon == 0) { # 2017-09-13: if not handling a preposition...
if ($pos == 5 || $pos == 7) { # 2016mar21: expanding then-clause
# $tsj = ($t - 1); # 2017-09-13: subject?
# $tsj = ($t - 1); # 2019-10-19: declare subject-time elsewhere?
if ($verbcon == 1) { # 2017-09-13: if a verb has come in...
if ($tvb > 0) { $tdo = $tult; } # 2019-10-19: a default value.
if ($tio == 0) {$tdo = $tult} # 2017-09-13: set once or twice
if ($tio == 0) {$tio = $tult} # 2017-09-13: set only once
if ($tio > 0) { # 2017-09-13: if $tio previously set...
$tdo = $tult; # 2017-09-13: second noun sets time of dir.obj.
} # 2017-09-13: end of test to make 2nd noun the direct object.
$tkb = $tdo; # 2019-10-18: let verb have a "nounlock" to direct object.
my @k=split(',',$psy[$tvb]); # 2017-09-13: expose flag-panel of verb
$pre = $k[1]; # 2017-09-13: verb psi will be $pre of direct object
@k=split(',',$psy[$tio]); # 2017-09-13: expose flag-panel of indir.obj.
$iob = $k[1]; # 2019-08-01: excerpt indirect-object concept for k[13]
$psy[$tio]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
. "3,$k[8],$k[9],$k[10],$k[11],$k[12],$k[13],"
. "$k[14],$k[15],$k[16],$k[17],$k[18],$k[19],$k[20]"; # 2019-08-01: panel
# 2017-09-13: Above lines insert k7 dba=3 for dative-case indirect object.
@k=split(',',$psy[$tdo]); # 2017-09-13: expose flag-panel of dir..obj.
$psy[$tdo]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
. "4,$k[8],$k[9],$k[10],0,$k[12],$k[13],"
. "0,$k[15],$k[16],$k[17],$k[18],$k[19],$k[20]"; # 2019-08-02: no $tkb for dir.obj.
# 2017-09-13: Above lines insert verb-$psi as k10 $pre of direct object.
@k=split(',',$psy[$tvb]); # 2017-09-13: expose flag-panel of main verb.
if ($k[5]==250) { $k[7]=0;$k[8]=0; } # 2019-10-23: negated verb is dba=0 infinitive.
$tdo = $t - 1; # 2017-09-13: insert time-of-direct-object for nounlock;
$tkb = $tdo; # 2017-09-13: TEST
# 2017-09-13: Next two lines create psy-array row for a verb.
$psy[$tvb]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
. "$k[7],$k[8],$k[9],$k[10],$psi,$k[12],$iob,"
. "$tkb,$k[15],$k[16],$k[17],$k[18],$k[19],$k[20]"; # 2019-08-01: panel.
@k=split(',',$psy[$tdo]); # 2019-10-19: expose flag-panel of direct object
$psy[$tdo]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
. "4,$k[8],$k[9],$k[10],$k[11],$k[12],$k[13]," # 2019-10-19: acc. dba=4 dir.obj.
. "$k[14],$k[15],$k[16],$k[17],$k[18],$k[19],$k[20]"; # 2019-10-19: tdo-panel
} # 2017-09-13: end of test for a condition following a verb.
} # 2017-09-13: end of test for noun not object of a preposition.
} # 2017-09-13: end of test for a non-prepositional condition.
if ($pos == 6) { $prepcon = 1 } # 2019-09-24: prepare for noun.
if ($pos == 5 || $pos == 7) { # 2017-09-13:
if ($prepcon == 1) { # 2017-09-13:
my @k=split(',',$psy[$tpr]); # 2019-08-06: expose flag-panel of preposition;
$pre = $k[1]; # 2017-09-13: Let $pre briefly be the preposition.
$prep = $k[1]; # 2018-11-08: identify prep. to be the $seq of the verb.
$k[14] = $tult; # 2019-08-01: establish $tkb between preposition and its object.
@k=split(',',$psy[$tult]); # 2017-09-13: expose flag-panel of obj of prep.
$psy[$tult]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
. "4,$k[8],$k[9],$pre,0,$k[12],$k[13],"
. "$k[14],$k[15],$k[16],$k[17],$k[18],$k[19],$k[20]"; # 2019-08-01: panel.
$prep = 0; # 2018-11-08: Reset to prevent carry-over.
$prepcon = 0; # 2017-09-13: Reset to prevent carry-over.
} # 2017-09-13: end of test for a positive $prepcon.
} # 2017-09-13: end of test for a noun or pronoun.
if ($pos == 8 && $psi != 800 && $psi != 818) { # 2019-08-06: not "BE" or "DO"
$tvb = ($t - 1); # 2017-09-13: hold onto time-of-verb for flag-insertions.
$verbcon = 1; # 2017-09-13: verb-condition is "on" for ind. & dir. objects.
my @k=split(',',$psy[$tsj]); # 2017-09-13: expose flag-panel of subject noun
$subjpre = $k[1]; # 2017-09-13: Hold onto $subjpre for the pos=8 verb
$psy[$tsj]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
. "1,$k[8],$k[9],$k[10],$psi,$k[12],$k[13],"
. "$tvb,$k[15],$k[16],$k[17],$k[18],$k[19],$k[20]"; # 2019-08-01
@k=split(',',$psy[$tult]); # 2017-09-13: expose flag-panel of verb.
$psy[$tult]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
. "$k[7],$k[8],$k[9],$subjpre,0,$k[12],$k[13],"
. "$k[14],$k[15],$k[16],$k[17],$k[18],$k[19],$k[20]"; # 2019-08-01
$subjpre = 0; # 2017-09-13: Reset for safety.
} # 2017-09-13: end of test for a pos=8 verb.
# if ($pos == 8 && $psi == 800) { # 2019-10-18: if 800=BE verb....
if ($pos == 8) { # 2019-10-19: any verb...
$tvb = ($t - 1); # 2019-10-18: hold onto time-of-verb for flag-insertions.
my @k=split(',',$psy[$tsj]); # 2019-10-18: expose flag-panel of subject noun
$psy[$tsj]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
. "$k[7],$k[8],$k[9],$k[10],$psi,$k[12],$k[13]," # 2019-10-18: verb is "seq" of noun.
. "$tvb,$k[15],$k[16],$k[17],$k[18],$k[19],$k[20]"; # 2019-10-18: verb "tkb" of noun.
} # 2019-10-18: end of test for 800=BE verb.
# if ($tpr > 0 && $pos == 5) { # 2019-08-11: if a noun follows a preposition...
if ($tpr > $vault && $pos == 5) { # 2019-10-22: if a noun follows a preposition...
my @k=split(',',$psy[$tpr]); # 2019-08-10: expose flag-panel at time-of-prep.
$tkb = ($t-1); # 2019-08-11: time of object of preposition
$psy[$tpr]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
. "$k[7],$k[8],$k[9],$k[10],$k[11],$k[12],$k[13],"
. "$tkb,$k[15],$k[16],$k[17],$k[18],$k[19],$k[20]"; # 2019-08-11
} # 2019-08-11: end of test for a noun after a preposition.
if ($pos == 6 && $mri > 0) { # 2019-09-24: removing restriction to input-only.
$tpr = ($t - 1); # 2019-08-11: time-of-preposition for back-tag insertion.
my @k=split(',',$psy[$mri]); # 2019-08-10: expose flag-panel of most-recent word
$psy[$mri]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
. "$k[7],$k[8],$k[9],$k[10],$k[11],$k[12],$k[13],"
. "$k[14],$k[15],$k[16],$k[17],$k[18],$tpr,$k[20]"; # 2019-08-11
$etc = 0; # 2019-09-26: thwart compounding of thought at first after a preposition.
$tpr = 0; # 2019-10-22: prevent carry-over. TEST; TRUNCATE
} # 2019-09-24: end of test for preposition part-of-speech and positive $mri value.
if ($pos == 8) { # 2019-10-19: if part-of-speech is 8=verb...
if ($psi != 818) { # 2019-10-19: if verb other than auxiliary 818=DO...
$verbcon = 1; # 2019-10-19: verb condition is "on" for indir. and dir. objects.
} # 2019-10-19: end of test for not auxiliary 818=DO.
my @k=split(',',$psy[$tsj]); # 2019-10-19: expose flag-panel at time-of-subject
$psy[$tsj]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
. "$k[7],$k[8],$k[9],$k[10],$psi,$k[12],$k[13]," # 2019-10-19: seq = verb.
. "$k[14],$k[15],$k[16],$k[17],$k[18],$k[19],$k[20]"; # 2019-10-20
} # 2019-10-19: end of test for a pos=8 verb.
if ($pos == 5 || $pos == 7) { # 2019-10-22: noun or pronoun as direct object
my @k=split(',',$psy[$tdo]); # 2019-10-19: expose flag-panel of direct object
$psy[$tdo]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
. "4,$k[8],$k[9],$svo2,0,$k[12],$k[13]," # 2019-10-22: dba=4 pre=verb seq=0
. "$k[14],$k[15],$k[16],$k[17],$k[18],$k[19],$k[20]"; # 2019-10-22: tdo-panel
} # 2019-10-22: end of test for a noun or pronoun.
if ($pos == 1) { # 2019-10-22: if adjective
$tult = ($t -1); # 2019-10-22: certify
my @k=split(',',$psy[$tult]); # 2019-10-22: expose flag-panel
$psy[$tult]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
. "$k[7],$k[8],$k[9],$k[10],$k[11],$k[12],$k[13]," # 2019-10-22
. "$k[14],$k[15],$k[16],$k[17],$k[18],0,$k[20]"; # 2019-10-22: no tpr for adjective.
} # 2019-10-22: end of test for pos=1 adjective
if ($pos == 6) { # 2019-10-22: if preposition
$tult = ($t -1); # 2019-10-22: certify
my @k=split(',',$psy[$tult]); # 2019-10-22: expose flag-panel
$psy[$tult]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
. "$k[7],$k[8],$k[9],$k[10],$k[11],$k[12],$k[13]," # 2019-10-22
. "$k[14],$k[15],$k[16],$k[17],$k[18],0,$k[20]"; # 2019-10-22: no tpr for prep.
} # 2019-10-22: end of test for pos=6 preposition.
} # 2019-10-19: EnParser() returns to OldConcept() or NewConcept().


Click here to read the complete article

devel / comp.lang.perl.misc / EnParser Module of AI4U Artificial Intelligence

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor