Basics of Cognitive Computing
Basics of Cognitive Computing
1
Syllabus
4
Cognitive computing
• Cognition is a word that dates back to the 15th century, when it meant "thinking and
awareness“
• The study of cognitive processes involved in the acquisition, representation and use of
human knowledge.
• The scientific study of the mind, the brain, and intelligent behaviour, whether in humans,
animals, machines or the abstract.
CognitiveSkills
• What cognitive skills are required to answer a telephone call?
• Answer
❑perception (hearing the ring tone),
❑decision taking (answering or not),
❑motor skill (lifting the receiver),
❑language skills (talking and understanding language),
❑social skills (interpreting tone of voice and interacting properly
with another human being)
Knowledge, Experience & Creativity
Source: LinkedIn
Knowledge, Experience & Creativity (contd)
Source: LinkedIn
Knowledge, Experience & Creativity (contd)
Source: LinkedIn
16
Cognitive Computing
• Cognitive Science – it is study of mind and intelligence
• Cognitive computing is simulation of human thought process in a computerised model.
• Understands Natural language and human communication style, generates and evaluates
evidence based hypothesis, adopts and learns from training and interactions.
• Cognitive Computing refers to the new hardware and / or software that mimics the
functioning of human brain, and helps to improve human decision making.
• Cognitive Computing – Cognitive Science + Computer Science
• Cognitive science—The science of the mind.
•
Computer science—The scientific and practical approach to computation and its
applications. It is the systematic technique for translating this theory into practice.
• https://www.youtube.com/watch?v=1tsFTBqXDdI
• https://www.youtube.com/watch?v=K6eZtvNUDsk
Cognitive science
• Perception
Evaluate Interpret
Decide
-Analysis
-Model Building
-Knowledge representation
-HCI (Interaction)
Intellectual functions
Cognitive science Cognitive computing
• Domains where a single query or set of data may result in hypothesis that
yields more than one answers
eg. Medical diagnosis
32
Analytics (contd)
33
Ontology, Taxonomy.
34
Ontology, Taxonomy (contd)
35
Tools
36
• Data Visualization →
• Last but not least, outcomes and
results need to be
represented visually to help make
sense of recommendations/ findings.
37
• On top of it all, the Cognitive system must leverage all these
underlying facilities to enable the creation of applications that
address business problems in vertical domains.
• These apps may need to infuse [fill / soak ] processes to gain insight
about a complex business (ex: healthcare, logistics, preventive
maintenance, etc).
38
Iterative Process
39
Components of a Cognitive System
• Model refers to the corpus and the set of assumptions and algorithms that
generate and score hypotheses to answer questions, solve problems, or discover
new insights.
• Model determines what kind of predictions that can make, patterns and
anomalies that can detect, and actions that can take.
• Cognitive system will update the model and use the model to answer questions
or provide insights.
• The corpus is the body of knowledge that machine learning algorithms use to
continuously update that model based on its experience, which may include user
feedback
40
Steps in Cognitive System Design-
1) It requires an understanding of the available data,
2) The types of questions that need to be asked,
3) The creation of a corpus comprehensive enough to support the
generation of hypotheses about the domain based on observed facts.
41
The design of a cognitive system needs to support the following
differentiating characteristics:
The system continuously updates the model based on user interactions and
new data.
https://www.youtube.com/watch?v=K6eZtvNUDsk
43
Two Systems of Judgement and Choice
• Complicated to translate the complexity of human thought and actions into systems.
• It is often influenced by emotion, instinct, habits, and subconscious assumptions about the
world.
• Cognition is a foundational approach that leverages not just how we think, but also
how we act and how we make decisions.
• E.g one doctor recommend one treatment whereas another doctor recommends a
completely different approach to the same disease
• To understand how to apply cognition to computer science, it is helpful to understand
Kahneman’s
theory about how we think.
• System 1—Automatic Thinking: Intuition and Biases
• https://www.youtube.com/watch?v=Ta9KSN7hhog
46
System 2(Slow): Controlled, Rule Centric,
Concentrated Effort
Observes and tests assumption
Do not come directly to conclusion
It uses simulation to take an assumption and look at the
implications of that assumption
Collect a lot of data and build model that tests System 1 intuition
Eg. Drug trial – cancer treatment, Covid 19 treatment -
Hydroxychloroquine
Adv – System 2 is more accurate as it is based on deep thinking
and analysis approach
Disadv – Slow
47
48
Types of Intelligence
• Linguistic – narrators, orators
• Musical – musicians, composers, singers
• Logical / mathematical – mathematicians, scientists
• Spatial – map readers, astronauts
• Interpersonal – mass communicators, interviewers
61
Artificial Intelligence
53
What is intelligence?
❖ Linguistic intelligence
❖ Problem solving
❖ Perception
❖ Learning
❖ Reasoning
54
Which tasks are easy for human / machine?
56
Is this statement true?
• https://www.youtube.com/watch?v=Zsl7ttA9Kcg
57
Foundations of AI
1. Philosophy
1. How does mind arise from a physical brain?
2. Where does knowledge come from and how does it lead to action?
3. Goal based analysis
2. Mathematics
1. Formal rules to draw valid conclusions
2. How do we reason with uncertain information?
3. NP-Completeness
3. Economics
1. Making decisions to maximize payoff
2. Dealing with adversaries
3. Game theory, preferred outcome – utility
4. Neuroscience
1. Study of nervous system and brain
2. Collection of neurons lead to thought, action, consciousness
55
Foundations of AI (continued…)
5. Psychology
1. How do humans and animals think and act?
2. Cognitive Science
6. Computer Engineering
1. Building efficient computers – speed, OS, programming languages, tools,
storage
7. Control theory
1. Maximize objective function over time, self-control
8. Linguistics
1. How does language relate to thought? (Verbal Behavior)
2. NLP
56
Applications of Cognitive Systems
62
Pepper Robot
63
Daksha – developed by DRDO
64
Nao Robot
https://www.youtube.com/watch?v=2STTNYNF4lk
61
Expert System
• Emulates decision making ability of human expert
• Uses reasoning and if-then rules along with knowledge base to solve problems
• Capable of advising, instructing, assisting, diagnosing, predicting, interpreting,
justifying
• Incapable of refining its own knowledge
• Environment
• Workstations, Mainframes
• Programming languages – LISP, PROLOG (IBM Watson uses Prolog)
• Use cases – Clinical expert system, Space Shuttle Mission Control
66
Architecture of Expert System
• Knowledge based architecture
• Components
• Knowledge base
• Inference engine
• User Interface
• Knowledge base
➢domain specific, accurate, precise
knowledge
➢data, information, past experience
➢factual or heuristic
• Knowledge representation – rules
• Inference engine – applies rules to the facts,
resolves rule conflicts
• Forward chaining, Backward chaining –
strategies to recommend a solution
• User interface – interaction between user
and ES, using NLP
67
Forward chaining vs Backward chaining
68
Benefits & limitations of Expert System
❑ Benefits
• Availability
• Less production cost
• Speed
• Less error rate
• Steady response as compared to humans
❑ Limitations
• They can’t substitute human decision makers
• Their accuracy depends on adequate knowledge base
• They can’t refine their own knowledge
69
Machine Learning
66
Machine Learning
• Machine learning algorithms aim to learn a set of tasks T, based on experience E, to
achieve the performance criterion P.
• Performance is measured in terms of accuracy (and sometimes speed) of the
learning model.
• Design of ML system involves four components:
-training experience
-target function to be learned
-representation of target function
-algorithm for learning the target function from training examples
• The process of learning is “searching through the space of possible hypotheses to
find the hypothesis that best fits the available training experience / examples.
71
Machine Learning
72
Supervised vs. Unsupervised Learning
73
Supervised Learning
74
Unsupervised Learning
75
Semi-supervised learning
• The basic procedure involved is that first, the programmer will cluster
similar data using an unsupervised learning algorithm and then use the
existing labeled data to label the rest of the unlabeled data.
• The typical use cases of such type of algorithm have a common property
among them – The acquisition of unlabeled data is relatively cheap while
labeling the said data is very expensive.
76
ML Model building based on statistical model building process
Dataset
Training data
Testing data
2/3 rd
1/3 rd
78
Process (1): Model Construction
Classification
Algorithms
Training
Data
Classifier
NAME RANK YEARS TENURED
(Model)
Mike Assistant Prof 3 no
Mary Assistant Prof 7 yes
Bill Professor 2 yes
Jim Associate Prof 7 yes
Dave Assistant Prof 6 no RULE ??
Anne Associate Prof 3 no
79
Process (1): Model Construction
Classification
Algorithms
Training
Data
Classifier
NAME RANK YEARS TENURED
(Model)
Mike Assistant Prof 3 no
Mary Assistant Prof 7 yes
Bill Professor 2 yes
Jim Associate Prof 7 yes
IF rank = ‘professor’
Dave Assistant Prof 6 no OR years > 6
Anne Associate Prof 3 no THEN tenured = ‘yes’
80
Process (2): Using the Model in Prediction
Classifier
Testing
Data Unseen Data
(Jeff, Professor, 4)
81
Classification Techniques
85
Decision Tree
Outlook
Sunny Overcast
Overcast Rain
Humidity Ye Wind
s
Yes No Yes
N
o
87
Reinforcement Learning
• Ex. Think of it like training a dog, good behaviors are rewarded with a treat
and become more common. Bad behaviors are punished and become less
common.
91
Performance of Model
• Generalization error [generalization error (also known as the out-of-sample error or the
risk) is a measure of how accurately an algorithm is able to predict outcome values for
previously unseen data.]
• Underfitting – Learned model is too general and fails to find interesting patterns
– result of not including all important attributes. [performs poorly on training data]
• Overfitting – Learned model is too specific or too sensitive to training data – result of
including too many predictors. [performs well on training data, but not on evaluation
set]
92
Factors for success of ML model
• Nature of dataset
• Number of records / tuples for training
• Number of features
• Feature extraction
• Feature reduction
130
Data Visualization
85
86
Data Visualization
• Clarity Ensure the dataset is complete and relevant. This enables the Data
Scientist to use the new patterns obtained from the data in the relevant
places
• Accuracy Ensure you use appropriate graphical representation to convey
the intended message
• Efficiency Use efficient visualization techniques that highlight all the data
points
91
Types of Data Visualization
1. Tables: This consists of rows and columns used to compare variables. Tables can show a
great deal of information in a structured way, but they can also overwhelm users that are
simply looking for high-level trends.
2. Pie charts and stacked bar charts: These graphs are divided into sections that represent
parts of a whole. They provide a simple way to organize data and compare the size of each
component to one other.
3. Line charts and area charts: These visuals show change in one or more quantities by
plotting a series of data points over time and are frequently used within predictive
analytics. Line graphs utilize lines to demonstrate these changes while area charts connect
data points with line segments, stacking variables on top of one another and using color to
distinguish between variables.
Area Chart
92
93
Types of Data Visualization (contd)
4. Histograms: This graph plots a distribution of numbers using a bar chart (with no spaces
between the bars), representing the quantity of data that falls within a particular range. This
visual makes it easy for an end user to identify outliers within a given dataset.
5. Scatter plots: These visuals are beneficial in reveling the relationship between two
variables, and they are commonly used within regression data analysis. However, these can
sometimes be confused with bubble charts, which are used to visualize three variables via the
x-axis, the y-axis, and the size of the bubble.
6. Heat maps: These graphical representation displays are helpful in visualizing behavioral
data by location. This can be a location on a map, or even a webpage.
7. Tree maps, which display hierarchical data as a set of nested shapes, typically rectangles.
Treemaps are great for comparing the proportions between categories via their area size.
94
95
96
97
Summary
98
99
100
• Think about who your visualization is designed for and then make sure
your data visualization fits their needs.
• What is that person trying to accomplish?
• What kind of questions do they care about?
• Does your visualization address their concerns?
• You’ll want the data that you provide to motivate people to act within
their scope of their role.
• If you’re unsure if the visualization is clear, present it to one or two
people within your target audience to get feedback, allowing you to make
additional edits prior to a large presentation.
102
Data Visualization best practices (contd)
For example,
• Do you need data labels on every bar in your bar chart? Perhaps you only
need one or two to help illustrate your point.
• Do you need a variety of colors to communicate your idea?
• Are you using colors that are accessible to a wide range of audiences (e.g.
accounting for color blind audiences)?
104
What is corpus ?
10
7
1. Corpus Representativeness
According to Leech (1991),
“A corpus is thought to be representative of the language variety it is
supposed to represent if the findings based on its contents can be
generalized to the said language variety”.
10
8
Corpus Representativeness (contd)
• We do not have any reliable scientific measure for balance but the
best estimation and intuition works in this concern.
11
4
3. Sources of Corpus
• LP libraries (NLTK, Gensim, spaCy, etc.) come with their own
corpora, though you generally have to download them separately.
12
1
Hypothesis Testing
• Hypothesis testing or significance testing is a method for
testing a claim or hypothesis about a parameter in a
population, using data measured in a sample.
12
3
• Normal distribution of data ( mean vs Standard Deviation)
4 step process for Hypothesis Generation and Testing
12
9
• A p-value is the probability of obtaining a sample outcome, given
that the value stated in the null hypothesis is true. The p-value for
obtaining a sample outcome is compared to the level of significance.
• When the p-value is less than 5% (p < .05), we reject the null
hypothesis. Thus p < .05 can be considered as the criterion for
deciding to reject the null hypothesis, although note that when p =
.05, the decision is also to reject the null hypothesis.
• When the p value is greater than 5% (p > .05), we retain the null
hypothesis.
• The decision to reject or retain the null hypothesis is called
significance
13
1
What is a Test Statistic
• We use the value of the test statistic to make a decision about the
null hypothesis.
• The decision is based on the probability of obtaining a sample
mean, given that the value stated in the null hypothesis is true
Make a decision (contd)
https://www.ibm.com/in-en/topics/data-visualization
Unit 1 ends