ÿþ<HTML> <HEAD> <META NAME="keywords" CONTENT="expert system,free expert system,expert system shell,expert system building tool,free expert system software, rule-based expert system,inference engine,knowledge bases,free Java applet, expert system tutorials,expert system training,e2gLite expert system shell"> <META NAME="description" CONTENT="A mini-course introducing the free e2gLite expert system building tool (expert system shell) implemented as a Java applet. e2gLite permits rule-based expert systems to be embedded in a Web page."> <TITLE>e2gLite Free Expert System Shell - Knowledge Engineering Case Study</TITLE> </HEAD> <BODY BGCOLOR="#ffffff"> <TABLE CELLSPACING=0 BORDER=0 BGCOLOR="#ffee33" WIDTH="100%"> <TR><TD><IMG SRC="/webesie/images/e2gwide2.gif"></TD> <TD>&nbsp;&nbsp;</TD> <TD VALIGN=Center ALIGN=Left><script type="text/javascript"><!-- google_ad_client = "pub-0414996037110743"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel = ""; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></TD> <TD align="right"> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=1 BGCOLOR='#2970bb'><TR><TD> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR='White'><TR><TD align="center"> <font face="arial,helvetica" size="2" color="#2970bb">For new e2gRuleEngine/<br>e2gRuleWriter Web content<br><a href="/" target="_parent">CLICK HERE</a></font> </TD></TR></TABLE> </TD></TR></TABLE> </TD> <TD>&nbsp;</TD> </TR></TABLE> <FONT FACE="Arial,Helvetica" SIZE=2>[<A HREF="/webesie/">Home: Demos and Tutorials</A>][<A HREF="e2gintro.htm">e2gLite Mini-Course Index</A>] </FONT> <P><!--Designing and implementing...--> <CENTER><FONT FACE="Arial,Helvetica" SIZE=3><B>Building and Using Expert Systems: a Mini-Course Introducing the e2gLite Expert System Shell</B></FONT></CENTER> <P><FONT FACE="Arial,Helvetica" SIZE=3><B>Module 7: Designing and implementing e2gLite knowledge bases that deliver <I>your</I> knowledge</B> </FONT> <FONT FACE="Arial,Helvetica" SIZE=3> <P><B>Module 7 Index</B> <UL> <LI><A HREF="#GRADADMIT">Graduate school admission decision case study</A> <LI><A HREF="#TRANSLATE">Delivering a knowledge base in languages other than English</A> <LI><A HREF="#DEBUG">Recommendations for implementing and debugging a knowledge base</A> </UL> <P> </FONT> <FONT FACE="Arial,Helvetica" SIZE=2> <A NAME="GRADADMIT"></A> <P>In this final module, we'll use a hypothetical graduate school admission process as a case study to illustrate some ideas about knowledge base design, construction and debugging. A listing of the complete <A HREF="#ADMITKB">e2gLite graduate admissions knowledge base</A> is included in the module for reference. <P>If you haven't already done so, taking a look at <A HREF="/webesie/tutorials/knoweng/">Module 6: Introduction to Knowledge Engineering</A> is recommended because it provides supporting material for this discussion. We'll also assume that you have worked the examples in <A HREF="e2gmod4.htm">Module 4: Creating your first knowledge base</A> so that you know how to enter a knowledge base and create a Web page that loads the e2gLite applet to access your rules. <P><B>Admissions recommendation logic:</B> The logic for the example expert system is represented by the following flow chart: <P><TABLE BORDER=1 ALIGN=Center> <TR><TH><FONT FACE="Arial,Helvetica" SIZE=3>Graduate Admissions Recommendation Logic</TH></TR> <TR><TD> <IMG SRC="/webesie/images/admitf.gif"> </TD></TR></TABLE> <P><B>Framework:</B> An expert system is developed in a conceptual framework that represents the problem domain. This structure supports the knowledge decomposition that leads to the definition of attributes and creation of rules as described in <A HREF="/webesie/tutorials/knoweng/">Module 6</A>. Procedural examples like this admissions process are often documented in a flowchart or decision tree format when knowledge engineering begins. It is tempting to develop a rule to represent each path through the flow chart, but additional analysis that identifies and names subconcepts could produce a knowledge base that more clearly supports two of the justifications for using an expert system: the ability to explain why a recommendation was made and the ability to make a recommendation using a minimum amount of factual input. <P><B>Expert system outputs:</B> A list of the possible admissions recommendations can be extracted from the flow chart: <OL> <LI>Admit with full status <LI>Admit with full status (special decision) <LI>Admit provisionally <LI>Admit provisionally with recommended remedial English coursework <LI>Refer to academic department for decision <LI>Admit conditionally (special decision) <LI>Wait for transcript before making decision <LI>Deny normal admission (could be reviewed) </OL> <P>Recommendations 1-5 are possible for students who have provided a final undergraduate transcript. Recommendations 6-7 are possible for students who have not provided a final undergraduate transcript. Recommendation 8 is possible whether or not the undergraduate degree has been completed. <P><B>Expert system inputs:</B> Here is a grouped list of the attributes, identified from the flow chart, for which input PROMPTs will be written: <UL> <LI>Completion of undergraduate program <UL> <LI>Final undergraduate transcript availability </UL> <LI>English language requirement <UL> <LI>Bachelor's degree from US institution <LI>Test of English as a Foreign Language (TOEFL) </UL> <LI>Performance as an undergraduate <UL> <LI>Grade Point Ratio (GPR) last 60 Undergraduate (UG) hours <LI>Honor student <LI>Honor graduate <LI>Valedictorian <LI>Salutatorian </UL> <LI>Performance in prior graduate work (if any taken) <UL> <LI>Grade Point Ratio (GPR) for completed graduate work </UL> <LI>Performance on graduate admissions tests <UL> <LI>Graduate Record Exam (GRE) overall score <LI>Graduate Record Exam (GRE) verbal score </UL> </UL> <P><B>Certainty factors:</B> Because these inputs are factual rather than opinions, certainty factor input will not be requested for any of the PROMPTs in this knowledge base: the optional <B>CF</B> parameter is not used in the PROMPTs. <P><B>Multi-valued attributes:</B> There are four parameters representing special honors, and an applicant could possess any combination of these. The parameters are used in several rules, and the fact that an applicant possesses <I>none</I> of the attributes is also used in several rules. This set of circumstances is efficiently represented in an e2gLite knowledge base through the combined use of the AllChoice PROMPT along with the MAXVALS and DEFAULT statements: <FONT SIZE=+0><PRE> PROMPT [the applicant] AllChoice "This applicant is (check all that apply):" "an honor student" "an honor graduate" "a class valedictorian" "a class salutatorian" MAXVALS [the applicant] 4 DEFAULT [the applicant] = "not the recipient of special honors" </PRE></FONT> <P>The AllChoice PROMPT allows the knowledge base user to check any or all of the parameters describing the applicant's special honors. A MAXVALS statement allowing four values of <B>the applicant</B> must be included or values beyond the first one entered will be discarded. <P>It is often useful for a rule to detect the fact that no value can be found for an attribute. This is accomplished in e2gLite by employing the DEFAULT statement. The PROMPT for <B>the applicant</B> is the only source of values for this attribute. If none of the values are checked when the PROMPT is issued, the inference engine determines that the value cannot be resolved and the DEFAULT value "not the recipient of special honors" is assigned. Here is an example rule that will only fire for an applicant who has received <I>no</I> special honors: <FONT SIZE=+0><PRE> RULE [Conditional eval, low GRE] If [the evaluation] = "for a conditional decision" and [the applicant] = "not the recipient of special honors" and [the applicant's GRE score] < 1100 Then [the recommendation] = "wait for transcript" and [the action] = "based on established policy" </PRE></FONT> <P><B>Interim constructs:</B> Knowledge bases are sometimes simplified and recommendation justifications clarified by using interim constructs to capture a common theme. The next pair of rules captures the logic in the flow chart that determines the need to examine the applicant's undergraduate GPR: <FONT SIZE=+0><PRE> RULE [Consider undergraduate GPR (no grad credits)] If [the applicant's graduate status] = "no prior graduate work completed" Then [the undergraduate GPR should be considered] = true RULE [Consider undergraduate GPR (grad credits)] If [the applicant's graduate status] = "prior graduate work completed" and [the applicant's GPR on prior graduate work] > 2.99 Then [the undergraduate GPR should be considered] = true </PRE></FONT> The contrived attribute <B>the undergraduate GPR should be considered</B> may then be used in rules like the following: <FONT SIZE=+0><PRE> RULE [Deny because of undergraduate GPR] If [the undergraduate GPR should be considered] = true and [the applicant's GPR on last 60 undergraduate hours] < 2.5 Then [the recommendation] = "deny normal admission" and [the action] = "based on established policy" </PRE></FONT> Without this device, the following rules would be required to capture the same logic (and there are several similar rules that must determine whether to evaluate the undergraduate GPR): <FONT SIZE=+0><PRE> RULE [Deny because of undergraduate GPR (no grad credits)] If [the applicant's graduate status] = "no prior graduate work completed" and [the applicant's GPR on last 60 undergraduate hours] < 2.5 Then [the recommendation] = "deny normal admission" and [the action] = "based on established policy" RULE [Deny because of undergraduate GPR (grad credits)] If [the applicant's graduate status] = "prior graduate work completed" and [the applicant's GPR on prior graduate work] > 2.99 and [the applicant's GPR on last 60 undergraduate hours] < 2.5 Then [the recommendation] = "deny normal admission" and [the action] = "based on established policy" </PRE></FONT> <P><B>The knowledge base:</B> the complete knowledge base is provided in the following table as a reference. <A NAME="#ADMITKB"></A> <P><TABLE BORDER=1 ALIGN=Center> <TR><TH><FONT FACE="Arial,Helvetica" SIZE=3>Graduate Admissions Knowledge Base</FONT></TH></TR> <TR><TD> <PRE> REM Graduate admissions demonstration expert system REM Decide how to proceed RULE [Language requirement] If [the applicant's UG status] = "receiving a bachelor's degree from a US institution" or [the applicant's TOEFL score] > 499 Then [the language requirement] = "met" RULE [Conditional consideration] If [the language requirement] = "met" and [the applicant's final undergraduate transcript] = "not available" Then [the evaluation] = "for a conditional decision" RULE [Full consideration] If [the language requirement] = "met" and [the applicant's final undergraduate transcript] = "available" Then [the evaluation] = "for a full decision" REM Conditional evaluation RULE [Wait for transcript] If [the evaluation] = "for a conditional decision" and [the applicant's GPR on last 60 undergraduate hours] < 3.3 Then [the recommendation] = "wait for transcript" and [the action] = "based on established policy" RULE [Honor student] If [the evaluation] = "for a conditional decision" and [the applicant's GPR on last 60 undergraduate hours] > 3.29 and [the applicant] = "an honor student" Then [the recommendation] = "admit conditionally" and [the action] = "based on special decision" RULE [Conditional eval, high GRE] If [the evaluation] = "for a conditional decision" and [the applicant] = "not the recipient of special honors" and [the applicant's GRE score] > 1099 Then [the recommendation] = "admit conditionally" and [the action] = "based on special decision" RULE [Conditional eval, low GRE] If [the evaluation] = "for a conditional decision" and [the applicant] = "not the recipient of special honors" and [the applicant's GRE score] < 1100 Then [the recommendation] = "wait for transcript" and [the action] = "based on established policy" REM Full evaluation REM Deny RULE [Deny because language requirement not met] If [the applicant's UG status] = "not receiving a bachelor's degree from a US institution" and [the applicant's TOEFL score] < 500 Then [the recommendation] = "deny normal admission" and [the action] = "based on established policy" RULE [Deny because of graduate GPR] If [the applicant's graduate status] = "prior graduate work completed" and [the applicant's GPR on prior graduate work] < 3.0 Then [the recommendation] = "deny normal admission" and [the action] = "based on established policy" RULE [Consider undergraduate GPR (no grad credits)] If [the applicant's graduate status] = "no prior graduate work completed" Then [the undergraduate GPR should be considered] = true RULE [Consider undergraduate GPR (grad credits)] If [the applicant's graduate status] = "prior graduate work completed" and [the applicant's GPR on prior graduate work] > 2.99 Then [the undergraduate GPR should be considered] = true RULE [Deny because of undergraduate GPR] If [the undergraduate GPR should be considered] = true and [the applicant's GPR on last 60 undergraduate hours] < 2.5 Then [the recommendation] = "deny normal admission" and [the action] = "based on established policy" RULE [Deny because of undergraduate GPR and GRE] If [the undergraduate GPR should be considered] = true and [the applicant's GPR on last 60 undergraduate hours] > 2.49 and [the applicant's GRE score] < 900 Then [the recommendation] = "deny normal admission" and [the action] = "based on established policy" RULE [Deny because of GRE] If [the undergraduate GPR should be considered] = true and [the applicant's GPR on last 60 undergraduate hours] > 2.49 and [the applicant] = "not the recipient of special honors" and [the applicant's GRE score] < 900 Then [the recommendation] = "deny normal admission" and [the action] = "based on established policy" REM Provisional acceptance RULE [Provisional acceptance: low GRE, verbal GRE] If [the undergraduate GPR should be considered] = true and [the applicant's GPR on last 60 undergraduate hours] > 2.49 and [the applicant] = "not the recipient of special honors" and [the applicant's GRE score] > 899 and [the applicant's GRE score] < 1100 and [the applicant's GRE verbal score] < 400 Then [the recommendation] = "admit provisionally - recommend English remediation" and [the action] = "based on established policy" RULE [Provisional acceptance: low GPR, verbal GRE] If [the undergraduate GPR should be considered] = true and [the applicant's GPR on last 60 undergraduate hours] > 2.49 and [the applicant's GPR on last 60 undergraduate hours] < 3.0 and [the applicant's GRE score] > 899 and [the applicant's GRE verbal score] < 400 Then [the recommendation] = "admit provisionally - recommend English remediation" and [the action] = "based on established policy" RULE [Provisional acceptance: low GRE] If [the undergraduate GPR should be considered] = true and [the applicant's GPR on last 60 undergraduate hours] > 2.99 and [the applicant] = "not the recipient of special honors" and [the applicant's GRE score] > 899 and [the applicant's GRE score] < 1100 and [the applicant's GRE verbal score] > 399 Then [the recommendation] = "admit provisionally" and [the action] = "based on established policy" RULE [Provisional acceptance: low GPR] If [the undergraduate GPR should be considered] = true and [the applicant's GPR on last 60 undergraduate hours] > 2.49 and [the applicant's GPR on last 60 undergraduate hours] < 3.0 and [the applicant's GRE score] > 899 Then [the recommendation] = "admit provisionally" and [the action] = "based on established policy" REM Accept RULE [Acceptance: honors] If [the undergraduate GPR should be considered] = true and [the applicant's GPR on last 60 undergraduate hours] > 2.99 and [the applicant] : "an honor graduate" "a class valedictorian" "a class salutatorian" Then [the recommendation] = "admit with full status" and [the action] = "based on special decision" RULE [Acceptance at departmental discretion] If [the undergraduate GPR should be considered] = true and [the applicant's GPR on last 60 undergraduate hours] > 2.99 and [the applicant] = "not the recipient of special honors" and [the applicant's GRE score] > 1099 and [the applicant's GRE verbal score] < 400 Then [the recommendation] = "admission decision is at department's discretion" and [the action] = "based on established policy" RULE [Acceptance] If [the undergraduate GPR should be considered] = true and [the applicant's GPR on last 60 undergraduate hours] > 2.99 and [the applicant] = "not the recipient of special honors" and [the applicant's GRE score] > 1099 and [the applicant's GRE verbal score] > 399 Then [the recommendation] = "admit with full status" and [the action] = "based on established policy" REM Prompts PROMPT [the applicant's UG status] MultChoice "This applicant is:" "receiving a bachelor's degree from a US institution" "not receiving a bachelor's degree from a US institution" PROMPT [the applicant's TOEFL score] Numeric "What is the applicant's TOEFL (Test of English as a Foreign Language) score?" "0" "800" PROMPT [the applicant's GPR on prior graduate work] Numeric "What is the applicant's GPR (Grade point ratio) for prior graduate work?" "0" "4.0" PROMPT [the applicant's final undergraduate transcript] MultChoice "The applicant's final undergraduate transcript is:" "available" "not available" PROMPT [the applicant's GPR on last 60 undergraduate hours] Numeric "What is the applicant's GPR (Grade point ratio) for the last 60 UG hours?" "0" "4.0" PROMPT [the applicant's graduate status] MultChoice "This applicant's graduate status is:" "prior graduate work completed" "no prior graduate work completed" PROMPT [the applicant's GPR on prior graduate work] Numeric "What is the applicant's GPR (Grade point ratio) on prior graduate work?" "0" "4.0" PROMPT [the applicant] AllChoice "This applicant is (check all that apply):" "an honor student" "an honor graduate" "a class valedictorian" "a class salutatorian" PROMPT [the applicant's GRE score] Numeric "What is the applicant's total GRE (Graduate Record Exam) score?" "0" "1600" PROMPT [the applicant's GRE verbal score] Numeric "What is the applicant's GRE verbal score?" GOAL [the recommendation] GOAL [the action] MAXVALS [the applicant] 4 DEFAULT [the applicant] = "not the recipient of special honors"</PRE> </TD></TR></TABLE> <P><BR><A NAME="TRANSLATE"></A> <FONT FACE="Arial,Helvetica" SIZE=3> <B>Delivering a knowledge base in languages other than English (requires e2gLite v2.0 or later: <A HREF="/webesie/e2gDoc/e2gSwing/e2gSwingRef.htm">e2gSwing</A> is recommended)</B> </FONT> <P>A typical approach to delivering applications in multiple languages is to first produce a version in a base language, then localize this version of the application for each target language. Once a base language (English is currently the only base language for e2gLite) version of a knowledge base has been developed and debugged, the following steps may be used to deliver it in another language: <UL> <LI>Translate the Knowledge base (a text editor with a search and replace capability is almost a necessity for this process): <OL> <LI>Make a copy of the English language knowledge base (*.kb file) giving it a new name for the target language. <LI>Create the TRANSLATE commands that convert text messages generated internally by e2gLite into the target language. The complete set of TRANSLATE commands for a specific target language will be included in every knowledge base you translate to this language, so you will only have to build the TRANSLATE commands once for a given language no matter how many knowledge bases you wish to translate. The easiest way to accomplish this process is to cut and paste the complete list of TRANSLATE statements from the table titled <A HREF="e2gref.htm#TRANSLATE">Text Customizeable with TRANSLATE Commands</A> in the Reference document into a text editor, then translate each of the English words or phrases that is shown in the list into the target language. <LI>Starting at the beginning of the knowledge base, translate each rule and attribute name (values enclosed by the delimiters [...]), then search and replace each usage of the attribute name in the knowledge base with the translated value. It is best to use the entire string (including the delimiters) in the search and replace operation to avoid accidentally including extra characters. <LI>Starting at the beginning of the knowledge base, translate each text string (values enclosed by the delimiters "..." or '...'), then search and replace each usage of the text string in the knowledge base with the translated value. <LI>IMPORTANT! Translate only attribute names and values enclosed by delimiters, not any part of e2gLite commands. As an example, the rule fragment: <P><B>[the headlights dim when trying the starter] = true and</B> <P>Translates to: <P><B>[les phares obscurcissent en essayant le démarreur] = true and</B> <P>because <B>true</B> and <B>and</B> are elements of the e2gLite <B>RULE</B> command. When a rule is displayed by e2gLite, English text is translated <I>for output only</I> by the appropriate TRANSLATE commands. <LI>Test the translated knowledge base carefully to see if you need to increase the displayed width of the applet (defined by the <B>width=</B> value in the Applet tag). When English words and phrases are translated into another language the length in characters typically increases, and e2gLite truncates long text strings when they are displayed. Truncated text is easily identified because e2gLite terminates truncated strings with ellipses (...). <LI>Evaluate your knowledge base logic to see if it makes sense in the target language. For example, in the auto diagnosis knowledge base there is a PROMPT that asks the user how much he is willing to spend on repairs. The numeric answer is assumed the represent dollars. If the numeric value interpreted as French francs, Italian lira or whatever currency is relevant to your target language does not make sense, alteration of the PROMPT and/or the RULE that evaluates the input would be required. <LI>There is no provision in e2gLite to translate error messages or debug mode output. It is assumed that you will debug the knowledge base before it is translated. </OL> <BR><LI>Create a new HTML file to start the knowledge base for each language by copying the English version. The following Applet parameters will be modified or added: <OL> <LI>KBURL with the name of the translated knowledge base (*.kb) file. <LI>APPTITLE with the title of the application in the target language. <LI>APPSUBTITLE with the subtitle for the application in the target language. <LI>STARTBUTTON text to replace the English default "Start the consultation". <LI>LOADMSG text to replace the English default "Loading knowledge base...". </OL> <BR><LI>Consider implementing the application with e2gSwing rather than e2gLite. See the <A HREF="/webesie/e2gDoc/e2gSwing/e2gSwingRef.htm">e2gSwing Reference</A> for more information on this software that represents a re-architecting of e2gLite with a user interface better suited to displaying non-English output. </UL> <P>Here's an example of the auto diagnosis knowledge base translated into French. This is the autofr.kb file referenced in the KBURL applet parameter in the HTML that loads the knowledge base. This is a machine translation and is therefore less polished than would be expected from an expert human translator. The English version of this knowledge base is available as the <A HREF="e2gref.htm#KBASEEX">Example e2gLite Knowledge Base</A> in the reference documentation. <P><TABLE BORDER=1> <TR><TD> <PRE> REM Test knowledge base RULE [La batterie est-elle morte?] If [le résultat d'alimenter les phares] = "rien ne se produit" or [le résultat d'essayer le démarreur] = "rien ne se produit" Then [recommandée l'action] = "rechargez ou substituez la batterie" RULE [La voiture est-elle hors d'essence?] If [le réservoir d'essence] = "vide" Then [recommandée l'action] = "réapprovisionnez en combustible la voiture" RULE [La batterie est-elle faible?] If [le résultat d'essayer le démarreur] : "les manivelles de voiture lentement" "les manivelles de voiture normalement" and [les phares obscurcissent en essayant le démarreur] = true and [la quantité vous êtes disposé à dépenser sur des réparations] > 24.99 Then [recommandée l'action] = "rechargez ou substituez la batterie" RULE [La voiture est-elle inondée?] If [le résultat d'essayer le démarreur] = "les manivelles de voiture normalement" and [une odeur d'essence] = "présentez en essayant le démarreur" Then [recommandée l'action] = "l'attente 10 minutes, relancent alors inondée la voiture" RULE [Le réservoir d'essence est-il vide?] If [le résultat d'essayer le démarreur] = "les manivelles de voiture normalement" and [une odeur d'essence] = "pas présentez en essayant le démarreur" Then [le réservoir d'essence] = "vide" @ 90 PROMPT [le résultat d'essayer le démarreur] Choice CF "Que se produit quand vous tournez la clé pour essayer de mettre en marche la voiture?" "les manivelles de voiture normalement" "les manivelles de voiture lentement" "rien ne se produit" PROMPT [une odeur d'essence] MultChoice CF "Une odeur d'essence et:" "présentez en essayant le démarreur" "pas présentez en essayant le démarreur" PROMPT [le résultat d'alimenter les phares] MultChoice CF "Le résultat d'alimenter les phares et:" "ils s'allument" "rien ne se produit" PROMPT [les phares obscurcissent en essayant le démarreur] YesNo CF "Les phares obscurcissent-ils quand vous essayez le démarreur avec les lumières?" PROMPT [le réservoir d'essence] MultChoice CF "Selon la mesure de carburant, le réservoir d'essence est:" "vide" "non vide" PROMPT [la quantité vous êtes disposé à dépenser sur des réparations] Numeric CF "Combien coûtez-vous disposé à dépenser sur des réparations? (0->500)" "0" "500.0" GOAL [recommandée l'action] MINCF 80 REM French translation REM Button text TRANSLATE B_SUBMIT = "Soumettez votre réponse" TRANSLATE B_EXPLAIN = "Expliquent" TRANSLATE B_WHYASK = "Pourquoi demandez?" TRANSLATE B_RESTART = "Relancement" TRANSLATE B_RETURN = "Retournent" REM Message text TRANSLATE TR_KB = "Base de connaissance:" TRANSLATE TR_NORESP = "Je ne connais pas/ne répondrait plutôt pas" TRANSLATE TR_HOWCONF = "Que confiant pensez-vous de votre réponse?" TRANSLATE TR_LOWCONF = "Très incertain (50%)" " TRANSLATE TR_HICONF = "Très certain (100%)" TRANSLATE TR_YES = "Oui" TRANSLATE TR_NO = "Non" TRANSLATE TR_FALSE = "faux" TRANSLATE TR_RESULTS = "FINALS RÉSULTATS:" TRANSLATE TR_MINCF = "Facteur minimum de confiance pour recevoir une valeur comme fait:" TRANSLATE TR_NOTDETERMINED = "n'a pas pu être déterminé" TRANSLATE TR_ISRESULT = "est:" TRANSLATE TR_WITH = "avec" TRANSLATE TR_CONF = "% de confiance" TRANSLATE TR_ALLGOALS = "toutes les conclusions" TRANSLATE TR_VALUE = "Valeur" TRANSLATE TR_OF = "de" TRANSLATE TR_THISRULE = "Règle au-dessous de réussi à CF=" TRANSLATE TR_RULEASGN = "et assigné la valeur" TRANSLATE TR_TOFIND = "Pour trouver" TRANSLATE TR_AVALUE = "une valeur pour" TRANSLATE TR_ISNEEDED = "est nécessaire pour essayer cette règle:" TRANSLATE TR_RULE = "RÈGLE:" TRANSLATE TR_IF = "SI:" TRANSLATE TR_THEN = "ALORS:" TRANSLATE TR_AND = "et" TRANSLATE TR_OR = "ou" TRANSLATE TR_IS = "est" TRANSLATE TR_EQUAL = "est" TRANSLATE TR_LESSTHAN = "est moins qu'" TRANSLATE TR_NOTEQUAL = "n'est past" TRANSLATE TR_GREATER = "est plus grand qu'" TRANSLATE TR_VALUEFOR = "Une valeur pour:" TRANSLATE TR_FOUND = "a été déterminé" TRANSLATE TR_NOTFOUND = "n'a pas été encore déterminé" TRANSLATE TR_WASINPUT = "a été entré avec" TRANSLATE TR_DETERMINED = "Déterminé" TRANSLATE TR_FROM = "de:" TRANSLATE TR_DEFAULTED = "a été placé par défaut avec" REM following added in v3.03 TRANSLATE TR_ONE = "une des valeurs du" TRANSLATE TR_HOWCF1 = "Calcul de confiance de multi-source pour" </PRE> </HTML> </TD></TR> </TABLE> <P>Here's an example of the HTML needed to access the French version (autofr.kb) of the auto diagnosis knowledge base: <P><TABLE BORDER=1> <TR><TD> <PRE> &lt;HTML> &lt;HEAD>&lt;TITLE>Système expert De Diagnostic D'Automobile&lt;/TITLE>&lt;/HEAD> &lt;BODY BGCOLOR="#ffee33"> &lt;APPLET CODE="e2glite.e2g.class" archive="e2glite.jar" width=525 height=300> &lt;PARAM NAME="KBURL" VALUE="autofr.kb"> &lt;PARAM NAME="APPTITLE" VALUE="Conseiller De Diagnostic D'Automobile"> &lt;PARAM NAME="APPSUBTITLE" VALUE="Une démonstration d'eXpertise2Go"> &lt;PARAM NAME="STARTBUTTON" VALUE="Commencez la consultation"> &lt;PARAM NAME="LOADMSG" VALUE="Chargeant la base de connaissance..."> &lt;PARAM NAME="DEBUG" VALUE="false"> Java-capable browser required &lt;/APPLET> &lt;/BODY> </PRE> </HTML> </TD></TR> </TABLE> <P><BR><A NAME="DEBUG"></A> <FONT FACE="Arial,Helvetica" SIZE=3><B>Recommendations for implementing and debugging a knowledge base</B></FONT> <P>When the "Start the consultation" button is clicked on the e2gLite applet's opening screen, the knowledge base is loaded and syntax checked. If an error is encountered, loading immediately stops and an error number is displayed. If the test is run in the "debug" mode (the <B>DEBUG</B> applet parameter has the value "true") the line containing the error is displayed in the "Knowledge Base Developer's Output" window. As a result, it is most efficient to adhere to the following advice when building a knowledge base: <UL> <LI>Enter a few RULEs and PROMPTs at a time so that the knowledge base is unlikely to contain multiple syntax errors. <LI>Run with the <B>DEBUG</B> parameter in the &lt;APPLET> tags set to "true" to simplify finding the knowledge base line containing an error. </UL> <P>Some additional debugging suggestions that you might find helpful: <UL> <LI>Most e2gLite syntax errors are caused by spelling or punctuation problems or by omitting or mismatching the delimiters [ ] " '. Attribute names and text strings that are intended to be identical may differ only in case: spacing and punctuation characters must match exactly. <LI>Attribute names must be defined in a RULE before they are used in other statements including PROMPT, GOAL, MAXVALS and DEFAULT. Always put these statements after all of the RULEs. You cannot enter a PROMPT for an attribute in your knowledge base in advance of entering at least one RULE that uses the attribute. <LI>You may want to print out the <A HREF="e2gref.htm">Reference</A> documentation or at least the <A HREF="e2gref.htm#ERRCODES">Error Codes</A> for convenient use while constructing your knowledge base. <LI>Experimenting with your knowledge base with a variety of inputs after adding a each few RULEs and PROMPTs is advisable to help identify errors in your logical analysis. If you don't get the results you expect, figure out why this is happening before adding more complexity. <LI>Make sure you use some test cases that exercise the boundaries of the rules. For example, in the graduate admissions knowledge base, running tests with GPRs of exactly 3.0, 2.99, 3.29, 3.3 helps identify minor errors made when writing inequality comparisons. </UL> <P>Finally, here is a summary of some commonly encountered knowledge base problems. <P> <TABLE BORDER=1> <TR><TH COLSPAN=3><FONT FACE="Arial,Helvetica" SIZE=2>Knowledge Base Debugging Suggestions</TH> <TR><TH><FONT FACE="Arial,Helvetica" SIZE=2>Symptom</TH> <TH><FONT FACE="Arial,Helvetica" SIZE=2>Probable Cause</TH> <TH><FONT FACE="Arial,Helvetica" SIZE=2>Finding the problem</TH></TR> <TR><TD><FONT FACE="Arial,Helvetica" SIZE=2>When the Web page containing &lt;APPLET...> tags loads, a grey panel persists where the e2gLite opening screen should appear after the applet is downloaded.</TD> <TD><FONT FACE="Arial,Helvetica" SIZE=2>The applet cannot be found, or crashes after loading.</TD> <TD><FONT FACE="Arial,Helvetica" SIZE=2>Look for an error message on browser's status line. Check the Java console for error messages. Make sure the e2glite.jar file is installed in the proper location on the Web server and that the CODE and ARCHIVE attributes in the &lt;APPLET> tag are specified correctly. Browsers running version 1.0.2 of the Java Virtual Machine (the Java console displays the version) cannot load applets from a .jar archive. To support these browsers with e2gLite, use WinEdit or a similar program to unpack the .jar in the same directory. This will create a subdirectory named e2glite and copy all of the class files to that subdirectory. You do not have to change any &lt;APPLET> parameters to allow for operation with these old browsers.</TD></TR> <TR><TD><FONT FACE="Arial,Helvetica" SIZE=2>Attribute values for which PROMPTs exist are never requested</TD> <TD><FONT FACE="Arial,Helvetica" SIZE=2>Different spellings, spacing or punctuation of an attribute name.</TD> <TD><FONT FACE="Arial,Helvetica" SIZE=2>Run in Debug mode (set the DEBUG &lt;APPLET> parameter to "TRUE"), click "Start the consultation" then click "Analyze KB" in the KNOWLEDGE BASE DEVELOPER'S window. Review the ATTRIBUTE USAGE section of the resulting KNOWLEDGE BASE ANALYSIS for attribute naming problems.</TD> <TR><TD><FONT FACE="Arial,Helvetica" SIZE=2>Rules don't fire that should fire as a result of user input.</TD> <TD><FONT FACE="Arial,Helvetica" SIZE=2>Different spellings, spacing or punctuation of an attribute value.</TD> <TD><FONT FACE="Arial,Helvetica" SIZE=2>Run in Debug mode (set the DEBUG &lt;APPLET> parameter to "TRUE"), click "Start the consultation" then click "Analyze KB" in the KNOWLEDGE BASE DEVELOPER'S window. Review the VALUE USAGE section of the resulting KNOWLEDGE BASE ANALYSIS for value definition problems.</TD> <TR><TD><FONT FACE="Arial,Helvetica" SIZE=2>In the final explanation of conclusions, some rules don't seem to have used all of the known facts in their explanation even though these attributes are in the premise.</TD> <TD><FONT FACE="Arial,Helvetica" SIZE=2>Could be normal when premise clauses connected by OR</TD> <TD><FONT FACE="Arial,Helvetica" SIZE=2>Once a rule has fired, it will not be examined again by the inference engine. When premise clauses are OR'd the first true premise clause fires the rule.</TD> <TR><TD><FONT FACE="Arial,Helvetica" SIZE=2></TD> <TD><FONT FACE="Arial,Helvetica" SIZE=2></TD> <TD><FONT FACE="Arial,Helvetica" SIZE=2></TD> </TABLE> </FONT> <P><CENTER><FONT FACE="Arial,Helvetica" SIZE=2>[<A HREF="e2gintro.htm">Index</A>][<A HREF="e2gmod1.htm">Module 1</A>][<A HREF="e2gmod2.htm">Module 2</A>][<A HREF="/webesie/tutorials/esintro">Module 3</A>][<A HREF="e2gmod4.htm">Module 4</A>][<A HREF="/webesie/tutorials/inference">Module 5</A>][<A HREF="/webesie/tutorials/knoweng/">Module 6</A>][<A HREF="e2gmod8.htm">Module 8</A>][<A HREF="e2gref.htm">Reference</A>][<A HREF="/webesie/e2gDoc/e2gSwing/e2gSwingRef.htm">e2gSwing Ref</A>]</FONT></CENTER> <P><HR><FONT FACE="Arial,Helvetica" SIZE=1>Copyright &copy; 2001 - 2009 by eXpertise<I>2Go</I>.com. All rights reserved. <BR><A HREF="mailto:webmaster@expertise2go.com">webmaster@expertise2go.com</A> </FONT> </BODY> </HTML>