0% found this document useful (0 votes)
37 views79 pages

6 AI Applications - Expert System and NLP

The document covers AI applications, focusing on expert systems and natural language processing (NLP). It details the components, features, and considerations for building expert systems, as well as the stages and terminology of NLP. Additionally, it highlights the advantages and disadvantages of expert systems and provides examples of AI applications in healthcare.

Uploaded by

siddhiwade12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views79 pages

6 AI Applications - Expert System and NLP

The document covers AI applications, focusing on expert systems and natural language processing (NLP). It details the components, features, and considerations for building expert systems, as well as the stages and terminology of NLP. Additionally, it highlights the advantages and disadvantages of expert systems and provides examples of AI applications in healthcare.

Uploaded by

siddhiwade12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 79

Vidyavardhini’s College of Engineering & Technology

Department of Computer Engineering

AI Applications

Module 6. AI Applications
TE/COMP/VI/CSC604

By Prof. Anil Hingmire

1
Contents:
Areas of AI
Expert System
Natural Language Processing
Healthcare, Retail,
Robotics
Areas of Artificial Intelligence
Expert System- Outline
Definition
Examples
Components and Human Interfaces
Major Components
Major Roles of Individuals
Notes on Components
Expert System Features
Goal-Driven Reasoning
Uncertainty
Data Driven Reasoning
Explanations
Considerations for Building Expert Systems
Languages, Shell and Tools
Early Expert Systems
Advantages and Disadvantages
Definition of Expert System
Knowledge-based expert systems

Use human knowledge to solve problems that


normally would require human intelligence

Specific problem domain

Embody some non-algorithmic expertise

Represent the expertise knowledge as data or rules


within the computer
Can be called upon when needed to solve problems
Definition
Developed via specialized software tools called shells

Shells come equipped with an inference mechanism


Backward chaining
Forward chaining
Both

May or may not have learning components

Testing: Same real world problem solving situation

Key idea: problem solved by applying specific knowledge


rather than specific technique
Examples
Diagnostic applications, servicing:
People
Machinery
Healthcare
Play chess
Make financial planning decisions
Configure computers
Monitor real time systems
Underwrite insurance policies

Perform many other services which previously required


human expertise
Broad Classes of Expert System
Comparison: conventional & expert systems
Conventional System Expert System
Information and processing are Knowledge base is separated
combined in one program from processing mechanism
May make mistakes Does not make mistakes
Changes are tedious Changes are easy
System operates only when System operates can operate
completed even few rules
Data processing is a repetitive Knowledge engineering is
process inferential process
Algorithmic Heuristic
Representation and use of data Representation and use of
knowledge
Components and Human Interfaces
Major Components
Knowledge base - a
declarative representation of
the expertise, often in IF THEN
rules
Working storage - the data
which is specific to a problem
being solved
Inference engine - the code
at the core of the system
Derives recommendations from
the knowledge base and
problem-specific data in working
storage
User interface - the code that
controls the dialog between the
user and the system
Major Roles of Individuals

Domain expert – currently experts


solving the problems the system is
intended to solve
Knowledge engineer - encodes the
expert's knowledge in a declarative
form that can be used by the expert
system
User - will be consulting with the
system to get advice which would have
been provided by the expert
Systems built with custom developed
shells for particular applications:
System engineer - the individual
who builds the user interface, designs
the declarative format of the
knowledge base, and implements the
inference engine
Major Roles of Individuals
The process of building an
expert system:
The knowledge engineer
establishes a dialog with the
human expert to elicit
(obtain) knowledge.
The knowledge engineer
codes the knowledge
explicitly in the knowledge
base.
The expert evaluates the
expert system and gives a
critic to the knowledge
engineer.
Knowledge Representation
Knowledge can be represented in various forms as:
i. Rules
ii. Semantic Nets
iii. Frames
iv. Scripts
v. Object Oriented
vi. Others- KL-1, KRYPTON, Conceptual Graph and
so on
Notes on Components
Shell - a piece of software which contains:
The user interface
A format for declarative knowledge in the knowledge base
An inference engine

Major advantage of a customized shell: the format of the


knowledge base can be designed to facilitate the
knowledge engineering process

Knowledge engineer and the system engineer might be


the same person
Depending on the size of the project
Notes on Components

One of the major bottlenecks - knowledge engineering


process:
The coding of the expertise into the declarative rule
format can be a difficult and tedious task
The semantic gap between the expert's representation
of the knowledge and the representation in the
knowledge base should be minimized
Expert System Features
Goal driven reasoning or backward chaining - an
inference technique which uses IF THEN rules to repetitively
break a goal into smaller sub-goals which are easier to prove
Coping with uncertainty - the ability of the system to
reason with rules and data which are not precisely known
Data driven reasoning or forward chaining - an
inference technique which uses IF THEN rules to deduce a
problem solution from initial data
Data representation - the way in which the problem
specific data in the system is stored and accessed
User interface - that portion of the code which creates an
easy to use system
Explanations - the ability of the system to explain the
reasoning process that it used to reach a recommendation.
Features: Goal-Driven Reasoning
Aim: to pick the best choice from many enumerated
possibilities
The knowledge is structured in rules
The rule breaks the problem into sub-problems
Difference between forward and backward chaining:
Features: Goal-Driven Reasoning
Example - This rules identifies birds:
IF
family is albatross and
color is white
THEN
bird is Laysan albatross
IF
family is albatross and
color is dark
THEN
bird is black footed albatross
The following rule is one that satisfies the family sub-goal:
IF
order is tubenose and
size large and
wings long narrow
THEN
family is albatross
Features: Uncertainty
Final answer is not known with complete certainty
The expert's rules might be vague
The user might be unsure of answers to
questions
Both human experts and expert systems must be
able to deal with uncertainty.
Example - medical diagnostic system: multiple
possible diagnoses
Features: Uncertainty

It is easier to program expert systems with shallow


knowledge than with deep knowledge.
Shallow knowledge – based on empirical (experimental
and heuristic knowledge.)
Deep knowledge – based on basic structure, function,
and behavior of objects.
One of the simplest schemes: to associate a numeric
value with each piece of information
Features: Data Driven Reasoning
Problem of enumerating all of the possible answers
before hand
Example - configuration problems
Keeps track of the current state, looks for rules
moving the state closer to a final solution
Note:
Data driven system: the system must be initially
populated with data
Goal driven system: gathers data as it needs it
Features: Data Driven Reasoning
Example - A system to layout living room furniture
(unplaced pieces of furniture):

IF
unplaced tv and
couch on wall(X) and
wall(Y) opposite wall(X)

THEN
place tv on wall(Y).
Features: Explanations
Ability to explain themselves
System knows which rules were used during the
inference process
Can be very dramatic: dark colored and an albatross =>
the bird was a black footed albatross
At other times, relatively useless to the user
Example - car diagnostic system: no rules
Structure of a Rule-Based Expert System

26
Considerations for Building Expert Systems

Can the problem be solved effectively by conventional


programming?
Is there a need and a desire for an expert system?
Is there at least one human expert who is willing to
cooperate?
Can the expert explain the knowledge to the knowledge
engineer can understand it.
Is the problem-solving knowledge mainly heuristic and
uncertain?
Languages, Shells, and Tools
Procedural languages (e.g., C) focus on techniques to
represent data.
More modern languages (e.g., Java) focus on data
abstraction.
Expert system languages (e.g. CLIPS) focus on ways
to represent knowledge.
Languages, Shells, and Tools
CLIPS :C Language Integrated Production System
It was designed at NASA/Johnson Space Center
a tool for Building Expert Systems
a multi-paradigm programming language
provides support for rule-based object-oriented,
and procedural programming.
Early Expert Systems
DENDRAL – used in chemical mass spectroscopy
to identify chemical constituents
MYCIN – medical diagnosis of illness
DIPMETER – geological data analysis for oil
PROSPECTOR – geological data analysis for
minerals
XCON/R1 – configuring computer systems
Advantages of ES

Advantages:
Increased availability
Reduced cost
Reduced danger
Performance
Multiple expertise
Increased reliability
Advantages of ES

Advantages:
Explanation
Fast response
Steady, unemotional, and complete responses at all
times
Intelligent database
Disadvantages

Disadvantages:
Lacks common sense
Cannot make creative responses as human expert
Domain experts not always able to explain their
logic and reasoning
Errors may occur in the knowledge base
Cannot adapt to changing environments
AI in Healthcare
1. Diagnosis and disease prediction
Ex. IBM Watson Genomics – uses genome based
sequencing for prediction of cancer tumor
2. Health record improvement
Ex. ML based OCR recognition techniques
3. The prediction of diabetics
Ex. Classification alg. Like KNN, Decision Tree, Naïve
Bayes
4. Finding the best cure
Ex. Microsoft’s Project Hanover:- finds personalized
drug combination to cure Myeloid Leukemia
Activity: Think-Pair Share
Think Individually: Expert System! When you
hear this word. What comes in your mind, write
them in your notebook (2m)

Pair With your neighbours and explain what you


wrote to your neighbour.
Together write down What is Expert System and
list Real word Expert systems where you have
used/observed. (5m)

Share to the Class (5m)


Thank You…….
Any ?s
Natural Language Processing
Vidyavardhini’s College of Engineering & Technology
Department of Computer Engineering

AI Applications

Module 6. AI Applications
TE/COMP/VI/CSC604

By Prof. Anil Hingmire

38
Contents:
Areas of AI
Expert System
Natural Language Processing
Healthcare, Retail,
Robotics
Areas of Artificial Intelligence
Introduction to NLP

A language can be defined as a set of rules or


set of symbol.
Symbol are combined and used for conveying
information or broadcasting the information.
Communication Typical communication episode
S (speaker) wants to convey P (proposition) to H (hearer) using W
(words in a formal or natural language)
1. Speaker 2. Hearer
Intention: S wants H to Perception: H perceives
believe P words W” (ideally W” =
Generation: S chooses W)
words W Analysis: H infers possible
Synthesis: S utters words meanings P1,P2,…,Pn for
W W”
Disambiguation: H infers
that S intended to convey
Pi (ideally Pi=P)
Incorporation: H decides
to believe or disbelieve Pi
Introduction to NLP

Natural language processing (NLP) can be defined as


the automatic (or semi-automatic) processing of
human language.

Nowadays, alternative terms are often preferred, like


`Language Technology' or `Language Engineering'.
Natural Language Processing
Generic NLP System

(c) 2009 Siri, Inc.


Natural Language Processing (NLP)

1. Natural Language Understanding


● Taking some spoken/typed sentence and working
out what it means
2. Natural Language Generation
● Taking some formal representation of what you
want to say and working out a way to express it
in a natural (human) language (e.g., English)
Speech Recognition (1 of 3)

Input Analog Signal Freq. spectrogram


(microphone records voice) (e.g. Fourier transform)

Hz

time
Natural Language Understanding
Input/Output data Processing stage Other data used

Frequency spectrogram freq. of diff.


speech recognition sounds
Word sequence grammar of
“He loves Mary” syntactic analysis language
Sentence structure meanings of
semantic analysis words
He loves Mary
Partial Meaning context of
Ξx loves(x,mary) pragmatics utterance
Sentence meaning
loves(john,mary)
(c) 2009 Siri, Inc.
Knowledge in Language Processing
■ Phonetic & Phonological Knowledge
■ Morphological Knowledge
■ Syntactic Knowledge
■ Semantic Knowledge
■ Pragmatic Knowledge
■ Discourse Knowledge

(c) 2009 Siri, Inc.


Stages of NLP

(c) 2009 Siri, Inc.


(c) 2009 Siri, Inc.
Some linguistic terminology
Morphology: the structure of words. For instance,
unusually can be thought of as composed of a prex un-, a
stem usual, and an afx -ly. composed is compose plus the
inectional afx -ed: a spelling rule means we end up with
composed rather than composeed.
Syntax: the way words are used to form phrases. e.g., it
is part of English syntax that a determiner such as the will
come before a noun, and also that determiners are
obligatory with certain singular nouns.
Semantics: Compositional semantics is the construction
of meaning (generally expressed as logic) based on syntax.
Pragmatics: meaning in context.
Classical symbolic methods
Morphological analyzer
Parser (syntactic analysis)
Semantic analysis (transform into a logical form, semantic
network, etc.)
Discourse analysis
Pragmatic analysis
Morphological analysis
Goal: recognize the word and category

Using a dictionary: word + category


Input form (computed)
Morphological rules:
Lemma + ed -> Lemma + e(verb in past form)

Is Lemma in dict.? If yes, the transformation is
possible
Form -> a set of possible lemmas
Syntactic Analysis
Rules of syntax (grammar) specify the possible
organization of words in sentences and allows us to
determine sentence’s structure(s)
“John saw Mary with a telescope”
John saw (Mary with a telescope)
John (saw Mary with a telescope)
Parsing: given a sentence and a grammar
Checks that the sentence is correct according with the
grammar and if so returns a parse tree representing the
structure of the sentence
Syntactic Analysis - Grammar
sentence -> noun_phrase, verb_phrase
noun_phrase -> proper_noun
noun_phrase -> determiner, noun
verb_phrase -> verb, noun_phrase
proper_noun -> [mary]
noun -> [apple]
verb -> [ate]
determiner -> [the]
Syntactic Analysis - Parsing
sentence

noun_phrase verb_phrase

proper_noun verb noun_phrase

determiner noun

“Mary” “ate” “the” “apple”


Semantic analysis
john eats an apple. Sem. Cat (Ontology)
proper_noun v det noun object
[person: Mary] λYλX eat(X,Y) [apple]

np animated non-anim
[apple]

np vp person animal food …


[person: Mary] eat(X, [apple])

s vertebral … fruit …
eat([person: Mary], [apple])

apple …
Parsing & semantic analysis
Rules: syntactic rules or semantic rules
What component can be combined with what component?
What is the result of the combination?
Categories
Syntactic categories: Verb, Noun, …
Semantic categories: Person, Fruit, Apple, …
Analyses
Recognize the category of an element
See how different elements can be combined into a
sentence
Problem: The choice is often not unique
Write a semantic analysis grammar
S(pred(obj)) -> NP(obj) VP(pred)
VP(pred(obj)) -> Verb(pred) NP(obj)
NP(obj) -> Name(obj)
Name(John) -> John
Name(Mary) -> Mary
Verb(λyλx Loves(x,y)) -> loves
Discourse analysis
Anaphora
He hits the car with a stone. It bounces back.
Understanding a text
Who/when/where/what … are involved in an event?
How to connect the semantic representations of different
sentences?
What is the cause of an event and what is the consequence of
an action?

Pragmatic analysis

Practical usage of language: what a sentence means in


practice
Do you have time?
How do you do?
Uses context of utterance
Where, by who, to whom, why, when it was said
Intentions: inform, request, promise, criticize, …
Handling Pronouns
“Mary eats apples. She likes them.”
She=“Mary”, them=“apples”.
Handling ambiguity
Pragmatic ambiguity: “you’re late”: What’s the
speaker’s intention: informing or criticizing?
Applications of Nat. Lang. Processing

Machine Translation
Database Access
Information Retrieval
Selecting from a set of documents the ones that are
relevant to a query
Text Categorization
Sorting text into fixed topic categories
Extracting data from text
Converting unstructured text into structure data
Spoken language control systems
Spelling and grammar checkers
Applications of NLP

The following list is not complete, but useful systems have been
built for:

spelling and grammar checking


optical character recognition (OCR)
screen readers for blind and partially sighted users
machine aided translation (i.e., systems which help a
human translator)
lexicographers' tools
Applications of NLP

lexicographers' tools
information retrieval
document classification (filtering, routing)
document clustering
information extraction
question answering
summarization
text segmentation
exam marking
AI in Retail
1. Cashier-free stores
Ex. Amazon Go and Just Walk Out
2. Price predictions
Predictive analytics using Machine learning in retail industry
3. Chatbots to assist with customer service
Chabot can suggest the product based on your current
purchase or past purchase, send notification about new
collections etc.
4. Customer satisfaction tracking
detection of customer mood during shopping process.
Ex. Walmart uses facial recognition system.
Robotics
A robot is…

“An active artificial agent whose environment is the


physical world”
--Russell and Norvig

“A programmable, multifunction manipulator designed to


move material, parts, tools or specific devices through
variable programmed motions for the performance of a
variety of tasks”
--Robot Institute of America
Robotics

AI and computer vision technologies can help robots

to identify and recognize objects they encounter,


help pick out details in objects and
help with navigation and avoidance.
Relevance to Artificial Intelligence
Effectors
Sensors
Architecture
Integration of various inputs
Hierarchy of information representation
Effectors
Effector / Actuator
Degrees of freedom (d.f.)
6 d.f. for free body in space
Locomotion
Statically stable vs.
Dynamically stable
Manipulation
Rotary vs. Prismatic
motion
End Effector Four-finger Utah/MIT hand
Sensors

Force-sensing
Tactile-sensing
Sonar
Visual (camera)
Proprioceptive

Robot with camera


attached
Architecture
Behavior-based architecture

Reason about behavior of objects

Identify objects
Sensors Actuators

Build maps

Avoid objects

Design for a behavior-based mobile robot


(adapted from Fig 25.10 in AIMA)
Information Representation Hierarchy
Raw data
Cognitive
feature
Conceptual
feature
Simple
concept
Inter-connecte
d synthesized
concept
Information Representation Hierarchy
Information Representation Hierarchy
Robotics
A hardware robot is an appliance working or
implementing mechanical energy, and having different
characters, each with a specific function and together
doing a special task.

Hardware components include actuators, power


supply, different kinds of motors, sensors,
microcontrollers etc.

Three challenges focus on fundamental problems in


robotics: developing robot swarms, improving
navigation and exploration, and developing artificial
intelligence that can “learn how to learn”, and use
common sense to make moral and social decisions.
Thank You

Any Questions

You might also like