
b7375e4ec360b74fa026fa4d6d70344e.ppt
- Количество слайдов: 51
Chapter 6 The Design of Expert Systems 專家系統設計流程 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang
Contents n n This chapter presents general guidelines for building practical expert system designed for real world applications, not research prototypes. A software engineering methodology is described so that an expert system can be a quality product developed in a cost -effective and timely manner. 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 2
影響專家系統專案的因素 n 組織內部的影響 n n n 管理單位 決策者 使用單位 教育人事單位 軟體開發部門 組織外部的影響: n n 客戶 供應商 協力廠商 政府主管機關 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 3
6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 4
• 建置專家系統專案 Selecting the appropriate paradigm: Why are we building an expert system? Payoff: What is the payoff? (money, efficiency, etc. ) If no one uses, there will be no use. Tools: What tools are available to build The system? (LISP, CLIPS, KEE, PCPLUS, etc. ) Cost: How much will it cost? 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 5
PROJECT MANAGEMENT (專案管理) Activity Management 作項目管理 Scheduling Planning Analysis Product Configuration Management 產品設定管理 Product Management Change Management Resource Management 資源管理 Acquire Resources Forecast Resource Needs Minimize Assigning Resource Responsibilities Bottlenecks Chronicling (Recording) Project Management Tasks 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 6
(1) Activity management ( 作項目管理 ) n Planning (規劃) n n n Scheduling (排程) n n Define activities, specify priority of activities Resource requirements, milestones Duration Responsibilities assign starting and ending times resolve conflicts in scheduling tasks of equal priority Chronicling (紀錄)- monitor project performance Analysis (分析)-analyze plans, schedules, and chronicled activities 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 7
(2) Product configuration management (產品設定管理) n Product management (產品管理) n n manage the different versions of the product Change management (變異管理) n manage change proposals and evaluations n assign personnel to make changes n install new product versions 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 8
(3) Resource management (資源管理) 1. forecast needs for resources 2. acquire resources 3. 4. assign responsibilities for optimum use of resources provide critical resource to minimize bottlenecks 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 9
Feasibility Study (可行性研究) Paper or comparison study to show project is feasible Rapid Prototype (快速雛形設計) Expert system quickly put together to demonstrate ideas, arouse enthusiasm, and impress upper-level management Refined System ( - test) (調整修正系統) Field Testable ( - test) (導入領域測試) In-house verification of the expert system on real problems by knowledge engineers and expert System tested by selected users - not knowledge engineers or expert Commercial Quality System (商用系統品質設定) Validated and tested User documentation Training Fast user support by telephone and/or electronic mail Maintenance and Evolution (系統維護與演進) Fix bugs Enhance capabilities General Stages in the Development of an Expert System 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 10
可行性研究 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 11
快速雛形設計 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 12
商用品質設定—壓力測試 類別 方法說明及範例 效果 大量運算 重複執行某項功能數 萬次 驗證某些功能不會殘留一些額外的資訊於記憶體或硬 碟暫存檔案之中,在數次執行後可能因為記憶體空間 不足或是其他因素造成副作用。 大量運算 連續規則推論 72小時 驗證某些功能不會殘留一些額外的資訊於記憶體或硬 碟暫存檔案之中,在數次執行後可能因為記憶體空間 不足或是其他因素造成副作用。 惡劣環境 將軟硬體系統置於高 溫環境中 在長時間運作的系統中,高溫 作的情況偶爾會發生, 可以測試在此環境中系統的表現。 惡劣環境 將軟硬體系統置於低 溫環境中 檢查硬體系統是否有訊號不正常之情況發生。 不正常操作 在操作過程中突然關 閉系統 檢查記憶體回復之情況是否如預期。 規則迴圈 (例如:A->B, B->C, C ->A),造成規則迴圈 的特殊錯誤。 檢驗系統是否針對此類邏輯錯誤具判斷能力。 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 13
The Delivery Problem n Be considered in the earlier stage of development n Choose standard hardware n Consider cost issues n Consider communication and coordination problems with other programs 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 14
Maintenance and Evolution (維護與演進) n n n more complex than conventional programs There must be a systematic and efficient way to collect bug reports from users 維護 作: n n n 系統程式碼維護 系統功能維護 資料庫維護 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 15
Errors in Development Stages (發展階段的錯誤 ) 1. 2. 3. 4. 5. 6. Expert’s knowledge errors Semantic errors Syntax errors Inference engine errors Inference chain errors Limits of ignorance errors- Human expert knows the extent of their knowledge and their performances degrade gracefully at the boundaries of their ignorance. 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 16
Expert 專家 • Errors in the expert’s knowledge, such as incorrect and incomplete knowledge Knowledge Engineer 知識 程師 • Semantic errors of meaning between knowledge engineer and expert • Incomplete elicitation knowledge from expert Knowledge Base 知識庫 • Syntax errors of form • Errors in content due to incorrect and incomplete knowledge, and uncertainty in rules and facts Inference Engine 推論引擎 • Bugs in the inference engine, and other software of the expert system tool Inference Chain 推論串 • Errors of inference due to incorrect priority of rules, interaction of rules, and errors of the knowledge-base Errors due to nonmonotonic inference Figure 6 -3 Major Errors in Expert Systems and Some Causes 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 17
Software Engineering and Expert Systems PROBLEMS High Cost of Development Wide Variation in Development Methodology Lack of Programmer Productivity SOFTWARE ENGINEERING Documentation Plans, Requirements, and design Reports Schedules Software Life Cycle PRODUCT Validated, verified and tested Cost Effective On-Time Goals Easily Well Maintainable and. Documented Enhanceable Figure 6 -4 The Software Engineering Methodology 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 18
資料庫系統與專家系統的關係 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 19
傳統軟體專案概念 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 20
知識 程概念 n 問題( problem) = 資料(data) + 未知資訊(unknown information) 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 21
專家系統專案與知識 程之關係 Software Engineering 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 22
Some Software Quality Metrics (meter) for Expert Systems n Correct outputs given correct input n Complete output given correct input n Consistent output given the same input again n Reliable so that it does not crash (often) due to bugs n Usable for people and preferably user-friendly n Maintainable n Enhanceable (extendable) n Validated to prove it satisfies the user’s needs and requests n Tested to prove correctness and completeness n Cost-effective 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 23
n n n n n Reusable code for other applications Portable to other hardware/software environments Interfaceable with other software Understandable code Accurate Precise Graceful degradation at the boundaries of knowledge Embedded capability with other languages Verified knowledge-base Explanation facility 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 24
Expert System Life Cycle (生命週期) 1. Maintenance Costs (維護成本) Conventional software (一般軟體) - 60 ~ 80 % of all software costs - two to four times the original development cost Expert systems (專家系統) - may be worse 2. Waterfall Model (瀑布模型) • • A lifecycle model ( process model) for conventional software In figure 6 -5 What should be done next? How long should the next stage be performed? 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 25
System feasibility Validation 生命週期--瀑布概念 Software Plans and requirements Validation Product Design Validation Detailed Design Validation Code Unit Test Integration Product Validation Implementation Figure 6 -5 The Waterfall Model of the Software Life Cycle 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang System Test Operations and Maintenance Revalidation 26
Prototype is built Requirement determined Final system is built 3. Code-and-Fix Model • More practical than waterfall model • Do not need to know all the information in advance 4. Incremental Model • A refinement model of waterfall model • Top-down approach • Easy to test, verify and validate • A continuous rapid prototype that extends over the entire development 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 27
major increments assistant level colleague level single rule: macro increments initial prototype rules minor increments 6. 專家系統設計流程 expert level minor increments S. S. Tseng & G. J. Hwang rules minor increments 28
5. Spiral Model (螺旋模型) Planning Requirements Design Validation Knowledge Acquisition Verification Evaluating the Expert System T Testing Verification Integration Coding Verification Testing Figure 6 -6 A Spiral Model of Expert System Development 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 29
A Detailed Life Cycle Model Design Baseline Knowledge Definition Planning Source Ident. & Selecti on Work Plan Knowledge Design Acquisition Analysis & Extraction Definition Detailed Design Code & Checkout Product Baseline Knowledge Verification Formal Test Knowledge Preliminary Knowledge System Review Data Review Test Analysis System Evaluation Test Audit Review Final Review Figure 6 -7 The Linear Model of Expert System Development Life Cycle 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 30
1. Planning (問題分析, 定義及 作規劃 ) n to produce a formal work plan n a set of documents that will be used to guide and evaluation development n Table 6 -2 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 31
Task Objective Feasibility assessment (可行性評估) Determine if it is worthwhile to build the system and if so, whether expert system technology should be used. Resource management (資源管理) Assess resources of people, time, money , software, and hardware required. How to acquire and manage the required resources. Task phasing ( 作項目) Specify the tasks and their order in the stages. Schedules ( 作進度) Specify the starting and delivery dates of tasks in the stages. Preliminary functional layout (功能規劃) Defines what the system should accomplish by specifying the high-level functions of the system. This task specifies the purpose of the system. High-level requirements (高階需求描述) Describes in high-level terms how the functions of the system will be accomplished. 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 32
動機與問題確認 n 資料導向 (Data driven) n n n Bottom-up project Data cleaning Data transformation Figure 6 -13 目標導向 (Goal driven) n n Top-down project Two Phase n n 第一階段: 列出所有可能目標( possible target list) 第二階段: 針對所有列出之目標架構階層關係,建立目 標階層(Targets hierarchy) 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 33
資料導向的問題確認流程 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 34
可行性評估 n 定性分析 n 需求 n n 風險 n n n 資源, 知識來源, 支援人力 問題難易度如何 ? 知識是否容易取得 ? 專案人員能力是否足夠 ? 發展之技術原理是否合理 ? 技術是否容易維護 ? 定量分析 n 成本效益 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 35
專家系統專案計劃書 計劃書項目 內容說明 專案名稱 淺顯扼要的將整個專案欲解決的問題及解決方式說明。 執行時間 執行團隊/配合人員 專案執行的時間規劃,包括資料蒐集整理、研究發展、系統建置、文件編撰、系 統維護計劃擬定等時間。 概要的說明整個專案的目的及預計達成的成果,一般建議以兩百字到五百字左右 的長度撰寫專案摘要。 說明整個專案在進行中,執行團隊的名單及相關單位需要配合的人力。 計劃內容 欲解決的問題說明 知識來源與規劃 專家系統知識的來源是專案的關鍵,如何規劃知識的來源,整理資料庫現有的資 料特性及搭配領域專家的協助,以縮短建制知識庫的時間與減少可能的困難。 導入技術背景及技術關 聯說明 說明預定導入的相關技術背景,此技術與組織原有技術之間的關聯,及未來新技 術導入時的利基等詳細說明,以利技術團隊更清楚知道專案的技術里程碑。 預期效益 除了技術上的導入效益之外,對於使用單位產生的預期效益也是重要的評估資料。 預期產出產品 在預期效益之中特別可以釐清的產品列表。 時及採購清單 預定支援的人力成本,預定採購品名清單。 時程預估 將每項技術研讀/研究/導入及預定產出成果或產品的時間說明清楚,並依據資料 蒐集整理、研究發展、系統建置、文件編撰、系統維護計劃擬定等項目訂定查核 時間點(Check point)。 專案摘要 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 36
2. Knowledge (requirement)Definition (知識定義, 擷取及技術評估) n n To define the knowledge requirement of the expert system consists of two tasks n n knowledge source identification & knowledge selection (Table 6 -3) Knowledge acquisition, analysis and extraction (Table 6 -4) - e. g. Repertory Grids 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 37
Task Objective Source identification Who and what are the knowledge sources, without regard to availability. Source importance Prioritized list of knowledge sources in order of importance to development. Source availability List of knowledge sources ranked in order of availability. Books and other documents are generally much more available than human experts. Source selection Select the knowledge sources based on importance and availability. Table 6 -3 Knowledge Source Identification and Selection Tasks 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 38
Task Objective Acquisition strategy Specify how knowledge will be acquired by methods for interviewing experts, reading documents, rule induction, repertory grids, and so forth. Knowledge element Pick out the specific knowledge from sources that will be identification useful in this iteration of the life cycle. Knowledge classification system Classify and organize the knowledge to aid in knowledge verification and understanding by developers. Use hierarchical groups whenever possible. Detailed functional layout Specify the functional capabilities of the system in detail. This level is at a more technical level while the preliminary functional layout was at a managerial level. Preliminary control flow Describe general phases that the expert system will execute. Phases correspond to logical groups of rules which are activated/deactivated in groups to control execution flow. Table 6 -4 Knowledge acquisition, analysis and extraction 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 39
Preliminary user’s manual Describes system from user’s viewpoint. An often ignored, but essential part of the system. It is absolutely important to involve users as soon as possible for feedback. If they don’t use the system, it’s worthless. Requirements specifications Define exactly what the system is supposed to do. The expert system will be validated using these requirements. Knowledge baseline Baseline knowledge for the system. Any changes must now be done by a formal change request. The high level knowledge is now adequate for the next stage of knowledge design. Table 6 -4 (continue) Knowledge Acquisition, Analysis, And Extraction Tasks 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 40
3. Knowledge Design (系統設計及發展) n n To produce the detailed design for an expert system Two main tasks: Knowledge (representation) definition (Table 6 -5) n Detailed design (Table 6 -6) e. g. Internal fact structure (in Table 6 -5) for CLIPS: n 10 Not very meaningful (price 10) better (gold price 10) much better 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 41
Task Objective Knowledge representation Specify how knowledge will be represented, such as rules, frames, or logic. Dependent upon what the expert system tool will support. Detailed control structure Specify three general control structures. (1)If the system is embedded in procedural code, how it will be called. (2)control of related groups of rules within an executing system. (3)metalevel control structures for rules. Internal fact structure Specify the internal structure of facts in a consistent manner to aid in understanding and good style. Preliminary user interface Specify a preliminary user interface. Get feedback from users about their interface. Initial test plan Specify how code will be tested. Define test data, test drivers, and how test results will be analyzed. Table 6 -5 Knowledge Definition Tasks 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 42
Task Objective Design structure Specify how knowledge is logically organized in the knowledge-base and what is in the knowledge-base. Implementation strategy Specify how the system is to be implemented. Detailed user interface Specify the detailed user interface after receiving user feedback from the preliminary user interface design. Design specifications and report Document the design. Detailed test plan Specify exactly how the code will be tested and verified. Table 6 -6 Detailed design of knowledge tasks 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 43
4. Code and Checkout (系統開發, 測試及客戶導入) n Begins the actual implementation of the code n Table 6 -7 n Terminates with the “test readiness review” to determine if the expert system is ready for the next stage of knowledge verification 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 44
Task Objective Coding Implement coding. Tests Test code using test data, test drivers, and test analysis procedures. Source listings Produce commented, documented source code. User manual Produce working user’s manual so experts and users can provide feedback on system. Installation/operations guide Document installation/operation of system for users. System description document Document overall expert system functionality, limitations, and problems. Table 6 -7 Code And Checkout Tasks 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 45
5. Knowledge Verification (知識驗證) determine the correctness, completeness and consistency of the system • two main tasks: – Formal tests (Table 6 -8) – Test analysis (Table 6 -9) Looking for Incorrect answers Incomplete answers Inconsistent answers 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 46
Task Objective Test procedures Implement formal test procedures. Test reports Document test results. Table 6 -8 Formal Test Tasks Of The Knowledge Verification Stage The test analysis tasks are shown in table 6 -9. Task Objective Results Evaluations Analyze test results. Recommendations Document recommendations and conclusions of tests. Table 6 -9 Test Analysis Tasks 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 47
6. System Evaluation (系統評估) n n n to summarize what has been learned with recommendations for improvements and corrections Table 6 -10 If new knowledge is added, the system verification must also be performed in conjunction with all the system knowledge (including the previous knowledge and the new knowledge) 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 48
Task Objective Results Evaluation Summary the results of testing and verification. Recommendations Recommend any changes to the system. Validations Validate that the system is correct with respect to needs and requirements. Interim (temporary) If the system is complete, then issue final or final report; if not, issue an interim report. Table 6 -10 System evaluation stage tasks 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 49
系統文件撰寫及整理 n n n n n 文件摘要 文件修改歷史紀錄 專家訪談紀錄 快速雛形發展版本控管 程式原始碼及註解 系統修正紀錄 測試紀錄 專案執行紀錄與計劃書之差異比較 參考文獻及資料出處 索引 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 50
系統維護 6. 專家系統設計流程 S. S. Tseng & G. J. Hwang 51
b7375e4ec360b74fa026fa4d6d70344e.ppt