This page (revision-41) was last changed on 06-Oct-2015 01:51 by Albrecht Striffler

This page was created on 17-Dec-2012 11:12 by Joba Baumeister

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
41 06-Oct-2015 01:51 3 KB Albrecht Striffler to previous

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 1 added 3 lines
[{Image src='denkPrint2012.jpg' width='300' align='right' style='margin-right:30px; margin-top:30px' }]
At line 12 added one line
At line 15 added one line
At line 17 added one line
At line 20 added one line
At line 24 added one line
At line 27 added one line
At line 29 added one line
At line 33 added one line
At line 42 removed one line
At line 45 changed one line
In the first step we need to define the terminology of the planned system, i.e., the inputs (user entries) and the outputs (derived solutions).
In the first step we need to define the terminology of the planned system, i.e., the questions (inputs into the system) and the solutions (outputs of the system).
The definition of terms for questions and solutions is described in the article [Tutorial Printer Problem - Terminology].
At line 47 removed one line
!! Solutions
At line 49 changed 2 lines
We define the competence of the knowledge base by enumerating all possible solutions, i.e., faults, for the printer problem.
The derivable solutions are as follows:
!!! Derivation Knowledge using DiaFlux Models
At line 52 changed 8 lines
# Connection problems
## Broken cable
## Cable not connected
## No Wifi connection
## No power supply
# Printing quality problems
## Empty toner
## Dirty toner
After the definition of the terminology we need to define knowledge elements that implement the derivation and dialog behavior of the knowledge base.
For that, d3web/KnowWE provides a number of alternatives ranging from scoring rules, decision trees to set-covering models.
In this tutorial we show how to implement the derivation knowledge as a DiaFlux flowchart model:
[DiaFlux implementation|Tutorial Printer Problem - DiaFlux]
At line 61 removed 3 lines
We see, that we have structured the solutions into meaningful groups, i.e. ''connection problems'' and ''printing quality problems''.
More groups can be added easily.
The structuring of solutions is especially useful when the knowledge base and the number of solutions, respectively, increases.
At line 65 changed one line
The d3web markup of the solution hierarchy is as follows:
!!! Manually Testing the Knowledge Base
At line 67 changed 13 lines
{{{
%%Solution
Connection problems
- Broken cable
- Cable not connected
- No Wifi connection
- No power supply
Printing quality problems
- Empty toner
- Dirty toner
No solution found
%
}}}
Now we can test the knowledge base by running a dialog.
At line 81 removed 2 lines
Please note, that we added the solution ''No solution found'' for the case, that the system cannot derive an appropriate solution.
When inserting the markup into the wiki article, the following section is shown.
At line 84 changed 11 lines
%%Solution
Connection problems
- Broken cable
- Cable not connected
- No Wifi connection
- No power supply
Printing quality problems
- Empty toner
- Dirty toner
No solution found
%
!! Quick Interview
At line 96 changed one line
!! Questions
A simple test dialog interface can be created by inserting the markup
At line 98 removed 4 lines
To derive the solutions we need to pose appropriate questions to the user.
Since, we expect many questions to be included in the knowledge base, we group the questions into meaningful questionnaires.
First, we define an initial questionnaire that tries to identify the problem area of the user and use the following markup:
At line 103 changed 7 lines
%%Question
Problem specification #1
- Please specify your problem [oc]
-- Printer does not print
-- Printing with bad quality
-- No else
%
%%QuickInterview %
%%ShowSolutions %
At line 112 changed 2 lines
The annotation ''#1'' specifies, that the questionnaire ''Problem specification'' is posed as the initial questionnaire in a dialog session with the user.
When inserting the markup into the article, the questions are created.
into the same article, where {{KnowledgeBase}} is defined.
The markup will provide an interface for the user:
At line 115 changed 7 lines
%%Question
Problem specification #1
- Please specify your problem [oc]
-- Printer does not print
-- Printing with bad quality
-- No else
%
%%QuickInterview %
At line 123 changed 4 lines
The annotation ''~[oc]'' specifies a corresponding one-choice question.
The possible values/answers of this question are printed in separate lines below the question.
Each value/answer should be indented by an increased dash.
We see, that the three answers ''Printer does not print'', ''Printing with bad quality'', and ''No else'' has been defined for the one-choice question ''Please specify your problem''.
%%ShowSolutions %
At line 128 removed 2 lines
Each problem area corresponds to a group of solutions.
That way, we define a questionnaire for each problem area in order to differentiate the solutions within the problem area.
At line 131 changed one line
! Problem Area: Connection Problems
!! Interactive Single-Question Dialog (free-to-use)
At line 133 changed one line
The questions of the problem area ''connection problems'' are as follows:
Additionally, an interactive single-question dialog is available (provided by denkbares GmbH).
Here, only the currently active question is shown that should be answered by the user.
Derived solutions are printed at the end of the dialog session.
At line 135 changed 16 lines
%%Question
Connection Questions
- Please check the power supply of the printer [oc]
-- Printer is connected and power is on
-- Printer is not connected or power is off
- How is the printer connected to your computer [oc]
-- Connected by cable
-- Connected by Wifi
Printer with cable connection
- Is the cable plugged into the printer and the computer [yn]
-- Yes
-- No
- Please exchange the cable and try to print again [oc]
-- Stil not printing
-- Now it works
%
The dialog is started by using the tools menu of the {{KnowledgeBase}} markup as shown in the image below.
At line 152 changed 2 lines
We see, that a number of one-choice questions (~[oc]) are defined.
Additionally, a yes/no question is defined (~[yn]), which is similar to one-choice questions, but has the predefined answers ''yes'' and ''no''.
[{Image src='Printer Problem denkbares Dialog.png' width='800' align='left' caption='Starting the interactive dialog interface.' }]
At line 155 changed one line
! Problem Area: Quality Problems
\\
\\
An example dialog of the interactive interview is depicted in the following screenshot.
At line 157 changed one line
The questions of the problem area ''quality problems'' are as follows:
[{Image src='Printer Problem denkbares Dialog2.png' width='800' align='left' caption='An example run of the interactive denkbares dialog interface.' }]
At line 159 changed 10 lines
%%Question
Quality Questions
- Dirty housing [yn]
- Toner capacity [num] {pages} (0 10000000)
- Paper count [num] {pages} (0 10000000)
-- Current capacity ratio [num] <abstract>
-- Toner usage evaluation [oc] <abstract>
--- normal
--- low
%
\\
At line 170 removed 3 lines
In addition to yes/no questions and one-choice questions we defined some numerical questions (~[num]), that allow the input of numerical values. The annotation ''(0 10000000)'' defines the value range of the particular question, i.e., numbers from 0 to 10000000 can be entered, whereas ''{pages}'' defines the unit as an arbitrary string, i.e., the number of ''pages'' is queried to the user.
The annotation ''<abstract>'' specifies a abstraction question.
For such a question the values are not entered externally, e.g., by a user in a dialog, but the values are computed internally by the knowledge base.
At line 174 changed 3 lines
For the internal computation of the abstraction questions we define the following rules, by the {{Rule}} markup.
In the following, we define a rule computing the ratio between the expected toner life (''Toner capacity'') and the current use (''Paper count'').
Two further rules derive a ''normal'' or a ''low'' toner usage by using the derived value of the abstraction question ''Current capacity ratio'':
!!! Automated Testing
At line 178 changed 4 lines
{{{
%%Rule
IF Toner capacity = KNOWN AND Paper count > 0
THEN Current capacity ratio = (Toner capacity / Paper count)
The knowledge base can be tested continuously by defining test cases and continuous integration test.
See the article [Tutorial Printer Testcases] for more information.
At line 183 changed 2 lines
IF Current capacity ratio >= 1.1
THEN Toner usage evaluation = normal
%%Package Printer_Demo
At line 186 changed 2 lines
IF Current capacity ratio < 1.1
THEN Toner usage evaluation = low
%%tags
printerProblems tutorial
At line 189 removed 46 lines
}}}
When inserted into the wiki article, the rules markup looks as follows:
%%Rule
IF Toner capacity = KNOWN AND Paper count > 0
THEN Current capacity ratio = (Toner capacity / Paper count)
IF Current capacity ratio >= 1.1
THEN Toner usage evaluation = normal
IF Current capacity ratio < 1.1
THEN Toner usage evaluation = low
%
! Human-friendly Prompts of Questions/Solutions
It is reasonable to define short names for questions and solutions because they are often used in the markups.
When used in the dialog, however, longer verbalizations may be useful.
You can define a longer prompt for questions/solutions by using the {{Property}} markup.
Moreover, the prompts can be internationalized.
%%Property
Dirty housing.prompt = When opening the housing of the printer: Is there some dirt at the toner and the surrounding?
Toner capacity.prompt = Number of pages usually printed with one toner
Paper count.prompt = Number of pages printed with the current toner
Paper count.prompt.de = Anzahl der mit den aktuellen Toner gedruckten Seiten
%
!!! Derivation Knowledge
After the definition of the terminology we need to define knowledge elements that implement the derivation and dialog behavior of the knowledge base.
For that, d3web/KnowWE provides a number of alternatives ranging from scoring rules, decision trees to set-covering models.
In this tutorial we show how to implement the derivation knowledge as a DiaFlux flowchart model.
* [DiaFlux implementation|Tutorial Printer Problem - DiaFlux]
!!! Testing the Knowledge Base
In the next step, we test the knowledge base by using the
%%todo Test the printer tutorial @user: joba
%%Package Printer_Demo