Artificial Intelligence Knowledge Representation PDF
Document Details
Uploaded by UnwaveringDetroit6581
DIT University
Tags
Summary
These lecture notes cover knowledge representation in artificial intelligence (AI). They detail data, information, and knowledge, along with various approaches to representing this knowledge in AI systems, including relational, semantic, and inferential methods.
Full Transcript
ARTIFICIAL INTELLIGENCE (CSF304) UNIT-3 Knowledge Representation Knowledge representation in AI DATA Raw numbers, letters, symbols, sounds or images with no meaning. INFORMATION Information is the set of data that has already been processed, analyzed, and structured in a meaning...
ARTIFICIAL INTELLIGENCE (CSF304) UNIT-3 Knowledge Representation Knowledge representation in AI DATA Raw numbers, letters, symbols, sounds or images with no meaning. INFORMATION Information is the set of data that has already been processed, analyzed, and structured in a meaningful way to become useful. KNOWLEDGE Knowledge means the familiarity and awareness of a person, place, events, ideas, issues, ways of doing things or anything else, which is gathered through learning, perceiving or discovering. EXAMPLE Think of data as any series of random numbers and words that hold no meaning whatsoever. For example: 4a 61 6e 65 20 44 6f 65 2c 0a 34 20 53 74 72 65 65 74 2c 0a 44 61 6c 6c 61 73 2c 20 54 58 20 39 38 31 37 34 0a Once the aforementioned data is processed, interpreted, formatted, and organized, you can see that it is the contact information of Jane Doe: Jane Doe, 4 Street, Dallas, TX 98174 DATA: It is raining. INFORMATION: The temperature dropped 15 degrees and then it started raining. KNOWLEDGE: If the humidity is very high and the temperature drops substantially the atmospheres is often unlikely to be able to hold the moisture so it rains. Knowledge representation and reasoning is the part of AI which is concerned with AI agents thinking and how thinking contributes to intelligent behavior of agents. It is responsible for representing information about the real world so that a computer can understand and can utilize this knowledge to solve the complex real world problems such as diagnosing a medical condition or communicating with humans in natural language. Knowledge representation is not just storing data into some database, but it also enables an intelligent machine to learn from that knowledge and experiences so that it can behave intelligently like a human. In AI systems, knowledge can be represented in terms of: Events: Anything which happens in real time are considered as the events Objects: All the facts about objects in real world domain Facts: Truth about real world Performance: Describes how good the knowledge is acquired and it can be applied to machines Meta-knowledge: Knowledge which has already been acquired either by human brain or machine Knowledge-base: Central component of an AI agent Three factors which are put into the machine, which makes it valuable: Knowledge: The information related to the environment is stored in the machine. Reasoning: The ability of the machine to understand the stored knowledge. Intelligence: The ability of the machine to make decisions on the basis of the stored information. How knowledge and intelligence are related Knowledge of real-world plays a vital role in intelligence and same for creating artificial intelligence. Knowledge plays an important role in demonstrating intelligent behavior in AI agents. An agent is only able to accurately act on some input when he has some knowledge or experience about that input. AI knowledge cycle AI system has Perception component by which it retrieves information from its environment. It can be visual, audio or another form of sensory input. The learning component is responsible for learning from data captured by Perception component. In the complete cycle, the main components are knowledge representation and Reasoning. These two components are involved in showing the intelligence in machines. These two components are independent with each other but also coupled together. The planning and execution depend on analysis of Knowledge representation and reasoning. In this component, the optimal solution of the current state is found and impact of the same is analyzed. Types of knowledge Declarative Knowledge: Refers to facts and information that describe the world. e.g. Knowing that Paris is the capital of France. This knowledge is stored in databases and expressed in logical statements Procedural knowledge: Knowing how to do something. Includes rules, strategies and can be applied to a real world task. e.g. Steps to solve a mathematical problem or the procedure to start a car. This knowledge is embedded in algorithms Meta-knowledge: Knowing about pre-defined knowledge. Understanding which types of knowledge to apply in different situations. e.g. Knowing when to use a specific algorithm based on the problem at hand. Heuristic knowledge: Includes rules of thumb, educated guesses, and intuitive judgments derived from experience. e.g. Using an educated guess to approximate a solution when time is limited. This is used in problem solving and decision making Structural knowledge: Understanding of how different pieces of knowledge are organized and related to each other. e.g. Understanding the hierarchy of concepts in a taxonomy or the relationships between different entities in a semantic network. Approaches to knowledge representation 1) Simple relational knowledge Simplest way of storing facts which uses the relational method, and each fact about a set of the object is set out systematically in columns. Famous in database systems where the relationship between different entities is represented. 2) Inheritable knowledge All data must be stored into a hierarchy of classes and all classes must be arranged in a hierarchical manner. Shows a relation between instance and class, and it is called instance relation. objects and values are represented in Boxed nodes. We use Arrows which point from objects to their values. 3) Inferential knowledge Knowledge represented in form of formal logics E.g. Marcus is a man. All men are mortal man (Marcus) x = man (x) ----------> mortal (x)s 4) Procedural knowledge Uses small programs and codes to describe how to do specific things If-then rules are used Knowledge representation techniques Logical representation Drawing a conclusion based on various conditions. Involves using formal logic systems like propositional and predicate logic to represent knowledge in a structured, precise, and unambiguous way. It consists of precisely defined syntax and semantics which supports the sound inference. Each sentence can be translated into logics using syntax and semantics. Syntax: Rules that decide how sentences are formed, which symbols can be used for knowledge representation. Semantics: Rules by which sentence can be interpreted in the logic. Propositional logic: Statements are made by propositions i.e. in terms of declarative statements which are true or false Predicate logic/First-order logic: Represents natural language statements in a concise way. Gives information about an object and also expresses relationship between objects. This technique is used to represent the objects in the form of predicates or quantifiers. Example of propositional logic The Sun sets in the West (True proposition) 3+3= 7(False proposition) Atomic proposition: It consists of a single proposition symbol. These are the sentences which must be either true or false. 2+2 is 4, it is an atomic proposition as it is a true fact. Compound proposition: Constructed by combining atomic propositions, using parenthesis and logical connectives. Ankit is a doctor, and his clinic is in Mumbai Example of first-order logic First-order logic develops information about the objects in a more easy way and can also express the relationship between those objects. Ravi and Ajay are brothers X is an integer All men drink coffee Some boys are gymnasts All birds fly Semantic network representation Used to represent knowledge in the form of graphical networks. This network consists of nodes representing objects and arcs which describe the relationship between those objects. Semantic networks can categorize the object in different forms and can also link those objects. Semantic networks are easy to understand and can be easily extended. 1. Jerry is a cat 2. Jerry is a mammal 3. Jerry is owned by Priya 4. Jerry is white colored 5. All Mammals are animal 1. Ram has a cycle 2. Ram is a boy 3. Cycle has a bell 4. Ram is 12 years old 5. Cycle has two paddles Frames representation A frame is a collection of attributes and its associated values which describe an entity in the real world. It consists of a collection of slots and slot values. These slots may be of any type and sizes. Slots have names and values which are called facets. Facets are features of frames which enable us to put constraints on the frames. Production rules if-then statements are used to express knowledge in the form of conditions and corresponding actions. Three main parts: The set of production rules Working memory The recognize-act-cycle In production rules agent checks for the condition and if the condition exists then production rule fires and corresponding action is carried out. The condition part of the rule determines which rule may be applied to a problem. And the action part carries out the associated problem-solving steps. This complete process is called a recognize-act cycle. The working memory contains the description of the current state of problems-solving and rule can write knowledge to the working memory. This knowledge match and may fire other rules. If there is a new situation (state) generates, then multiple production rules will be fired together, this is called conflict set. In this situation, the agent needs to select a rule from these sets, and it is called a conflict resolution. Example: IF (at bus stop AND bus arrives) THEN action (get into the bus) IF (on the bus AND paid AND empty seat) THEN action (sit down). IF (on bus AND unpaid) THEN action (pay charges). IF (bus arrives at destination) THEN action (get down from the bus). Propositional Logic Simplest form of logic where all the statements are made by propositions. A proposition is a declarative statement which is either true or false. It is a technique of knowledge representation in logical and mathematical form. It is also called Boolean logic as it works on 0 and 1. In propositional logic, we use symbolic variables to represent the logic, and we can use any symbol for representing a proposition, such A, B, C, P, Q, R, etc. Propositions can be either true or false, but it cannot be both. It consists of an object, relations or function, and logical connectives. The propositions and connectives are the basic elements of the propositional logic. There are two types of Propositions: Atomic Propositions and Compound propositions Atomic Proposition: Atomic propositions are the simple propositions. It consists of a single proposition symbol. These are the sentences which must be either true or false. Example: a) 2+2 is 4, it is an atomic proposition as it is a true fact. b) "The Sun is cold" is also a proposition as it is a false fact. Compound proposition: Compound propositions are constructed by combining simpler or atomic propositions, using parenthesis and logical connectives. Example: a) "It is raining today, and street is wet." b) “Rohan is a doctor, and his clinic is in Mumbai." Logical Connectives Used to connect two simpler propositions or representing a sentence logically. We can create compound propositions with the help of logical connectives 1) Negation: A sentence such as ¬ P is called negation of P. A literal can be either Positive literal or negative literal 2) Conjunction: A sentence which has connective such as, P Q is called a conjunction. Example: Rohan is intelligent and hardworking. It can be written as, P= Rohan is intelligent, Q= Rohan is hardworking. → P Q. 3) Disjunction: A sentence which has ˅ connective such as, P ˅ Q is called a disjunction. Example: "Ritika is a doctor or Engineer", P= Ritika is Doctor. Q= Ritika is Engineer, so we can write it as P Q. 4) Implication: A sentence such as P → Q, is called an implication. Implications are also known as if-then rules. It can be represented as If it is raining, then the street is wet. Let P= It is raining, and Q= Street is wet, so it is represented as P → Q 5) Biconditional: A sentence such as P Q is a Biconditional sentence, example If I am breathing, then I am alive P= I am breathing, Q= I am alive, it can be represented as P Q. Truth Tables Truth Tables Truth Tables Precedence of connectives Properties of operators Commutativity: P Q= Q P, P Q = Q P. Associativity: (P Q) R= P (Q R), (P Q) R= P (Q R) Identity element: P True = P, P True= True. Distributive: P (Q R) = (P Q) (P R). P (Q R) = (P Q) (P R). DE Morgan's Law: ¬ (P Q) = (¬P) (¬Q) ¬ (P Q) = (¬ P) (¬Q). Double-negation elimination: ¬ (¬P) = P. First order logic First-order logic is another way of knowledge representation in artificial intelligence. It is an extension to propositional logic. It is sufficiently expressive to represent the natural language statements in a concise way. It is also known as Predicate logic or First-order predicate logic. It is a powerful language that develops information about the objects in a more easy way and can also express the relationship between those objects. Does not only assume that the world contains facts like propositional logic but also assumes the following things in the world: Objects: A, B, people, numbers, colors, wars, theories, squares, pits Relations: It can be unary relation such as: red, round, is adjacent, n-any relation such as: the sister of, brother of, has color, comes between It also has two parts: Syntax and Semantics Atomic Sentences: Formed from a predicate symbol followed by parenthesis and sequence of terms Predicate(Term1, Term2, …, TermN) E.g. Ravi and Ajay are brothers can be represented as: Brothers (Ravi, Ajay) Complex Sentences: Formed by combining atomic sentences using connectives Quantifiers in FOL A language element which generates quantification, and quantification specifies the quantity of specimen in the universe of discourse. Universal quantifier: for all, everyone, everything Existential quantifier: for some, at least one Universal quantifier: Specifies that a statement within its range is true for every instance of that thing e.g. x man(x) → drink (x, coffee). There are all x where x is a man who drinks coffee Existential quantifier: Specifies that a statement within its range is true for at least one instance of something. e.g. x: boys(x) intelligent(x) There are some x where x is a boy who is intelligent Some more example: All birds fly x bird(x) →fly(x). Some boys play cricket x: boys(x) → play(x, cricket).