1 / 34

DRAMA 系統簡介

DRAMA 系統簡介. 黃國禎 2004/7/22 http://163.22.22.164/drama. outline. DRAMA 之建構理念(參考課本第九章) 介紹 NORM 知識模型的設計概念 DRAMA 基本操作方法(參考課本第十章) DRAMA Rule Editor DRAMA Server,DRAMA Console ( 習題 1) DRAMA 的進階操作方法(參考課本第十一章) DRAMA Verifier DRAMA Extractor 實例- 電腦檢修專家系統(參考課本第十二章) 水稻栽種專家系統(參考課本第十三章)

nuru
Download Presentation

DRAMA 系統簡介

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DRAMA系統簡介 黃國禎 2004/7/22 http://163.22.22.164/drama

  2. outline • DRAMA之建構理念(參考課本第九章) • 介紹NORM知識模型的設計概念 • DRAMA基本操作方法(參考課本第十章) • DRAMARule Editor • DRAMA Server,DRAMA Console • (習題 1) • DRAMA的進階操作方法(參考課本第十一章) • DRAMA Verifier • DRAMA Extractor • 實例- • 電腦檢修專家系統(參考課本第十二章) • 水稻栽種專家系統(參考課本第十三章) • 前端應用程式(網頁..)如何連結 DRAMA SERVER?

  3. NORM (New Object Oriented Rule-Based Model)知識模型 • 將專業知識(expertise)轉換為可以管理與應用的資訊結構 • 遞增型(incremental)的知識定義 • 允許新增、刪除、重新定義系統中的知識內容 • 模組性 • 知識區塊結構清楚,並且可以由知識引擎獨立運用或推論 • 抽象性 • 幫助具體抽離出有用的知識特徵,不必著墨於無關的知識細節 • 再用性 • 支援知識的擴張與修正 • 可分享性 • 不同的知識庫系統可以藉由統一的知識格式協力推論 • 模糊性 • 支援不確定知識的處理 • NORM的物件導向知識管理概念,讓知識系統建置者以更符合人類思維的方式來開發知識應用系統

  4. NORM中的各項基本元素介紹 • 事實(變數)- • Fi:n=v, p • n:事實之名稱 • v:事實之值 • p:事實的可能性(-1~1,-1代表事實不成立的可能性高; 1代表事實成立的可能性最高;0代表無法判斷) • 事實可用的型態包括有字串、整數、浮點、日期、二元資料型態 • 支援動態指定,對於不清楚的事實型態,支援空的事實值 • E.g., F5:color=“red”, 0.8

  5. 規則類別(知識類別) • 為解決特定問題建構的規則 • 規則類別中可以定義的事實包括回應事實和需求事實 • 回應事實:經由推論產生的事實,非使用者的輸入 • 需求事實:在推論前由環境取得的資訊 • 在推論過程中,假如需求事實無法獲得,則以預設值填入; 假如推論的結果未產生所需的回應事實,則回應事實仍會以預設值存在推論結果的事實中

  6. 規則-知識類別中的知識內容 • Ri:IF c THEN a (CF=μ i) ,t ,w • c:規則的條件部分(前提,前件部),可能性yi • 由各類運算元組成,條件運算結果為布林值,決定是否觸發(trigger) • F1: color=“red” (0.9) • R1: IF color =“red” THEN status=“danger”,(CF=0.8),0.2,0 • a:規則的動作部分(結論,後件部),可能性di • 事實的指定(包括針對事實指定新的值或產生新的事實) • 前述計算出的新可能性小於原有事實的可能性,則不進行指定 • 反之,則進行指定,新的可能性之計算方式請參考p.299 • μ:規則的可信賴度(MYCIN) • t:規則中對於事實可能性的界線值 • w:規則執行的優先權重 (priority or salience) • 重要的規則關聯先驅動(如轉化,需求) • 加強某些規則推論路徑的執行順序

  7. Design Concept of DRAMA • In DRAMA, Knowledge Base is constructed by building the relations between knowledge objects • Each knowledge object may relate to a specific domain problem to solve • Knowledge base can be built up by solving the sub-problems as problem-solving ability of experts Domain Knowledge Domain Knowledge New Domain Knowledge Domain Knowledge Domain Knowledge

  8. Knowledge Model of DRAMA • Rule Class • Relations: interaction of knowledge objects (Rule Classes) • Facts • Rules

  9. Relation Types • Four kinds of relations are defined according to real world problems types and relations • Reference (靜態:在定義知識類別時即設定完成) • Extension (靜態:在定義知識類別時即設定完成) • Trigger (動態:在推論過程中,引用某些規則觸發後的結果) • Acquire (動態:在推論過程中,引用某些規則觸發後的結果)

  10. Reference(部分繼承) • 將原有知識類別中的知識直接沿用成為新定義的知識類別之一部份(沿用的部分必須為不重疊的知識) • Example • 學習如何辨識野鴨的知識 v.s. 一般鴨子 和天鵝 swallow wild goose Initial Fact Flyable Flyable Is Wild goose reference Is swallow Initial Fact Some feature from goose goose reference Initial Fact infer Is goose

  11. Dengue Fever Type 2 extension Dengue Fever Dengue Fever Type 1 extension Extension(子類別繼承父類別) • 將其他知識類別已存在的知識納入使用,是知識的擴充,加強或修正 • 類似物件導向中的繼承觀念 • 在延伸關係中,可在新知識類別中重新定義邏輯上重疊的規則,並以新規則覆寫舊規則(邏輯覆蓋) • 當不同的規則針對同樣的事實進行修改,新增時以子類別新產生或修正的事實為基準, 忽略父類別的修正或產生 • 子類別已修正或產生的事實, 父類別中的規則即使驅動亦無法修改其值

  12. Trigger (驅動) • 在推論過程中,當某些規則成立時執行驅動 • 將現有的事實帶往另一知識類別,並且以該知識類別中的知識進行推論,以得到所需的結論,不再使用原來的知識類別進行推論. Trigger Internal medicine Outpatient

  13. Acquire(需求) • 用於解決推論中必須處理的子問題 • 步驟: (1)將目前的事實帶往指定的規則類別並進行推論 (2)將回應的事實帶回原有的知識類別繼續推論 (3) 將事實的可能性根據規則的可信度重新計算 Acquire Internal medicine Dengue Fever

  14. Features of DRAMA • Each rule class can be considered as chunk of knowledge • Easy to maintain • Easy to trace • Easy to verify • Extensibility by using API for DRAMA • Web-based service with expertise • AP-based application with expertise • Security and Authority concerns about expertise • Security mechanism for protect expertise • Authority mechanism for limit different authority to access the different expertise

  15. Example to Use Four Relations Fever Rash Outpatient reference Trigger Acquire Internal medicine Dengue Fever Acquire extension Trigger Nephritis Dengue Fever Type 2 Dengue Fever Type 1 Hepatitis Gastritis Surgery Orthopedics

  16. Tools of DRAMA • DRAMA Inference Server (S, P, E) • 透過TCP/IP協定操作DRAMA Server做各項管理動作 • DRAMA Console (S, P, E) • 以DRAMA API開發的操作指令介面,存取伺服器中的設定 • DRAMA Rule Editor (S, P, E) • 規則編輯器讓使用者編輯規則類別及規則內容並輸出為符合XML格式的檔案 • DRAMA Rule Extractor (P, E) • 以Repertory-Grid為基礎的知識擷取工具 • DRAMA Rule Generator (P, E) • 以State-Diagram(狀態圖)為基礎的知識擷取工具 • DRAMA Rule Verifier (P, E) • 驗證規則類別與規則之關聯的工具 • DRAMA API (E) • 提供給外部的應用程式連結伺服器並進行各類動作

  17. Requirements of DRAMA • CPU • Pentium III 533 and above • RAM • 256 MB and above (256MB for 50,000 rules, 512MB-1GB for100,000 rules) • Software • Pre-requirement: JDK VM 1.3.1 • API Language: Java • OS • Operating system independent, but need have Java Virtual Machine • Hardware • Platform independent

  18. DRAMA Rule Syntax • XML-based Rule Description • One XML File=One RuleBase • One RuleBase may contain several RuleClasses • Element Definition • RuleClass • Fact • Rule • Condition • Action • Expression • Assignment • Trigger • Acquire • Relation • Reference • Extension

  19. RuleClass • Indicates a rule class • Name (ID:屬性是唯一的且為必要屬性) • The name of the rule class • Description (屬性值為字元, 可有可無) • Describes the meaning of rule class • version • The version of the rule class

  20. Fact • Indicates a defined fact in rule class • name • The name of the fact • type • The type of the fact • String, Integer, Float, Boolean, Date • possibility • The possibility of the fact supported • description • Describes the meaning of the fact

  21. Rule • Defines a rule contained in rule class • name • The name of the rule, only for management purpose • certainty-factor • The certainty of the rule indicated how confidence this rule is • weight • The weight of the rule indicated the importance of the knowledge • description • Describes the meaning of the rule

  22. Condition & Action • Condition • Sub-element and the condition part of the rule • When the condition is satisfied, the rule is fired • Contains only one expression element defined the logic expression of the rule • Action • Sub-element and the action part of the rule • When the rule is fired, the action is executed • Several types of action can be executed,include (Assignment|Actor|Trigger|Acquire)*

  23. Expression • Used in the condition part and action part of rule • operator • The type of the operator to be used within current element • 目前元素所使用的運算元種類,其種類包括 • 一般數學運算元(Math Operator) • 事實的參照(Fact) • 常數的使用(Const) • 布林計算(<,>,=,<=,>=) • type • 當元素的運算元為參照特定常數(Const)時,則以此屬性來標示常數的種類,包括 • STRING,INTEGER,FLOAT,BOOLEAN • value • 運算元的值,當元素的運算元為參照常數(Const)時,則此屬性用以標示常數的值內容;參照事實(Fact)時,用以標示事實的名稱. • Recursive design • Childs of expression element is also expression

  24. Assignment • A type of Action • 對事實進行指定值的動作 • Two sub-elements • AssignedFact • 指定事實的對象 • 元素內容為“文字資料“,即事實名稱 • AssignedValue • 指定事實的值 • 元素內容為子元素Expression,即產生所指定值的敘述Expression

  25. Trigger & Acquire • Trigger • A type of action • 元素內容為“文字資料” • 當規則被滿足時,驅動名稱符合元素內容中的規則類別 • Acquire • A type of action • 元素內容為“文字資料” • 當規則被滿足時,推論動作轉移至名稱符合元素內容中的規則類別並執行需求動作

  26. Relation • 針對Extension與 Reference這兩種靜態的知識關聯 • 此元素中不包括其他元素 • 此元素為元素(rule class)的子元素 • 屬性包括 • targetName • 標示此知識關聯的對象 • IDREF 屬性值必須引用XML中出現過的屬性的值,被引用的屬性其屬性值為ID • type • 屬性之值為Reference或Extension,關聯的型態為Reference或Extension.

  27. Operators

  28. Sample of Rule Class <?xml version="1.0" encoding="big5"?> <!DOCTYPE OORBMS SYSTEM "OORBMS.dtd"> <OORBMS> <RuleClass name="新增硬體檢測"> <Relation targetName="基礎檢測" type="Extension"/> </RuleClass> <RuleClass name="掃描器檢測"> <Fact name="新增掃描器" type="Boolean" value="false" /> <Rule name="是否新增掃描器" weight="1" certainty-factor="1.0" description=""> <Condition> <Expression operator="="> <Expression operator="Fact" value="新增掃描器" /> <Expression operator="Const" value="false" type="Boolean" /> </Expression> </Condition>

  29. <Action> <Assignment> <AssignedFact> 可能問題與建議 </AssignedFact> <AssignedValue> <Expression operator="+"> <Expression operator="Fact" value="可能問題與建議" /> <Expression operator="Const" value="將掃描器送修 " type="String" /> </Expression> </AssignedValue> </Assignment> </Action> </Rule> </RuleClass> </OORBMS>

  30. Exercise-1 • 請以DRAMA的規則編輯器編輯以下知識類別且產生相對應的XML檔案︰ Rule1:IF 天氣=”晴天” THEN 出遊類別=”室外” Rule2:IF 天氣=”陰天” AND 心情=”好” THEN 出遊類別=”室外” Rule3:IF 天氣=”陰天” AND (心情=”一般” OR 心情=”不好”) THEN 出遊類別=”室內” Rule4:IF 天氣=”雨天” AND 心情=”好” THEN 出遊類別=”室外” Rule5:IF天氣=”雨天” AND (心情=”一般” OR 心情=”不好”) THEN 出遊類別=”不出遊”

  31. Exercise-2 水稻栽種專家系統

More Related