Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 45 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
45
Dung lượng
437,21 KB
Nội dung
H chuyên gia (Expert System) PGS.TS Phan Huy Khánh khanhph@vnn.vn Ch nh ng Bi u di n tri th c logic v t b c m t 2.1 Ch ng Bi u di n tri th c nh logic v t b c m t \ Bi u di n tri th c HCG 2.1 \ Lôgic m nh đ 2.2 \ Lôgic v t b c m t 2.3 \ Bi u di n tri th c nh logic v t b c m t 2/45 Bi u di n tri th c m t HCG \ Tri th c c a m t HCG có th đ ph ng pháp khác c bi u di n theo nhi u \ Tu theo t ng HCG, ng i ta có th s d ng m t ho c đ ng th i c nhi u ph ng pháp \ Phân chia theo ngôn ng s d ng, ng i ta có cách : u S d ng ngôn ng t nhiên ngơn ng tốn h c u S d ng ngơn ng hình th c u S d ng ngơn ng máy tính 3/45 Nguyên lý làm vi c \ Nguyên lý làm vi c nh sau : Tri th c đ c thu nh n ngôn ng t nhiên L Tri th c đ c d ch ngơn ng P Tìm gi i pháp suy di n P L i gi i đ c d ch ngôn ng L å å å 4/45 Bi u di n tri th c \ M t s ph u u u u ng pháp dùng ngôn ng hình th c : Bi u di n tri th c nh lu t s n xu t Bi u di n tri th c nh lôgic Bi u di n tri th c nh m ng ng ngh a Ngồi ra, ng i ta cịn s d ng : ¬ Nh b ba : đ i t ng, thu c tính giá tr (O-A-V: Object-Attribute-Value) ¬ Nh khung (frame) ¬ Ngơn ng nhân t o, s ki n không ch c ch n, v.v 5/45 Bi u di n tri th c b i lu t s n xu t \ H u h t,các HCG hi n đ u h th ng d a lu t \ Lý nh sau : u u u B n ch t đ n th (modular nature) ¬ Có th đóng gói tri th c ¬ Có th m r ng HCG m t cách d dàng Kh n ng di n gi i d dàng (explanation facilities) ¬ V n d ng lu t có th đ c t xác y u t tri th c ¬ D dàng di n gi i v n đ nh ti n đ ¬ Rút đ T ng t q trình nh n th c c a ng ¬ D a cơng trình c a Newell Simon, lu t đ t cách ng i gi i quy t v n đ ¬ Cách bi u di n lu t nh IF THEN đ n gi n cho phép gi i thích d dàng c u trúc tri th c c n trích l c c k t qu mong mu n i c xây d ng 6/45 Lu t (Rule) \ Lu t m t ki u s n xu t d ng : LHS → RHS u u Ph n trái LHS (Left Hand Side) có n i dung đ c g i theo nhi u tên khác nhau, nh : ¬ ti n đ (antecedent) ¬ u ki n (conditional part) ¬ m u so kh p (pattern part) Ph n sau lu t RHS (Right Hand Side) k t lu n hay h u qu (consequent) 7/45 Lu t (Rule) \ Trong m t h th ng d a lu t, công c suy lu n s xác đ nh nh ng lu t tiên đ th a mãn s vi c \ Các lu t s n xu t th ng đ c vi t d i d ng IF THEN \ Có hai d ng lu t : IF < u ki n > THEN < hành đ ng > \ M t s HCG có thêm ph n hành đ ng (action) bên ph n ph i c a lu t : IF < u ki n > THEN < k t lu n > DO < hành đ ng > 8/45 t tên lu t \ Tu theo HCG c th mà m i lu t có th đ \ Có d ng Rule: Tên \ Ví d : c đ t tên Rule: èn đ IF èn đ sáng THEN D ng Rule: èn-xanh IF èn xanh sáng THEN i \ Trong ví d trên, èn đ sáng èn xanh sáng nh ng u ki n, hay nh ng khuôn m u 9/45 Cú pháp c a lu t \ A simple rule : IF THEN \ A rule can have multiple antecedents joined by the keywords AND (conjunction), OR (disjunction) or a combination of both IF THEN AND OR OR THEN 10/45 Frames \ Frames often allowed you to say which things were just typical of a class, and which were definitional, so couldn’t be overridden \ Using an asterix to denote typical values: Elephant: subclass: mammal haspart: trunk * colour: grey * size: large \ Frames also allowed multiple inheritance (Nellie is an Elephant and is a circus animal) \ Introduces problems in inheritance 31/45 Simple Frame Example Giá tr Thu c tính Slot Name Filler name Astérix height small weight low profession warrior armor helmet intelligence very high marital status presumed single 32/45 Representing Knowledge in Frames \ Frame Architecture uA record-like data structure for representing stereotypical knowledge about some concept or object (or a class of objects) uA frame name represents a stereotypical situation/object/process u Attributes or properties of the object also called slot u Values for attributes called fillers, facets provide additional control over fillers 33/45 Frame Architecture Frame Name: Object Class: Object Properties: Property Value Property Value … … … … 34/45 Types of Frames \ Class Frame u Represents general characteristics of common objects u Define properties that are common to all objects within class u Static & dynamic property \ Static: u Describes an object feature whose value does not change \ Dynamic: u Feature whose value is likely to change during operation 35/45 Mơ hình ki u c a khung Frame Name: Bird Class: Properties: Animal Color Unknown Eats Worms No._Wings Flies True Hungry Unknown Activity Unknown 36/45 Subclass Frame \ Represents subsets of higher level classes or categories \ Creates complex frame structures \ Class relationships Class Subclass Instance Robins Bird1 Bird Canaries Bird2 Tweety Sparrows Bird3 Bird4 37/45 Instance Frame \ Represents specific instance of a class frame \ Inherits properties & values from the class \ Able to change values of properties & add new properties Tweety Frame Name: Class: Properties: Bird Color Yellow Eats Worms No._Wings Flies False Hungry Unknown Activity Lives Unknown Cage 38/45 Frame Inheritance \ Instance frame inherits information from its subclass frame and also its class \ Inheritance of behavior, facet \ Ease coding & modification of information 39/45 Frames and procedures \ Frames often allowed slots to contain procedures \ So Size slot could contain code to run to calculate the size of an animal from other data \ Sometimes divided into “if-needed” procedures, run when value needed, and “if-added” procedures, run when a value is added (to update rest of data, or inform user) \ So Similar, but not quite like modern object-oriented languages 40/45 Overview of Frame Structure \ Two basic elements: slots and facets (fillers, values, etc.); \ Typically have parent and offspring slots Used to establish a property inheritance hierarchy (e.G., Specialization-of) Descriptive slots u Contain declarative information or data (static knowledge) Procedural attachments u Contain functions which can direct the reasoning process (dynamic knowledge) (e.G., "Activate a certain rule if a value exceeds a given level") Data-driven, event-driven ( bottom-up reasoning) Expectation-drive or top-down reasoning Pointers to related frames/scripts - can be used to transfer control to a more appropriate frame u \ \ \ \ \ 41/45 [Rogers 1999] Usage of Frames \ Filling slots in frames u Can inherit the value directly u Can get a default value u These two are relatively inexpensive u Can derive information through the attached procedures (or methods) that also take advantage of current context (slotspecific heuristics) u Filling in slots also confirms that frame or script is appropriate for this particular situation 42/45 [Rogers 1999] Problems with Frames \ Negation cannot be represented u Jim does not have pneumonia \ Disjunction cannot be represented naturally u Jim has Mumps or Rubella \ Qualification is not a part of the language u All of Jim’s diseases are infectious \ => Thus, procedural attachments are often added 43/45 Bi u di n tri th c nh ngôn ng nhân t o \ Th c t , ngôn ng t nhiên : ng cách thu n ti n nh t đ giao ti p v i m t HCG u Là ph u Không nh ng đ i v i ng (t cách chuyên gia) u Mà đ i v i NSD cu i i qu n tr h th ng \ Hi n có nh ng HCG có kh n ng đ i tho i ngơn ng t nhiên (thông th ng ti ng Anh) nh ng ch h n ch m t s l nh v c chuyên môn 44/45 A Quick Ontological View 45/45 ... t \ Bi u di n tri th c HCG 2 .1 \ Lôgic m nh đ 2.2 \ Lôgic v t b c m t 2.3 \ Bi u di n tri th c nh logic v t b c m t 2/45 Bi u di n tri th c m t HCG \ Tri th c c a m t HCG có th đ ph ng pháp khác... combination of both IF THEN AND OR OR THEN 10 /45 Ví d \ Strategy IF THEN the... THEN < hành đ ng > \ M t s HCG có thêm ph n hành đ ng (action) bên ph n ph i c a lu t : IF < u ki n > THEN < k t lu n > DO < hành đ ng > 8/45 t tên lu t \ Tu theo HCG c th mà m i lu t có th đ