;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; Double R Model ;; ACT-R 5.0 Language Comprehension Module ;; Jerry T. BAll ;; ;; 24 November 2003 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Double R Model is an ACT-R 5.0 implementation of ;; Double R Theory. Double R Theory consists of ;; Double R Grammar, a linguistic theory of the encoding ;; of Referential and Relational Meaning, and ;; Double R Process, a psycholinguistic theory of ;; the processing of English text into Double R Grammar ;; based representations. ;; This language module provides a framework for the ;; creation of language models covering specific domains ;; ;; It will eventually include sufficient coverage of the ;; grammar of English to support creation of models via ;; ;; (1) the addition of the appropriate vocabulary, ;; (2) an associative network of links between vocabulary items ;; to support lexical disambuation, and ;; (3) a situation model to ground the referents ;; of the referring expressions. ;; ;; The present version implements the basic grammar, ;; but does not yet make use of the associative network ;; or situation model. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Starting the language model ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; The language model runs in the ACT-R 5.0 cognitive modeling ;; environment under Allegro Common Lisp (ACL) 6.2. To start ;; the model, first start ACL then load ACT-R into ACL. After ;; this, start the TCL based "start environment" that comes with ;; ACT-R. Then type "(start-environment)" into the ACL debug window ;; to connect ACT-R to the start environment. From the start ;; environment GUI, click on the "Load Model" button and browse ;; to the location of the "language_model.txt" file. Select this ;; file to load the model. The supporting "lisp_code.cl" file ;; will be loaded automatically. ;; ;; Note: the lisp code file that gets loaded along with ;; the model must be called "lisp_code.cl" and ;; must be in the same directory as the model file ;; to get loaded properly ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Running the language model ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; To run the language module type the following at the debug ;; command prompt: ;; ;; (do-text "") ;; (do-text ". .") ;; (do-text ("" ") ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Sample expressions ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; With the current vocabulary, expressions like the following ;; can be processed: ;; ;; he ;; joe ;; the man ;; the old man ;; the very old man ;; he cried ;; he is crying ;; he is quietly crying ;; he hit the ball ;; he could not have hit the ball ;; he said the man hit the ball ;; he told me he hit the ball ;; ;; to get a feel for how the processor works try processing ;; a text adding one word at a time ;; ;; (do-text "the") ;; (do-text "the man") ;; (do-text "the man hit") ;; (do-text "the man hit the") ;; (do-text "the man hit the ball") ;; the file "sample_texts.txt" contains additional sample texts ;; that the language model is capable of processing ;; ;; ;; The following sentence forms are not yet supported: ;; ;; Questions ;; Relative clauses ;; ;; ;; The following other stuff is not yet supported: ;; ;; punctuation (except for periods) ;; capitalization ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Current limitations and potential problems ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; The language model is designed to process any text ;; but doesn't handle punctuation, other than periods. ;; ;; a capitalized word is currently distinct from an uncapitalized word ;; ;; if the model fails to attend to each word in the text ;; then its a bug in the model ;; there are some interactions with the RPM component of ACT-R that ;; can lead to problems in attending to each word ;; or attending to them in the proper order ;; (e.g. going from one line of text to the next) ;; ;; the model may not successfully analyze each word (especially ;; words that are not in the lexicon), but if the model ;; fails and stops, it's a bug, not a feature ;; ;; the "vision-module.lisp" file of the RPM component of ACT-R ;; uses a function called "(chop-string)" that divides text containing ;; a period into separate pieces of text. This function must be modified ;; in order to handle words containing periods (e.g. "e.g.") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Double R Grammar Basics ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Lexical Units -- Parts of Speech (POS) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; noun = noun (e.g. "man") ;; pronoun = pronoun (e.g. "he") ;; poss-pron = possessive pronoun (e.g. "my") ;; proper-noun = proper noun (e.g. "joe") ;; verb = verb (e.g. "cry") ;; intrans-verb = intransitive verb ;; (e.g. "run" in "he ran") ;; trans-verb = transitive verb ;; (e.g. "kick" in "He kicked the ball" ;; ditrans-verb = ditransitive verb ;; (e.g. "give" in "He gave me the ball") ;; verb-subj-sitcomp = verb that takes a situation complement ;; (e.g. "believe" in "I believe he likes me") ;; verb-subj-iobj-sitcomp ;; (e.g. "told" in "he told me you like him") ;; verb-subj-iobj-obj-sitcomp ;; (e.g. "bet" in "I bet you $50 they win") ;; adj = adjective (e.g. "sad") ;; prep = preposition (e.g. "on") ;; adv = adverb (e.g. "quickly") ;; det = determiner (e.g. "the, a, this, that") ;; quant = quantifier (e.g. "all, some, one") ;; auxiliary= auxiliary (e.g "is") ;; reg-aux = (non-modal) aux (e.g "is") ;; modal-aux = modal auxiliary (e.g. "could") ;; semi-aux = semi auxiliary (e.g. "seems" in "he seems happy") ;; negative = negative (e.g. "never") ;; not-negative (e.g. "not") ;; inf-mkr = the infinitive marker "to" ;; part = verb particle ;; (e.g. "up" in "he looked up the address") ;; conj = conjunction ;; (e.g. "and" in "the man and the woman") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Phrasal Units Components ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Double R Grammar adopts a modified X-Bar Theory approach ;; to representing the referential/relational structure of input texts ;; there are only two phrasal levels ;; maximal = XP ;; non-maximal = X ;; there is no distinct X' level ;; all maximal phrasal units are referring expressions. ;; ;; the basic referring expressions include: ;; ;; object referring expression -- ORE-- (aka NP) ;; predicate referring expression -- PRE -- (aka Verb Group) ;; situation referring expression -- SRE -- (aka clause) ;; ;; some additional referring expressions include: ;; ;; location referring expression -- LRE -- (aka PP or Adverbial) ;; direction referring expression -- DRE -- (aka PP or Adverbial ;; manner referring expression -- MRE -- (aka PP or adverbial) ;; all referring expressions have the following components ;; spec = specifier ;; mod = modifier (pre-head) ;; head = head ;; post-mod = modifier (post-head) ;; it is the specifier that determines a maximal projection ;; that is, it is the specifier that determines a referring expression ;; in the absence of a specifier, the head may determine a maximal projection ;; some heads (e.g. pronoun, proper noun, deictic words) are inherently referential ;; and do not require a specifier ;; specifiers are pre-head in English ;; modifiers are divided into pre-head and post-head ;; each component of a phrasal unit projects features that combine at the phrasal level ;; the following features are currently included: ;; ;; [obj|rel|sit] -- object or relation or situation (of specifiers and heads) ;; [sing|plural|mass] -- singular or plural or mass (of nouns or heads of OREs) ;; [def|indef] -- definite or indefinite (of specifiers) ;; [fin|inf] -- finite or infinite (of verbs) ;; ;; components may overlap features (e.g. [obj] [rel]) and when they do ;; the feature projection hierarchy determines which feature projects ;; ;; the feature projection hierarchy is ;; specifier > head > modifier ;; if a specifier feature conflicts with a head feature (e.g the[+obj] + kick[+rel]) ;; the specifier feature projects ;; some feature conflicts result in ungrammaticality (e.g. a[+sing] + men[+plural]) ;; if a head feature conflicts with a modifier feature, the head feature projects ;; (e.g. old[+rel] + man[+obj]) ;; note that feature projection is not yet implemented ;; and will eventually include "semantic" features as well ;; all non-maximal phrasal units (i.e X) ;; have the following components ;; note that there is no specifier since specifier result in maximal projections ;; mod = modifier (pre-head) ;; head = head ;; post-mod = modifier (post-head) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Object Refering Expression (obj-refer-expr) Components ;; AKA NP (but head may not be a noun) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; spec = specifier ;; obj-spec = object specifier ;; See obj-spec components below ;; mod = modifier (e.g. attributive adjective, verb participle, noun) ;; head = head ;; obj-head= object head ;; rel-head = relational head ;; post-mod = adverb or pp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Object Specifier (obj-spec) Components ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; spec = (see head) ;; head = specifier ;; quant = quantifier ;; (e.g. "all" in "all men") ;; det = determiner ;; (e.g. "the" in "the man") ;; mod = modifier ;; quant = quantifier ;; (e.g. "all" in "all the men") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Modifier (mod) Components ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mod = relational modifier (e.g. adverb) ;; head = modifier (e.g. attributive adjective, verb participle, noun) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Predicate Referring Expression (pred) Components ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; spec = specifier ;; pred-spec = predicate specifier ;; (e.g auxiliary, modal aux, negative) ;; see Pred-Spec components ;; mod = modifier (pre-head) ;; pred-mod = predicate modifier ;; (e.g. adverb) ;; head = rel-head = predicate ;; pred = predicate (pred-verb | pred-adj | prep-prep | pred-aux-verb) ;; pred-verb = predicate verb ;; pred-adj = predicate adjective ;; pred-prep = predicate preposition ;; pred-aux-verb = predicate auxiliary verb ;; pred-nominal = predicate nominal (aux verb is "be") ;; post-mod = modifier (post head) ;; (e.g. verb particleadverb or pp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Predicate Specifier (pred-spec) Components ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; the predicate specifier includes all modal, auxiliary verbs and negatives ;; and any adverb that is embedded within the frame of the specifier ;; the head of the predicate specifier is the first auxiliary or modal auxiliary ;; ;; head = (see first auxiliary or modal auxiliary) ;; mod = relation modifier (e.g adverb embeded within pred-spec ;; "hardly" in "could hardly have been") ;; modal-aux = modal auxiliary (e.g. "could" in "he could be late") ;; aux-1 = first (non-modal) auxiliary (e.g. "is" in "he is late") ;; neg = negative (e.g. "never" in "he is never late") ;; not-negative (e.g. "not" in "he is not late") ;; aux-2 = second (non-modal) auxiliary (e.g. "been" in "he could have been late") ;; aux-3 = third (non-modal) auxiliar (e.g. "being" in "he could not have been being lazy") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Situation Refering Expression (sit-refer-expr) Components ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; subj = subject (obj-refer-expr, sitcomp) ;; mod = relation modifier (e.g. adverb) ;; pred = predicate (pred-refer-expr) ;; obj = object (obj-refer-expr) ;; iobj = indirect object (obj-refer-expr) ;; sitcomp = situation complement (sitcomp) ;; post-mod = relation modifier (e.g. adverb) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Learning from Instruction: ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; The following texts from John Anderson's "Compilation and Instruction" ;; presentation at the ACT-R Post Graduate Summer School 2001 ;; can be processed (at least in part): ;; ;; to do the experiment you are to read the stimulus. ;; associate the stimulus with the response. ;; act on the response and repeat. ;; to associate a response with a stimulus wait and read the response. ;; ;; (do-text "to do the experiment you are to read the stimulus. associate the stimulus with the response. act on the response and repeat. to associate a response with a stimulus wait and read the response.") ;; ;; Note that the representations that get generated can be improved ;; by adding more specialized rules ;; for example a rule to handle "associate X with Y" ;; could take precedence over the generic rule "sit prep obj" ;; which is currently being used ;;