Kuliah Sistem Pakar Pertemuan V “Representasi Pengetahuan”

  

Kuliah Sistem Pakar

Kuliah Sistem Pakar

  

Pertemuan V

Pertemuan V

  

“Representasi Pengetahuan”

“Representasi Pengetahuan”

Tujuan Pembelajaran Tujuan Pembelajaran

   Mengerti perang proses RPL terhadap Rekayasa Pengetahuan  Mengerti Representasi Pengetahuan, tipe-tupe  Mengetahui Tipe – Tipe Representasi Pengetahuan

 Mampu menjelaskan konsep Skema Representasi Pengetahuan

Proses Rekayasa Pengetahuan Proses Rekayasa Pengetahuan

  ( ( Knowledge Engineering Process)

  Knowledge Engineering Process) Validasi Pengetahuan Sumber Pengetahuan Representasi Pengetahuan Basis Pengetahuan Justifkasi Penjelasan Inferensi

  Akuisisi Pengetahuan Pengkodean

Knowledge Representation

  

Knowledge Representation

  

Knowledge Representation Knowledge Representation

  is concerned with is concerned with

storing large bodies of useful information in a

storing large bodies of useful information in a

symbolic format. symbolic format.

   Most commercial ES are

  Most commercial ES are rule-based systems rule-based systems where the information is stored as rules. where the information is stored as rules.

  

  Frames may also be used to complement rule-based systems. systems.

Frames may also be used to complement rule-based

  

Tipe-tipe Pengetahuan berdasar

Tipe-tipe Pengetahuan berdasar

Sumber Sumber

  

Deep Knowledge Deep Knowledge (formal knowledge) (formal knowledge)

   Shallow /Surface Knowledge Shallow /Surface Knowledge (non formal knowledge) (non formal knowledge)

  

Penjelasan ……… Penjelasan ………

  Deep knowledge

  Deep knowledge atau atau pengetahuan formal, pengetahuan formal, pengetahuan bersifat umum yang pengetahuan bersifat umum yang terdapat dalam sumber terdapat dalam sumber pengetahuan tertentu (buku, jurnal, buletin ilmiah dsb) pengetahuan tertentu (buku, jurnal, buletin ilmiah dsb) dan dapat diterapkan dalam tugas maupun kondisi dan dapat diterapkan dalam tugas maupun kondisi berbeda. berbeda.

  

  Shallow knowledge

  Shallow knowledge atau atau pengetahuan non formal, pengetahuan non formal, pengetahuan-pengetahuan praktis dalam bidang tertentu

pengetahuan-pengetahuan praktis dalam bidang tertentu

yang diperoleh seorang pakar pengalamannya pada yang diperoleh seorang pakar pengalamannya pada bidang dalam jangka waktu cukup lama. bidang dalam jangka waktu cukup lama.

  

  Pengetahuan Heuristik Pengetahuan Heuristik

  

  Pengetahuan Prosedural Pengetahuan Prosedural

  

  Pengetahuan Deklaratif Pengetahuan Deklaratif

  

Tipe-tipe Pengetahuan berdasar Cara

Tipe-tipe Pengetahuan berdasar Cara

  

Merepresentasikan

Merepresentasikan

Representasi Pengetahuan Representasi Pengetahuan

   Propotional Logic

  Propotional Logic (logika proposional)

  (logika proposional) Semantic Network

  Semantic Network (jaringan semantik)

  (jaringan semantik)

  Script, List, Table, dan Tree Script, List, Table, dan Tree Object, Attribute, dan Values Object, Attribute, dan Values

  Production Rule Production Rule

  (kaidah produksi) (kaidah produksi)

  Frame Frame

Representation in Logic and

  

Representation in Logic and

Other Schemas

  

Other Schemas

  

General form of any logical process General form of any logical process

  

Inputs (Premises) Inputs (Premises)

  

Premises used by the logical process to Premises used by the logical process to create the output, consisting of create the output, consisting of conclusions (inferences) conclusions (inferences)

   Facts known true can be used to derive Facts known true can be used to derive new facts that also must be true new facts that also must be true

  

Two Basic Forms of Computational Logic

  

Two Basic Forms of Computational Logic

  Propositional logic (or propositional calculus) Propositional logic (or propositional calculus) Predicate logic (or predicate calculus) Predicate logic (or predicate calculus)

  

Symbols represent propositions, premises or Symbols represent propositions, premises or conclusions conclusions

  Statement: A = The mail carrier comes Monday Statement: A = The mail carrier comes Monday through Friday. through Friday. Statement: B = Today is Sunday. Statement: B = Today is Sunday. Conclusion: C = The mail carrier will not come Conclusion: C = The mail carrier will not come today. today.

  

Propositional logic: limited in representing

  

Propositional logic: limited in representing

real-world knowledge real-world knowledge

Propositional Logic

  

Propositional Logic

  

  A proposition is a statement that is either A proposition is a statement that is either true true or or false false Once known, it becomes a premise that can be used Once known, it becomes a premise that can be used to derive new propositions or inferences to derive new propositions or inferences

  Rules are used to determine the truth (T) or falsity Rules are used to determine the truth (T) or falsity (F) of the new proposition (F) of the new proposition

Propotional Logic Propotional Logic

   Logic dapat digunakan untuk melakukan penalaran :

  Logic dapat digunakan untuk melakukan penalaran : Input

  Output Proses Premise Inferensi Logik atau atau Fakta-Fakta

  Konklusi Contoh :

  Contoh :

  Pernyataan A = Pak Pos datang hari Senin Pernyataan A = Pak Pos datang hari Senin sampai Sabtu sampai Sabtu Pernyataan B = Hari ini hari Minggu Pernyataan B = Hari ini hari Minggu Kesimpulan C = Pak Pos tidak akan datang hari ini Kesimpulan C = Pak Pos tidak akan datang hari ini

   Predicate logic breaks a statement down into

Predicate Calculus Predicate Calculus

  Predicate logic breaks a statement down into component parts, an object, object characteristic or component parts, an object, object characteristic or some object assertion

   some object assertion Predicate calculus uses variables and functions of

  Predicate calculus uses variables and functions of variables in a symbolic logic statement

   variables in a symbolic logic statement Predicate calculus is the basis for Prolog

  Predicate calculus is the basis for Prolog (PROgramming in LOGic)

  (PROgramming in LOGic) Prolog Statement Examples

  Prolog Statement Examples comes_on(mail_carrier, monday).

   comes_on(mail_carrier, monday). likes(jay, chocolate). likes(jay, chocolate).

  

  

Merupakan gambaran pengetahuan

berbentuk grafs dan menunjukkan

berbentuk grafs dan menunjukkan

hubungan antar berbagai obyek. hubungan antar berbagai obyek.

  

  Obyek, berupa benda atau atau peristiwa peristiwa

  

  

  

Jaringan Semantik

Jaringan Semantik

Merupakan gambaran pengetahuan

Obyek, berupa benda

Nodes Obyek Nodes Obyek

Arc (Link) Keterhubungan Arc (Link) Keterhubungan (Relationships) (Relationships) * * is a is a * has a

Contoh : Contoh : 1) 1) Joe Boy

  

Kay

Woman Food Human Being School Has a child

  Needs Goes to Is a Is a Is a Is a

  2) 2) adala ANAK LAKI- LAKI adalah MANUSIA SEKOLAH ke JOE pergi h h adala PEREM- adala PUAN perlu mempunya KAY MAKANAN h LAKI- LAKI i anak punya jabatan dengan kawin adalah MOBIL WAKIL bekerja ACME berwarna merk SAM bermain PRESDIR di perusahaan anak MERCEDES BENZ GOLF AJAX buatan adalah

  

Script, List, Table, dan Tree

Script, List, Table, dan Tree

Scripts Scripts

  SCRIPT SCRIPT ,

  , skema representasi pengetahuan yang skema representasi pengetahuan yang menggambarkan urutan dari kejadian. Elemen-elemen menggambarkan urutan dari kejadian. Elemen-elemen script terdiri dari :

   script terdiri dari :

  Elements include Elements include Entry Conditions Entry Conditions

  Props Props Roles Roles

  Tracks Tracks Scenes Scenes

   Contoh : Script “Ujian Akhir Semester”

  Contoh : Script “Ujian Akhir Semester”

List List

   LIST,

  LIST,

  daftar tertulis dari item-item yang saling daftar tertulis dari item-item yang saling berhubungan. berhubungan.

  Umumnya digunakan untuk merepresentasikan Umumnya digunakan untuk merepresentasikan hirarki pengetahuan dimana suatu obyek hirarki pengetahuan dimana suatu obyek dikelompokan, dikategorikan sesuai dengan dikelompokan, dikategorikan sesuai dengan

Rank or

   Rank or

Relationship

   Relationship berupa daftar orang yang anda kenal, berupa daftar orang yang anda kenal, Contoh : Contoh : benda-benda yang harus dibeli di pasar swalayan, benda-benda yang harus dibeli di pasar swalayan, hal-hal yang harus dilakukan minggu ini, atau hal-hal yang harus dilakukan minggu ini, atau produk-produk dalam suatu katalog.

   DECISION TABLE,

  DECISION TABLE,

  pengetahuan yang diatur dalam pengetahuan yang diatur dalam format lembar kerja atau format lembar kerja atau

  spreadsheet spreadsheet

  , menggunakan , menggunakan kolom dan baris. kolom dan baris. Attribute List Attribute List Conclusion List Conclusion List Different attribute configurations are matched against Different attribute configurations are matched against the conclusion the conclusion Contoh :… ? Contoh :… ?

  Decision Tabel Decision Tabel

Decision Trees Decision Trees

   tree yang berhubungan dengan decision tree yang berhubungan dengan decision

  DECISION TREE , DECISION TREE ,

table namun sering digunakan dalam analisis sistem komputer

table namun sering digunakan dalam analisis sistem komputer

(bukan sistem AI). (bukan sistem AI).

  Contoh :… ? Contoh :… ?

Related to tables

   Related to tables

Similar to decision trees in decision theory

   Similar to decision trees in decision theory

Can simplify the knowledge acquisition process

   Can simplify the knowledge acquisition process Knowledge diagramming is frequently more Knowledge diagramming is frequently more natural to experts than formal representation natural to experts than formal representation methods methods

Object, Attribute, Values Object, Attribute, Values

  OBJECT : OBJECT : OBJECT dapat berupa fisik atau konsepsi.

  OBJECT dapat berupa fisik atau konsepsi.

  ATTRIBUTE : ATTRIBUTE : ATTRIBUTE adalah karakteristik dari object.

  ATTRIBUTE adalah karakteristik dari object.

  VALUES :

  VALUES :

  VALUES adalah ukuran spesifik dari attribute dalam

  VALUES adalah ukuran spesifik dari attribute dalam situasi tertentu situasi tertentu

  Object Attribute Values Object Attribute Values

  Nilai Ujian masuk Nilai Ujian masuk

  Ukuran Ukuran

  Kamar tidur Kamar tidur

  15, 20, 25, 35, 15, 20, 25, 35, dsb. dsb.

  Level persediaan Level persediaan

  Pengendalian persedian persedian

  A, B, C atau D Pengendalian

  A, B, C atau D

  Universitas Universitas

  Rumah Rumah

  Diterima di Diterima di

  Coklat dsb.

  Hijau, Putih, Hijau, Putih, Coklat dsb.

  Warna Warna

  Rumah Rumah

  2,3,4, dsb.

  Kamar tidur Kamar tidur 2,3,4, dsb.

  3x4, 5x6, 4x5, 3x4, 5x6, 4x5,

Production Rules Production Rules PRODUCTION RULES: PRODUCTION RULES:

   Production system dikembangkan oleh

  Production system dikembangkan oleh Newell dan Simon sebagai model dari

  Newell dan Simon sebagai model dari kognisi manusia. Ide dasar dari sistem ini kognisi manusia. Ide dasar dari sistem ini adalah pengetahuan digambarkan sebagai adalah pengetahuan digambarkan sebagai production rules dalam bentuk production rules dalam bentuk pasangan pasangan kondisi-aksi kondisi-aksi .

  . Production Rules Production Rules

  Condition-Action Pairs Condition-Action Pairs

  IF this condition (or premise or antecedent)

  IF this condition (or premise or antecedent) occurs, occurs, THEN some action (or result, or conclusion, or THEN some action (or result, or conclusion, or consequence) will (or should) occur consequence) will (or should) occur

  IF the stop light is red AND you have stopped,

  IF the stop light is red AND you have stopped, THEN a right turn is OK THEN a right turn is OK

  

  Each production rule in a knowledge base represents Each production rule in a knowledge base represents an an

  autonomous chunk autonomous chunk

   of expertise of expertise When combined and fed to the inference engine, the When combined and fed to the inference engine, the set of rules behaves synergistically set of rules behaves synergistically

  Rules can be viewed as a simulation of the cognitive Rules can be viewed as a simulation of the cognitive behavior of human experts behavior of human experts Rules represent a Rules represent a

  model model

   of actual human behavior of actual human behavior Contoh : Production Rules

Contoh : Production Rules

   RULE 1 :

  RULE 1 : JIKA konfik internasional mulai

  JIKA konfik internasional mulai MAKA harga emas naik

  MAKA harga emas naik  

    

  RULE 2 : RULE 2 :

  JIKA laju infasi berkurang JIKA laju infasi berkurang

  MAKA harga emas turun MAKA harga emas turun

   RULE 3 RULE 3

  : :

  JIKA konfik internasional JIKA konfik internasional berlangsung lebih dari tujuh berlangsung lebih dari tujuh hari hari dan dan

  JIKA konfik terjadi di Timur JIKA konfik terjadi di Timur

  Tengah Tengah

  Production Rules Production Rules

  

Condition-Action Pairs Condition-Action Pairs

  

IF this condition (or premise or

  

THEN some action (or result, or

  

THEN some action (or result, or

conclusion, or consequence) will (or conclusion, or consequence) will (or should) occur should) occur

  

IF the stop light is red AND you have

  

stopped, THEN a right turn is OK

stopped, THEN a right turn is OK

  

Each production rule in a Each production rule in a knowledge base represents an knowledge base represents an

  autonomous chunk autonomous chunk of expertise of expertise

  

When combined and fed to the When combined and fed to the inference engine, the set of rules inference engine, the set of rules behaves synergistically behaves synergistically

  

Rules can be viewed as a Rules can be viewed as a simulation of the cognitive simulation of the cognitive behavior of human experts behavior of human experts

  

Rules represent a Rules represent a

  model model of actual of actual human behavior human behavior

Forms of Rules Forms of Rules

  

  IF premise, THEN conclusion

  IF premise, THEN conclusion

  IF your income is high,

  IF your income is high, THEN your chance of being audited by the THEN your chance of being audited by the

  IRS is high

  IRS is high

  

  Conclusion, IF premise Conclusion, IF premise Your chance of being audited is high, IF Your chance of being audited is high, IF your income is high your income is high

  

  Inclusion of ELSE Inclusion of ELSE

  IF your income is high, OR your deductions are

  IF your income is high, OR your deductions are unusual, THEN your chance of being audited by unusual, THEN your chance of being audited by the IRS is high, OR ELSE your chance of being the IRS is high, OR ELSE your chance of being audited is low audited is low More Complex Rules More Complex Rules

  IF credit rating is high AND salary is more than

  IF credit rating is high AND salary is more than $30,000, OR assets are more than $75,000, AND $30,000, OR assets are more than $75,000, AND pay history is not "poor," THEN approve a loan up pay history is not "poor," THEN approve a loan up to $10,000, and list the loan in category "B.” to $10,000, and list the loan in category "B.” Action part may have more information: THEN Action part may have more information: THEN "approve the loan" and "refer to an agent" "approve the loan" and "refer to an agent"

  

Frame

Frame

  FRAME FRAME adalah struktur data yang berisi semua adalah struktur data yang berisi semua pengetahuan tentang obyek tertentu. Pengetahuan pengetahuan tentang obyek tertentu. Pengetahuan ini diatur dalam suatu struktur hirarkis khusus yang ini diatur dalam suatu struktur hirarkis khusus yang memperbolehkan diagnosis terhadap independensi memperbolehkan diagnosis terhadap independensi pengetahuan. Frame pada dasarnya adalah aplikasi pengetahuan. Frame pada dasarnya adalah aplikasi dari pemrograman berorientasi objek untuk AI dan dari pemrograman berorientasi objek untuk AI dan ES.

  ES.

   Setiap frame mendefinisikan satu objek, dan terdiri

  Setiap frame mendefinisikan satu objek, dan terdiri dari dua elemen : dari dua elemen : slot slot

  (menggambarkan rincian dan (menggambarkan rincian dan karakteristik obyek) dan karakteristik obyek) dan facet. facet.

Frames Frames

  

  Frame

  Frame

  : Data structure that includes all the : Data structure that includes all the knowledge about a particular object knowledge about a particular object Knowledge organized in a hierarchy for diagnosis of Knowledge organized in a hierarchy for diagnosis of knowledge independence knowledge independence

  Form of Form of

  object-oriented programming object-oriented programming for AI and ES.

   for AI and ES. Each Frame Describes One Object Each Frame Describes One Object

  Special Terminology Special Terminology

Contoh Frame Automobile Frame Automobile Frame

  Class of : Transportation Class of : Transportation

  Name of Manufacturer : Audi Name of Manufacturer : Audi

  Origin of Manufacturer : Germany Origin of Manufacturer : Germany

  Model : 5000 turbo Model : 5000 turbo

  Type of Car : Sedan Type of Car : Sedan Weight : 3000 lbs.

  Weight : 3000 lbs.

  Wheelbase : 105.8 inches Wheelbase : 105.8 inches Number of doors : 4 (default) Number of doors : 4 (default)

  Transmission : 3-speed (automatic) Transmission : 3-speed (automatic)

  Number of wheels : 4 (default) Number of wheels : 4 (default)

  

Gas mileage : 22 mpg average (procedural attachment)

Gas mileage : 22 mpg average (procedural attachment)

  Engine Frame Engine Frame Cylinder bore : 3.19 inches

  Cylinder bore : 3.19 inches Cylinder stroke : 3.4 inches Cylinder stroke : 3.4 inches Compression ratio : 7.8 to 1

  Compression ratio : 7.8 to 1 Fuel system : Injection with turbocharger

  Fuel system : Injection with turbocharger

Vehicle Frame

Hirarki Frame (exp : Vehicle) Hirarki Frame (exp : Vehicle)

  Car Frame Boat Frame Train Frame Airplane Frame Submarine Frame Passenger Car Frame Truck Frame Bus Frame Compact Car Frame Midsize Car Frame Toyota Corolla Frame Mitsubishi Lancer Frame Advantages and Disadvantages of Different Knowledge Representations

  Scheme Advantages Disadvantages Production rules

  Simple syntax, easy to understand, simple interpreter, highly modular, flexible (easy to add to or modify) Hard to follow hierarchies, inefficient for large systems, not all knowledge can be expressed as rules, poor at representing structured descriptive knowledge Semantic networks Easy to follow hierarchy, easy to trace associations, flexible

  Meaning attached to nodes might be ambiguous, exception handling is difficult, difficult to program Frames Expressive power, easy to set up slots for new properties and relations, easy to create specialized procedures, easy to include default information and detect missing values Difficult to program, difficult for inference, lack of inexpensive software

  Formal logic Facts asserted independently of use, assurance that all and Separation of representation and

  

Sampai Jumpa

Sampai Jumpa

di

di

  

Pertemuan VI

Pertemuan VI

  

Selamat Belajar

Selamat Belajar