1 / 31

Chap II: Knowledge Representation

Chap II: Knowledge Representation. تمثيل المعرفة تعني بناء المعرفة داخل نظام الحاسب. يعتبر تمثيل المعرفة واستراتيجيات البحث أهم المواضيع التي اهتم بها دارسو الذكاء الاصطناعي. Knowledge Representation.

delorest
Télécharger la présentation

Chap II: Knowledge Representation

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. Chap II: Knowledge Representation • تمثيل المعرفة تعني بناء المعرفة داخل نظام الحاسب. • يعتبر تمثيل المعرفة واستراتيجيات البحث أهم المواضيع التي اهتم بها دارسو الذكاء الاصطناعي.

  2. Knowledge Representation • المقصود بتمثيل المعرفة هو جعل الحاسب يعمل ما يريده العقل البشري بحيث يفكر كما يفكر الإنسان ، فيأخذ المعلومات و يحللها مثل الإنسان.. • والنظم المراد تطويرها ليست نظماً يدوية بل حاسوبيه ذات ذكاء متطور. و من هنا ظهرت الحاجة إلى المعرفة .. و لكن كيف تمثل هذه المعرفة؟! • في الواقع فإن المناقشة العادية التي أتعرف فيها على شخص ما ، فإنني آخذ مجموعة من المعلومات عن هذا الشخص مثل: اسمه،رقمه،صورته،عنوانه.. و هذه كلها معلومات اختزنها في عقلي. • و لكن في حالة الحاسب الآلي فإننا نريده أن يفكر بلغة الواقع و العقل و ليس بأي لغة من اللغات المعروفة للحاسب..

  3. Data, Information, Knowledge ? Non-programmable Non-algorithmic(heuristic) WISDOM حكمة KNOWLEDGE INFORMATION Algorithmic programmable DATA

  4. Physical Symbol System Hypothesis (P2SH) نشاط الذكاء في كل من الإنسان والآلة يتم تحصيله عبر:- أنماط رمزية : لتمثيل خصائص المشكلة المختارة. عمليات : لتوليد حلول ممكنة. بحث: لاختيار أفضل حل أو حلول.

  5. 3142 1 The Example of Representation () 3.142 The example to present pi value. • The real number High (human)  • The decimal equivalent exponent {Abstraction} • Floating point mantissa • Computer memory 11100010 Low (machine)

  6. Knowledge Representation Techniques Rules القواعد Semantic Networks الشبكات الدلالية Object-Attribute Value TECHNIQUES Logic المنطق Frames الاطارات

  7. Object-Attribute-Value (OAV) • Using fact : “صياغة المعرفة التعريفية” • الإشارة لقيمة خصائص معينة لشيء ما • Eg: The ball’s color is red (assign red to the ball’s color) مثال لون الكرة أحمر ( تحديد الأحمر كلون للكرة) • The object can be physical (eg: car, books) or abstract (eg: love, hobby) الكائن يمكن أن يكون شيئا ماديا أو معنويا. • The value can be numerical, string or Boolean! القيمة يمكن أن تكون عددية ، تسلسلية أو منطقية. • It could be either single or multi valued from different attributes and objects.يمكن أن تكون مفردة أو متعددة القيم من سمات أو أشياء أخرى Used in MYCIN

  8. OAV Triplets Diagram (i) Fact :=: “The chair’s color is red and priced at $ 35.00 ” RED Color CHAIR Priced $ 35.00 Object Attribute Value

  9. OAV Triplets Diagram (ii) Fact :=: “TIN 313 is a compulsory subject for MSc Int Sys., code for Artificial Intelligence, and taught by Mr Yousef Salahat” Compulsory subject MSc Int. Sys TIN 313 Mr Yousef Salahat Taught Code Artificial Intelligence

  10. Rules Based • القواعد : هيكل المعرفة التي تربط بعض المعلومات بمعلومات أخرى والتي يمكن استنتاجها أو الاستدلال بها لمعرفتها. • IF condition THEN action statements.      (premise              (goal      antecedent)          consequent) • Example  IF “Temperature is hot” THEN “turn on the air-conditioning system” • مثال. لو ( الحرارة عالية) فإنه يتوجب ( تشغيل نظام التبريد).

  11. Ball’s color = red Like = ball Will buy = ball Rules Based System (I) Rule 1:IF the ball’s color is red THEN I like the ball. Rule 2:IF I like the ball THEN I will buy the ball. Knowledge Base 3 IF ball’s color = red THEN like = ball IF like = ball THEN will buy the ball Question: Ball’s color? Answer: Red Working Memory 1 2 5 4

  12. Patient has Strep throat Rules Based System (II) • Rule 1: IF x has a sore throat AND suspect bacterial infection THEN x has strep throat • Rule 2: IF x temperature is > 37 c THEN x has a fever • Rule 3: IF x has been sick > a month AND x has a fever THEN suspect bacterial infection • Patient’s temperature = 38 c حرارة المريض 38 • Patient has been sick > 2 months المريض تعبان من شهرين • Patient has a sore throat المريض لديه التهاب حلق • Conclusion ? المريض لديه بكتيريا في الحلق

  13. Semantic Networks • هي إحدى الطرق المستخدمة في تمثيل المعرفة في النظم الخبيرة .. وهي عبارة عن تمثيل المعرفة على شكل تركيب شبكي .. • كل شبكة دلالية: • مجموعة من Objects تدعى عقد nodes.. • مجموعة من الروابط Link تربط بين nodes.. • المعالجة الاستثنائية Exceptional handling • بعض الاستثناءات لحالات معينة ” كل الطيور قادرة على الطيران والنعامة طير“ هل يمكن للنعامة أن تطير؟

  14. The Example of Semantic Networks (Bird) FACT : Parrot is a bird. Typically bird has wings and travel by flying. Bird category falls under animal kingdom. All animal requires air to breathe. Ostrich is a bird but travels by walk. Wings أجنحة has is-a Parrot الببغاء Bird طائر Air الهواء is-a Animal حيوان Breathe يتنفس Fly يطير travel Ostrich النعامة Walk مشي “exceptional handling” travel

  15. Frames • و هي إحدى الطرق المستخدمة لتمثيل المعرفة في النظم الخبيرة و هي طريقة خاصة لكتابة بيانات المعرفة على شكل هيكل عام يحتوي إطارات. • Extension : schemas and basic to OOP • Class frame خصائص عامة لبعض الأشياء العامة مثال. إطار التصنيف طائر يشير إلى خصائص عامة للطائر. • Instance frame  لوصف خصائص فريدة من إطار التصنيف مثال. الصنف نعامة من إطار الصنف طائر

  16. Frames Structure Frame Name: BIRD Frame Name: OSTRICH Properties: Class Name: BIRD Color = unknown Wings = 2 Flies = True Properties: Color = brown/dark Wings = 2 Flies = False

  17. Logic المنطق الرياضي • The oldest representation existed أقدم تمثيل موجود. • Implemented using PROLOG, LISP programming language. • تمثيل المعرفة وبناء قواعدها يتطلب تحويل هذه الجمل إلى صيغ يسهل تمثيلها داخل أنظمة الحاسب. • والجمل وفق المنطق الافتراضي Propositional Logic أما أن تكون جمل بسيطة أو جمل مركبة.

  18. وإذ أخذنا المعاني التي نستخلصها من هذه الجمل نجدها أما أن تقدم إخبارا ( حقائق) أو قواعد، وهذه الحقائق أو القواعد أما أن تكون صحيحة أو خاطئة (True or False). Logical Operators

  19. Facts الحقائق • وهي الجمل التي تصف شيئا ما أو تخبر عن شيء ما سواء كانت هذه الجملة جملة اسمية أو فعلية أو شبه جملة، على سبيل المثال: • الذكاء الاصطناعي مقرر حاسب Artificial intelligence is a computer system • القط حيوان Cat is an animal • وقد تكون الحقيقة مركبة • أم احمد متزوجة من والد خالد Ahmed mother is married to Khalid father • وهذه الحقائق كلها حقائق صحيحة (True) • أما إذا أخذنا الجملة التالية : Cat is human • فهي حقيقة خاطئة (false)

  20. Rules القواعد • وهي الجمل التي يمكن تعميمها أو تطبيقها على مجموعة من الأشياء ويلزم تطبيقها توفر شرط أو مجموعة شروط. • ما يكسب بسهولة يضيع بسهولة Easy come easy go • لكل سؤال جواب every way has an answer • قد تكون القاعدة في صورة جملة if على سبيل المثال: • إذا كان الحيوان يعطي حليبا أذا الحيوان من ذوات الثدييات if animal give milk it is a mammal

  21. Predicate Calculus Logic (FOPL) • والشكل العام لتركيب الجمل وفق المنطق الرياضي هو: • operator (variables_1, variables_2,…) • EXAMPLES: • COMPUTER_COURSE(ARTIFICIAL_INTELLEGIENCE) • ANIMAL(CAT)

  22. جدول: الرموز المستخدمة في التمثيل الرياضي للمنطق

  23. Predicate Calculus Logic (FOPL) • Example: “She likes chocolate”  likes (she, chocolate). • Universal quantifier (X) to show all object is true [Eg: All students  (X (student (X))] • Existential quantifier (X) to show existence / partial object is true [ Eg: Some people ( X (people (X))]

  24. The Example of FOPL Normal: “If it doesn’t rain today, Ahmad will go to the beach. FOPL:rain( today) go(Ahmad, beach) Normal: “All volleyball players are tall” FOPL:X (volleyball_player (X)  tall (X)) Normal: Some people like durian. FOPL:X (person(X)  likes(X, durian)) Normal: Nobody likes wars FOPL: X likes (X, wars)

  25. The Truth Table

  26. The Example of Logical Operation Consider P and Q as a propositional statement. Show the result when (P ^ (P  Q))  Q

  27. Implementing Propositional Logic • “IF the battery is dead THEN the car won’t start” • P = battery is dead & Q = car won’t start • Battery is dead = T, car won’t start = T • “Battery not dead” = F, “car will start” = F • Equivalence to P  Q

  28. Code Output The Example of PROLOG Language • My name is Ahmad bin Abdullah. My father is Abdullah bin Abdul Karim. ?- grandfather(X,Y). X = abdul_karim , Y = ahmad ; ?- father(X,Y). X = abdullah , Y = ahmad ; X = abdul_karim , Y = abdullah son(ahmad,abdullah). son(abdullah,abdul_karim). grandfather(X,Y):- fahter(X, Somebody), fahter(Somebody, Y). father(X,Y):- son(Y,X).

  29. The Application from PROLOG Language Congkak! Games: Reversi Travelling Salesman Analysis

  30. الشكل التالي يعبر عن شبكة دلالية لعلاقة أسرية. يمكننا من خلال هذا الشكل أن نعبر عن هذه العلاقات قي صورتين:1.جمل وفق المنطق الرياضي 2. أطر جدوليه Mammals Subset-of legs 2 Person HasMother Subset of Female Person Male Person Subset-of Member of Member of Sister of Mariam Ahmad legs 1

  31. الشكل التالي يعبر عن شبكة دلالية لعلاقة أسرية. يمكننا من خلال هذا الشكل أن نعبر عن هذه العلاقات قي صورتين:1.جمل وفق المنطق الرياضي 2. أطر جدولية • Sister_of(Mariam,Ahmed) • Legs(Ahmed)=1 • Member_of(Mariam,Female_Person) حالة استثنائية: أحمد له رجلا واحدة بينما لكل البشر رجلان

More Related