Title: Artificial Intelligence Knowledge engineering
1Artificial IntelligenceKnowledge engineering
- Fall 2008
- professor Luigi Ceccaroni
2Knowledge engineering
- A knowledge engineer is someone who
- Investigates a particular domain
- Learns what concepts are important in that domain
- Creates a formal representation of the objects
and relations in the domain - Knowledge engineering is a process for developing
special-purpose knowledge bases - whose domain is carefully circumscribed and
- whose range of queries is known in advance.
3The software engineering process waterfall model
3
4The software engineering process spiral model
4
5The knowledge engineering process general
methodology
6Identify the task
- Feasibility of the construction of the KBS
- Search for the sources of knowledge (experts,
books, Internet) - Specification of necessary data to solve the
problem - Specification of the goals (solutions) or of the
criteria which define the solution
7Assemble the relevant knowledge
- Specification of the basic elements to
characterize the domain (relevant facts) and
their relations - Distinction between evidences, hypotheses and
actions to be carried out - Specification of the different hypotheses and
goals - Decomposition of the problem into sub-problems
- Characterization of the reasoning flow
8Vocabulary of predicates, functions and constants
- Translation of the important domain-level
concepts into logic-level names - Questions of knowledge engineering style
- Should pits be independent objects or a unary
predicate on square objects? - Should the agents orientation be a function or
a predicate? - Should the agents location depend on time?
- Once the choices have been made, the result is a
vocabulary that is known as the ontology of the
domain.
9Formalize and encode the knowledge about the
domain
- Determination of the necessary reasoning schemas
- classification
- diagnosis
- temporal planning
- causal structures
- Identification of the search space and the type
of search - Identification of the resolution methodology
- heuristic classification
- constructive problem-solving
- hierarchical hypothesize and test
10Formalize and encode the knowledge about the
domain
- Analysis of inaccuracy (uncertainty, imprecision)
and completeness - Implementation of the representation
- Facts base
- Modular structure of the knowledge base
- Inference rules of each module
- Decisions on the control of the resolution
- Meta-rules associated to the modules
- Other meta-rules
11Encode a description of the specific problem
instance
- Problem instances are supplied by the sensors or,
in general, they are generic input data with a
certain structure and semantics. - It involves writing simple atomic sentences about
instances of concepts that are already part of
the ontology.
12Pose queries to the inference procedure and get
answers
- Let the inference procedure operate on the rules,
axioms and problem-specific facts to derive the
facts we are interested in knowing.
13Debug the knowledge base
- Specification of a set of test cases
- Evaluation of the functioning of the system
(prototype) - accuracy
- completeness
- credibility (explanations)
14Types of KBSs (Clancey, 1985)
- Analysis tasks interpretation of a system
- control
- prediction (simulation)
- identification (monitoring, diagnosis)
- Synthesis tasks construction of a system
- design (planning, configuration)
- assemblage (modification)
- specification
14
15Analysis-oriented KBSs
- Diagnosis oriented
- Medical diagnosis, failures diagnosis
- Classification oriented
- User profiling, species identification
- Supervision oriented
- Real-time process supervision
- Prediction oriented
- Meteorology, stock-market prediction
16Synthesis-oriented KBSs
- Planning oriented
- Robot course planning
- Design oriented
- Architectural design
- Configuration oriented
- Computer networks configuration
17Practical problem-solving methods
- Heuristic classification
- Constructive problem-solving
- Helping expert-systems builders to make the right
design decisions with respect to the methods and
representations most suitable for their
application will do much to prevent the
frustration and disillusion that often accompany
bad decisions. (Peter Jackson, Introduction to
expert systems, 1990)
18Heuristic classification
- Heuristic classification has been identified as a
widespread problem solving method. - It is comprised of three main phases
- abstraction from a concrete, particular problem
description to a problem class - heuristic match of a general solution (method) to
the problem class - refinement of the general solution to a concrete
solution for the concrete problem - To be applied, a finite set of solutions needs to
be identified a priori.
19Heuristic classification
- HC can be applied in analysis tasks
- classification
- diagnosis
- identification
- monitoring
- ...
- It is used for complex problems.
- If the problem is simple, a direct association
between data and solutions is enough.
20Heuristic classification
heuristic association
refinement and adaptation
data abstraction
21Heuristic classification
- Data abstraction
- Data of the specific case are abstracted to
obtain a more general case - Types of abstraction/generalization
- Based on taxonomy
- From quantitative to qualitative measures
- Temperature de Q 38 ºC
- If Temperature gt 37.5 ºC then Temperature is high
22Heuristic classification
- Heuristic association (matching)
- Determining the relation between abstract cases
and abstract solutions - If Temperature is high then has-fever
- Refinement and adaptation of the solution
- Identifying specific solutions from abstract
solutions and complementary data - If has-fever and other data then
- Q has flu
23Heuristic classification example
MYCIN
24Heuristic classification example
- Concesión de créditos para fundar una nueva
empresa - Atributos (ejemplos)
- Apoyo financiero (tiene avales, es-rico...)
- Petición (106 ...)
- Bienes (cuentas-corrientes, casas, coches,
yates...) - Fiabilidad-de-la-devolución (morosidad,
cheques-sin-fondos...) - Compromiso (créditos-anteriores...)
- Soluciones
- Denegación
- Aceptación
- Aceptación con rebaja
- Aceptación con interés preferente
25Heuristic classification example
- Reglas de abstracción
- Bienes lt 10 petición ? Bienes insuficientes
- Bienes 10 petición ? Bienes lt 20 petición ?
Bienes suficientes - Bienes 20 petición ? Bienes excelentes
- Avales 10 petición ? Es-rico ?
Apoyo-financiero bueno - Avales lt 10 petición ? Avales petición ?
Apoyo-financiero - moderado
- Avales lt petición ? Apoyo-financiero bajo
- Cheques-sin-fondos ? Moroso ? Fiabilidad-de-la-dev
olución baja - Empresa es churrería ? Empresa es tienda de roba
? Viabilidad buena - Empresa es hamburguesería cerca de universidad ?
Viabilidad buena - Empresa es Corte-Inglés ? Empresa es proveedor
Internet vía cable ? - viabilidad muy buena
- Crédito lt petición ? Compromiso bajo
- Crédito petición ? Crédito lt 10 petición ?
Compromiso mediano - Crédito 10 petición ? Compromiso alto
26Heuristic classification example
- Reglas de asociación heurística
- Apoyo-financiero bajo ? Bienes insuficientes ?
Denegación - Fiabilidad-de-la-devolución baja ? Denegación
- . . .
- Apoyo-financiero moderado ? Bienes suficientes ?
- Viabilidad buena ? Aceptación con rebaja
- . . .
- Apoyo-financiero bueno ? Bienes suficientes ?
Compromiso mediano - ? Viabilidad buena ? Aceptación
- . . .
- Apoyo-financiero bueno ? Bienes excelentes ?
Compromiso alto ? - Viabilidad muy buena ? Aceptación con interés
preferente - . . .
27Heuristic classification example
- Regles de refinamiento/adaptación de las
soluciones - Aceptación con rebaja ? Petición lt 107 ? Bienes lt
5 Petición ? - Rebaja a 0.6 Petición
- . . .
- Aceptación con interés preferente ? Petición
107 ? Bienes 10 Petición ? Interés
preferente 1 inferior al del mercado
28Heuristic classification example
29Constructive problem-solving
- Solutions can be infinite and do not need to be
identified a priori. - Solutions are constructed and not selected among
various possibilities. - Constructive problem-solving is applicable in
synthesis tasks - planning
- design
- ...
30Constructive problem-solving
- Solutions are combinations of certain elements,
which satisfy some constraints - Planning
- Elements are actions.
- Solutions are sequences of actions accomplishing
a certain goal. - Design
- Elements are components.
- Solutions are combinations of components forming
a complex object.
31Constructive problem-solving
- The construction of the solution implies knowing
- a model of the structure of the complex object
- a model of the behavior of the complex object
- a set of constraints on the complex object
31
32Constructive problem-solving
- Constraints can be
- On the configuration of the components of the
solution - Physical/spatial constraints
- How to hold an object
- An object cannot be placed in a certain place
- Temporal constraints
- Which action is carried out first
- On the pre- and post-conditions of
operator/actions - On the interaction between the previous ones
32
33Constructive problem-solving example 1
- Planning of the (optimal) path of a robot exit a
room with obstacles - Operators/actions
- go forward (m) turn (degrees) go backward (m)
- Constraints
- The robot cannot touch any obstacle.
- At the and the robot has to be at the exit.
- Only the movements indicated by the operators are
allowed.
R
33
34Constructive problem-solving example 2
- Configure/place a set of furniture/objects in a
room - Operators/actions
- place-furniture (furniture, position)
remove-furniture (furniture) swap-furniture
(furniture-1, furniture-2) move-furniture
(furniture, position) - Constraints
- Doors and windows cannot be blocked
- All furniture has to be placed
- Only the operations indicated by the operators
are allowed.
Wii
34
Sofa
35Constructive problem-solving sub-methods
- Propose and apply
- The problem needs to be decomposed into tasks
(sub-problems) with clear spatial/temporal
relations among them. - Operations, with their constraints and effects,
need to be clearly defined. - Least commitment
- Partial solutions are needed to start, and are
then improved to get to the final solution.
35
36Propose and apply
- The method starts from an empty or incomplete
initial state. - Each step contributes to the completion of the
solution. - The best operator is chosen at each step.
37Propose and apply
- Exhaustive knowledge is needed about
- Operators, and their effect on the solution
- Constraints and relations among components of the
solution - Quality of the solution
- Resolution can be through
- Sequential construction (It needs a lot of
knowledge to be efficient.) - Hierarchical task-decomposition (It is more
efficient, but needs decomposition operators.)
38Propose and apply resolution process
- Goal initialization (task to be carried out)
necessary elements to identify the initial state
are created. - Operator proposal all operators that can actuate
on the current state are considered. - Operator elimination some operators are
eliminated according to global criteria (e.g.,
predefined preference order). - Operator evaluation the effects of the operators
on the solution are compared using expert
knowledge. - Operator selection the operator with the best
evaluation is selected. - Operator application the selected operator is
applied to the current state. - Goal evaluation if the goal is reached, the
process stops, otherwise it restarts from step 2.
38
39Least commitment
- The method starts from a complete state.
- At each step, the state is modified/improved/corr
ected. - The operator to be applied is defined by the
least commitment strategy - The modification that imposes less future
constraints.
39
40Least commitment resolution process
- Start with a complete, non optimal state, which
satisfies the constraints. - Modify the state applying the least commitment
heuristics Choose the operator that imposes
less constraints on future actions. - If the modification violates any constraints,
then undo some of the previous steps, trying to
minimize the undoing modifications. - If the goal is reached, the process stops,
otherwise it restarts from step 2.
40
41Least commitment example
- Queremos planificar la mejor trayectoria de un
robot en una habitación - La habitación tiene un conjunto de obstáculos que
queremos evitar - Disponemos de un conjunto de operadores
- Movernos hacia adelante o hacia atrás a cierta
velocidad y cierta distancia - Girar cierto número de grados
41
42Least commitment example
42
43Least commitment example
- Restricciones globales llegar a la puerta de
salida, trayectoria mínima en recorrido y tiempo - Restricciones de elección de operadores No
chocar con obstáculos o la pared, mantener la
distancia para poder maniobrar - Evaluación de los operadores
- Mover Mejor cuanto más lejos y más deprisa nos
lleve al objetivo - Girar Mejor cuanto más lejos deje los obstáculos
de nuestra trayectoria
43
44Hierarchical hypothesize and test
- La formación de hipótesis y pruebas organizadas
jerárquicamente (HPJ) combina aspectos de
clasificación heurística y de resolución
constructiva de problemas. - Es indicada en problemas donde
- El espacio de soluciones posibles es muy grande,
pero estas toman valores en un dominio finito. - El espacio de hipótesis (nodos de la resolución)
está organizado jerárquicamente - Los nodos altos corresponden a hipótesis más
generales, que se van refinando hasta llegar a
las hojas que corresponden a hipótesis más
concretas. - La estructuración jerárquica ayuda a plantear el
problema y facilita la solución. - Ejemplos
- CENTAUR (Aikins, 1983)
- INTERNIST (Pople, 1977)
- TEST (Kahn et al., 1987)
45Hierarchical hypothesize and test resolution
process
- 1. Leer los datos iniciales del problema y
formular hipótesis. - 2. Asignar a cada hipótesis una puntuación que
refleje la proporción de los datos explicados. - 3. Determinar el mejor nodo según la puntuación
n. - 4. Si nodo-(n)-es-solución entonces acabar
- si no dividir el espacio de
hipótesis en 2 conjuntos K i L - K lt-- sucesores de n
- L lt-- competidores en
espera de n - 5. Recoger más datos que discriminen entre las
hipótesis de K y puntuar-les. - 6. Sean k lt-- mejor (K) y l lt-- mejor (L)
- 7. Si puntuación (k) gt puntuación (l) entonces n
lt-- k si no n lt-- l - 8. Tornar a 4
46Hierarchical hypothesize and test example
- A hierarchical representation of lung diseases in
CENTAUR