Artificial Intelligence Class 10
Artificial Intelligence Class 10
Artificial Intelligence Class 10
CLASS X
2024-2025
II
Sno CONTENTS
1 Syllabus
2 Communication Skill
3 Self-Management Skill
4 ICT Skill
5 Entrepreneurial Skill
6 Green Skill
8 AI Project Cycle
9 Natural Language Processing
10 Evaluation
11 Advance Python
12 Data Sciences
13 Computer Vision
14 Practical Programs
CBSE | DEPARTMENT
OF SKILL EDUCATION
CURRICULUM FOR
SESSION 2024-2025
____________________________________________________
_________
ARTIFICIAL INTELLIGENCE (SUB. CODE 417)
CLASS X
LEARNING OUTCOMES:
Learners will be able to
1. Identify and appreciate Artificial Intelligence and describe its applications in daily
life.
2. Relate, apply, and reflect on the Human-Machine Interactions to identify and
interact with the three domains of AI: Data, Computer Vision, and Natural
Language Processing and Undergo assessment for analyzing their progress
towards acquired AI-Readiness skills.
3. Imagine, examine, and reflect on the skills required for futuristic job opportunities.
4. Unleash their imagination towards smart homes and build an interactive story
around it.
5. Understand the impact of Artificial Intelligence on Sustainable Development
Goals to develop responsible citizenship.
6. Research and develop awareness of skills required for jobs of the future.
7. Gain awareness about AI bias and AI access and describe the
potential ethical considerations of AI.
8. Develop effective communication and collaborative work skills.
9. Get familiar and motivated towards Artificial Intelligence and Identify the AI
Project Cycle framework.
10.Learn problem scoping and ways to set goals for an AI project and understand
the iterative nature of problem scoping in the AI project cycle.
4
12.Foresee the kind of data required and the kind of analysis to be done,
identify data requirements, and find reliable sources to obtain relevant
data.
13.Use various types of graphs to visualize acquired data.
14.Understand, create, and implement the concept of Decision Trees.
15.Understand and visualize computer’s ability to identify alphabets and
handwritings.
16.Understand and appreciate the concept of Neural Network through
gamification and learn basic programming skills through gamified platforms.
17.Acquire introductory Python programming skills in a very user-friendly format.
SKILLS TO BE DEVELOPED:
SCHEME OF STUDIES:
This course is a planned sequence of instructions consisting of units meant for
developing employability and vocational competencies of students of Class IX opting
for skill subject along with other education subjects.
The unit-wise distribution of hours and marks for class IX & X is as follows:
5
DETAILED CURRICULUM/TOPICS FOR CLASS X
Part-A: EMPLOYABILITY SKILLS
Note: * marked units are to be assessed through Internal Assessment/ Student Activities.
They are not to be assessed in Theory Exams
The detailed curriculum/ topics to be covered under Part A: Employability Skills can
be downloaded from CBSE website.
Advance Python
Data Science
Computer Vision
**NOTE: Optional components shall not be assessed. They are for extra knowledge
6
UNIT 1
Communication Skill:
Communication
.
Types of Communication- :
7
1. Verbal Communication
2. Non Verbal Communication
3. Visual Communication
8
4. Written Communication
1. Verbal Communication- :
Verbal communication is the use of sounds and words to express yourself,
especially in contrast to using gestures or mannerisms (non-verbal
communication). Example-: Orally communicating.
3. Visual Communication- :
Visual communication is the transmission of information and ideas using
symbols and imagery. Types of visual communication include animated GIFs,
screenshots, videos, pie charts, infographics, and slide deck presentations. It
also includes signs, graphic designs, films, typography, and countless
other examples
4. Written Communication- :
A 'Written Communication' means the sending of messages, orders or
instructions in writing through letters, circulars, manuals, reports,
telegrams, office memos, bulletins, etc. It is a formal method of
communication and is less flexible.
Communication Cycle
for sending.
Channel: the means by which the message is sent.
Receiver: the person or entity to whom the message is sent.
Decoding: how the receiver interprets and understands the
message. Feedback: the receiver's response to the message.
9
In the communication process, one person is a sender who convey message to
another person or a group of persons) nose as the receiver. When the receiver
gets the message, he acknowledges it and sends back a response. This leads
to a cycle process known as the communication cycle. The cycle describe how
can ideas, impression, or feeling is made no to others full stopper
communication cycle includes resource such as e-mail threads social media
outlets, VoIP message outlets. In the communication process, one person is a
sender who convey message to another person (or a group of persons) nose
as the receiver. When the receiver gets the message, he acknowledges it and
sends back a response. This leads to a cycle process known as the
communication cycle.
Feedback in Communication
The term 'feedback' is taken from cybernetics, a branch of engineering
concerned with self-regulating systems.
The observation of the receiver's response is called feedback. In other words,
the part of the receiver's response communicated back to the sender is called
feedback. Actually it is the amount of response of the receiver that reaches to
the sender. It enables the sender to evaluate the effectiveness of the
message.
In the communication process, feedback refers to a response from the
receiver which gives the communicator an idea of how the message is being
received and whether it needs to be modified.
Feedback ensures that the message has been successfully conveyed and the
communication is effectively successful.
Feedback is important in communication because it enables the sender to
evaluate the effectiveness of its message. Without feedback, the
communication process would be incomplete.
10
Importance of feedback in communication-:
1. It completes the whole process of communication and makes it continuous.
2. It sustains communication process.
3. It makes one know if one is really communication or making sense.
4. It is a basis for measuring the effectiveness of communication.
5. It is a good basis for planning on what next to be done especially statistical
report.
6. Communication will be useless without feedback.
7. Feedback paves way for new idea generation.
8. It is a process of effective listening.
9. It serves as basis of problem-solving.
10. Can motivate.
11. It can improve performance.
Types of Feedback-:
Feedback can be various form and of various types. Let us discuss different
types of feedback used in communication.
feedback
Formal Feedback-:
A formal feedback follows a present format or structure using which the
receiver friends feedback and sends it. Formal feedback covers many
11
predefined points and has a specific blueprint. The receiver friends the
feedback as per this blueprint and sends it. Formal feedback takes time to
construct and hence, is not instant.
12
Examples:
“Please accept my
apologies.” Informal
Feedback-:
Informal feedback, on the other hand, is spontaneously friendly and does not
stick to a specific structure such as instant comments by the listener or
audience. It does not take time to construct as it is immediately conveyed.
Examples:
"Good job! “, “Congratulations!” “Sorry”
Examples
“All paragraphs should cover basically on Idea. Only one paragraph was as per
this specification, other paragraphs convey multiple ideas and the information
was also cohesively linked.”
“In your article, the conclusion did not reiterate your observation and did not
support the evidence your article talks about. You need to rewrite the
conclusion by keeping this thing in mind.”
Non-descriptive feedback-:
A non-descriptive feedback provides some specific information but does not
give details descriptions. The feedback conveys meaningful specific response
but does not come with descriptive analysis or suggestions.
Examples
“I only like your second paragraph. Others needs
improvement.” “In your article, conclusion needs rework”
Specific Feedback-:
The specific feedback talks about a thing, particularly without talking about a
General overview.
Example-:
“I like the way you described your grandfather's character. It makes me feel
like I too know him”.
13
“I like your portrayal of sibling rivalry, especially the part where you and your
sister were fighting. I fight with my brother too, so it made it sound real to me.
your story seemed related at all points.”
14
Non-specific Feedback-:
The Non-specific feedback, on the other hand, talks about the entire think while
giving a General overview. it does not particularly pinpoint is specific think/
feature.
Examples:
“I like your story. It is good.”
“I like it your topic of sibling rivalry.”
CHECK POINT :
A) Channel
B) Receiver
C) Sender
D) Time
Q2. You need to apply for leave at work? Which method of communication will you
use?
A) e-mail
B) Poster
C) Newsletter
D) Blog
A) Newspapers
B) Letters
C) Phone call
D) E-mail
15
B) You can surely improve your drawing
16
C) These are good drawings but you can do better.
Q5. What are the types of words we should use for verbal communication?
A) Acronyms
B) Simple
C) Technical
D) Jargons
B) Indirect
C) Specific
D) Opinion-based
17
Q9 Which of these is NOT an appropriate non-verbal communication at work?
C) Sitting straight
C) Smiling continuously
EFFECTIVE COMMUNICATION
Introduction:
Effective communication is a two way communication process where both
parties have right and convenience to express their messages opinions, facts
and other informations.
Attention:-
The receiver should be fully attentive in a communication process.
Consistency:-
This principle implies that communication should always be consistent with thE
planned objective of message being conveyed
Adequacy:-
The information conveyed should be complete in all respects.
18
Timelines:-
The message conveyed should be at the proper time.
Feedback:-
The communication must have feedback confirmation from the recipient
whether the messages have been understood by the recipient
Economy:-
The communication should take place in a way that costs optimally.
Concrete: Your arguments should be based on solid facts and opinions from
credible sources and you should share reliable data to support your stand.
Correct: It’s essential that along with the factual information, the language
and grammar you use are correct.
Coherent: Your words should make sense .Along with that it should related
with the main topic
Complete: Your message should be complete .It should have all the needed
information
Courteous: Be respectful , honest and friendly throughout your
communication
19
Part 5: Barriers in Communication
Barriers in communication
Linguistic Barrier: Language at times can be a barrier to effective
communication
Physical Barrier: If the surroundings do not support proper communication,
it can also act as a barrier to appropriate interaction.
Cultural Barrier: Cultural differences hinder us from communicating properly.
Interpersonal Barriers: It refers to the situations when the intended message
is received incorrectly due to many personal reasons.
Organizational Barriers: In an organization if there is no clarity about the
roles, structures, responsibilities, it will hinder effective communication
among the members of the organization.
Measures to Overcome Barriers of communication
Overcoming Lingual Factors: To overcome this one need to prepare
appropriately. One should carefully think about the language needs of the
recipient.
Overcoming Environmental Factors: Communicators should ensure that the
message is delivered in a distraction free environment.
Overcoming Barrier of Cultural Influence: Preparation to be made keeping
the culture of the people you are addressing.
Overcoming Interpersonal Barriers of Communication:
Overcoming Organizational Barriers of Communication
Parts of speech:
Noun: A noun is the name of a person, place, thing, or idea.
Pronoun: A pronoun is used in place of a noun or noun phrase to avoid
repetition.
Verb: A verb shows an action or state of being. A verb shows what
someone or something is doing.
20
Adjective: An adjective describes, modifies, or gives more information
about a noun or pronoun.
Article: A word that introduces a noun.
Adverb: An adverb describes/modifies a verb, an adjective, or another
adverb. It tells how, where, when, how often or to what extent.
Preposition: A preposition shows the relationship of a noun or pronoun to
another word. They can indicate time, place, or relationship.
Conjunction: A conjunction joins two words, ideas, phrases, or clauses
together in a sentence and shows how they are connected.
Interjection: An interjection is a word or phrase that expresses a
strong feeling or emotion. It is a short exclamation.
21
Sentences:
A group of words that makes complete sense is called a sentence. The
sentence must contain the subject and a predicate.
Kinds of Sentences:
There are four kinds of sentences:
1. Assertive or declarative sentence or Statement
2. Integrative sentence (a Question)
3. Imperative sentence (a Command)
4. Exclamatory sentence (an Exclamation)
Parts of a sentence-:
Subject-:
A subject is a word or group up of words which conveys the name of the person
or think that we are asking about.
Predicate-:
On the other hand, It is the part of the sentence which contains a verb, and
state something about the subject.
22
Active and Passive voice
The object of the active sentence becomes the subject of the verb in the
passive voice.
23
UNIT 2 :
SELF- MANAGEMENT SKILLS
Self-Management Skills
Def:- Self-management, which is also referred to as ‘self-control’ or ‘self-
regulation’, is the ability to regulate one’s emotions, thoughts, and behavior
effectively in different situations. This includes motivating oneself, and setting
and working towards personal and academic goals.
Domains of Self-Management Skills
i. Stress
Management
ii.Self-Awareness
iii. Self-Motivation
iv. Set Goals
v. Time Management
Stress management: -
Managing stress is all about taking charge: taking charge of your thoughts,
your emotions, your schedule, your environment, and the way you deal with
problems. The ultimate goal is a balanced life, with time for work,
relationships, relaxation, and fun – plus the resilience to hold up under
pressure and meet challenges head on.
24
Stress: -
25
Stress is a normal physical response to events that make you feel
threatened or upset your balance in some way.
When you sense danger – whether it’s real or imagined – the body's
defences kick into high gear in a rapid, automatic process known as the
―"fight-or-flight" reaction, or the stress response.
There can be two types of stress- good stress and bad stress.
Good Stress:
Good stress helps us go about our daily tasks and achieve those hard-to-reach
goals.
This stress, called eustress, helps us learn new things, adapt to change and
engage in creative thinking.
Everyone experiences good stress on a daily basis.
Another form of good stress is the stress that enables us to survive in times of
trauma.
This stress makes us aware of danger and enables us to escape when we
need to.
Bad Stress:
Bad forms of stress do not help us achieve goals or tasks, but instead
actually inhibit our ability to function on a daily basis.
Bad stress occurs when too much stress builds up around us.
Once the body feels there is too much stress, it will begin to break
down, causing symptoms like perspiration, anxiety, headaches and
rapid breathing.
This kind of stress can take a huge toll on your physical and mental well-
being.
27
9. Make time for hobbies, interests, and relaxation.
10. Get enough rest and sleep. Your body needs time to recover from
stressful events.
11. Seek out social support. Spend enough time with those you enjoy.
12. Seek treatment with a psychologist or other mental health professional
trained in stress management or biofeedback techniques to learn healthy
ways of dealing with the stress in your life.
Independent Working: -
Independent or self-directed learning is an important skill, whether you plan
to continue your studies after school or college or professionally.
Independent learning is when an individual is able to think, act and pursue
their own studies autonomously, without the same levels of support you
receive from a teacher at school.
Some useful questions to think about in this regard are the following:
What kind of science do you enjoy doing? Fundamental or applied?
Do you enjoy working in the lab or in an office?
Do you enjoy explaining your work? How? Orally? In Writing? Both?
Do you like working with others as a member of a team or do you prefer
to work by yourself?
Are you a good listener?
Can you handle personal conflict?
Do you prefer delving into a problem deeply?
Do you see the "big picture"?
Do you prefer to work on short term projects (6 months or less) or long term
projects?
Do you enjoy using instrumentation? What kinds?
Do you enjoy using computers and/or software?
Do you enjoy travel? Can you speak one or more foreign languages
conversationally? Can you read in another language?
Are you self-motivated? Do you require external prompts in order to
meet deadlines and/or achieve results?
30
them if they are aware of what bothers them. Be it any good or bad
actions taken by them that can recognize it very quickly.
Self-Motivation: -
Self-motivation is ability to do thinks on your own without being told to do so.
Self-motivation is a glorious cycle of boosting self-confidence and self-esteem.
Self-motivation definition, initiative to undertake or continue a task or
activity without another's prodding or supervision.
Self-regulation: -
Self-regulation is the ability to understand and manage your behaviour and
your reactions to feelings and things happening around you.
31
Q5. Physical exercise is used as a stress management technique because
A) It improves blood circulation
B) improves self-image
C) make us feel better
D) All of the above
Q10. Which of the following focuses on your ability to influence personal and
professional improvement based on your self-awareness and motivation?
A) Self-regulation
B) Self-awareness
C) Self-motivation
D) All of these
Answers:
Q1.D) Q2.B) Q3.A) Q4.A) Q5.D) 6.C) Q7.C)
Q8.D) Q9.B) Q10.A)
32
a. A fire alarm is intended to cause stress that alerts you to avoid danger.
b. The stress created by a deadline to finish a paper can motivate you to finish it
on time.
33
3. Write the effects of stress on our life.
Ans. It can harm our emotional and physical health, and limit our ability to
function well at home, in school and within our relationships.
1. What is Stress?
Ans – Our emotional, mental, physical, and social responses to perceived
demands or threats are referred to as stress. Stressors are the pressures or
threats that people face. For example –
a. You’re only a few days away from your examinations, yet you’re feeling
unprepared.
b. you are experiencing a loss of someone close in the family.
c. You’re concerned about what others will think of you if you don’t dress
properly or speak
confidently.
d. you are stressed due to lack of sleep.
34
UNIT 3
ICT SKILLS
Memory Management
Processor Management
Device Management
File Management
Security
Control over system performance
Job accounting
Error detecting aids
Coordination between other software and users
35
The different types of operating systems are as follows:
Interactive (GUI-based) A graphical user interface is a user-friendly operating
system in which commands can be entered by clicking/double-clicking/right-
clicking a mouse. Windows operating system is an example of an interactive
operating system.
Real Time A real time operating system is used to control machinery, scientific
instruments, like robots, in complex animations and computer controlled
automated machines. A real-time operating system is a computing
environment that reacts to input within a specific period of time. It manages
the resources of the computer so that any particular operation is executed in
the same amount of time every time it is executed. Windows CE and Lynx OS
are examples of real-time operating systems.
37
applications, etc. At the bottom of the desktop is a long bar called the
Taskbar. To the left of the taskbar is the Start button.
Figure 1
38
Computer :
It displays all the storage areas of the computer . Through the Computer icon, you
can access all drives, files, and folders on the computer. When you double-click
Computer icon, a window shown below in Figure 2 appears on the screen.
Taskbar is the long horizontal bar present at the bottom of the screen. To left of the
Taskbar is the Start button and to the right appears Date/Time. You can also see icons
of active applications and some shortcuts on the Taskbar
Fig 3 Taskbar
Start button it is located on the left of the taskbar. Clicking the Start button (Figure 4)
opens the Start menu and provides access to programs and features, like:
Shut Down: - allows the user to turn off the computer
All Programs: - Provides access to all the installed programs and applications. To start
an application, just click it.
Search Box: - This allows the user to search a file or a folder or run executable files.
39
Control
40
panel: - This allows the user to change various settings.
Recycle Bin Files and folders deleted by the user are stored in the Recycle Bin. From
Recycle Bin, you can retrieve files or folders deleted by mistake.
41
2. Select the drive in which you want to create a new folder. Say, Local Disk D:.
42
3. Window will open up showing files and folders in Local Disc D: Click New Folder on the
toolbar.
2. In the Shortcut menu, click New and select the type of the file you want to create.
3. Type the new name or edit the existing name and press the
Enter key. Or Just select the file/folder and press Function key
F2.
You can copy a file or a folder in any one of the following ways:
1. Shortcut menu:
c. Select the drive or the folder where you want to make a copy of the selected file or
folder.
To copy a file or a folder, hold down the Ctrl key while dragging it to the new location.
3. Using Keyboard:
You can move a file or a folder in any one of the following ways:
43
1. Shortcut menu:
44
b. Select Cut option from the Shortcut menu.
c. Select the drive or the folder where you want to move the selected file or folder.
2. Drag and Drop method: To copy a file or a folder, select the file and drag it to a new
location.
3. Using Keyboard:
You can permanently delete the contents of the Recycle Bin in any one of the
following ways: Right-click the Recycle Bin icon and then click Empty Recycle Bin
OR
To recover a file from the Recycle Bin, right-click the file, and then click
Restore. Or
•Keep the components of the computer, like keyboard, mouse, monitor, etc. clean.
45
• Ensure backups are working properly by periodically restoring or checking of data. You
should
46
use external hard drive for backup of data on your computer.
How to take
Always keep your anti-virus software updated so that it can detect new viruses. Full
system scan should be done to periodically, preferably weekly to scan for viruses.
Disk defragmentation done at regular intervals helps the disc space to be used at an
optimal level.
Take regular backup of the data on your computer. In case the data is lost due to
any reason, system failure, virus attack, etc., you can easily retrieve your data using
backup files till your last update.
System should be upgraded with new updates that were not there at the time of
purchase, like, increasing RAM, to improve the performance. Also storage space
should also be increased for storage of more information.
If you are getting some disc errors, then make sure that temporary internet files are
deleted from time to time.
47
QUESTIONS-1 MARK
1 Here are the steps that take place when starting a computer. Rearrange 1
the steps in the correct order. i) Desktop appears after login ii) Login
screen appears iii) Power on Self-Test (POST) starts iv) Operating system
starts v) Welcome screen appears
a) i) -> ii) -> iii) -> iv) -> v)
b) ii) -> iv) -> iii) -> v) -> i)
c) iii) -> iv) -> v) -> ii) -> i)
d) iii) -> v) -> iv) -> ii) -> i)
2 Which one of the following is an example of Operating System? 1
a) Microsoft Word
b) Microsoft Windows
c) Microsoft Excel
d) Microsoft Access
3 Given below are the steps to make a copy of folder ‘D:\Myfolder’ in ‘C:\ 1
Documents’.
Rearrange the steps in the correct order.
(i) Right click anywhere in the folder and select Paste option
from the shortcut menu or use Ctrl+V keyboard keys.
(ii) Select the C: drive and locate Documents folder.
(iii) Right click on Myfolder and select Paste option from the
shortcut menu or use Ctrl+C keyboard keys.
(iv) (iv) Select the D: drive and locate Myfolder.
(a) (iii) -> (i) -> (ii) -> (iv)
(b)(iv) -> (ii) -> (iii) -> (i)
(c) (iv) -> (iii) -> (ii) -> (i)
(d)(i) -> (ii) -> (iii) -> (iv)
4 Which of the following is not an example of Antivirus software? 1
(i) McAfee (ii) Norton (iii) Disk Clean-up (iv) Kaspersky
5 Given below are the components of the taskbar in Windows 7. Rearrange 1
the icons from left to right of the taskbar. (a)Date/Time (b) Start Button
(c) Notification Area
(d) File Explorer
(i) (c) -> (a) -> (b) -> (d) (ii) (b) -> (d) -> (c) -> (a) (iii) (d) -> (c) -> (b) ->
(a) (iv) (a) ->
(b) -> (c) -> (d)
6 Which of the following is not a symptom of a computer affected with 1
virus?
(i) Computer stops responding (ii) Computer restarts on its own (iii)
48
Computer can’t
open a permanently deleted file (iv) Computer runs very slowly
49
15 helps the computer to close all the applications, 1
Operating system and turn off the computer.
a. Sleep
b. Shut down
c. Hibernate
d. None of the above
21 What happens if you keep a device plugged in after it has been fully 1
charged?
a. It can break.
b. It can overheat.
c. It can stop functioning.
d. Data can get corrupt.
50
22 What role does antivirus play in protecting your device? 1
a. It can increase its performance.
b. It can protect it from overheating.
c. It can prevent data from getting corrupt.
d. It can backup data.
23 Which option does not need to be enabled in order to keep a device cool? 1
a. Make sure the computer’s CPU fan is working.
b. Keep the device unplugged when in use.
c. Do not cover a laptop with a blanket.
d. Avoid leaving the device in the sun.
51
29 Sometimes you may receive very attractive offers saying you have 1
won a huge amount of money in a lottery and that you can claim the
prize by depositing a certain amount of money known as .
a. Trojan House
b. Online Predator
c. Theft
d. Internet Scams
DESCRIPTIVE QUESTIONS
Ans.
52
File Folder
a. A Notepad file
b. A Sound File
c. An image file
b. .mp3
c. .jpg
7 Write the steps to create folder on desktop? 1
a. Cut
b. Copy
c. Paste
53
10 What do you mean by Spam? 1
Ans. Viruses are computer programs that can damage the data and
software programs or steal the information stored on a computer.
13 Name two types of Virus. 2
Ans. Few tips to protect our data from online theft and viruses are:
a. Use passwords to login to your computer:
b. Install Anti-virus and Firewall:
c. Use Data Encryption
d. Give details of your credit card or bank account only on secure sites
15 What do you mean by threats to Computer? 1
Ans. Threats are the ways in which personal information can be leaked
from a computer without our knowing.
16 List the various threats to a computer and its data. 2
54
4 (iii) Disk Cleanup
5 (ii) (b) -> (d) -> (c) -> (a)
6 (iii) Computer can’t open a permanently deleted file
7 c) Cleaning CPU cabinet
8 (d) any of the above
9 Security break
10 wall paper
11 b. Information and Communication technology
12 a. Communicate
13 a. Operating System
14 c. Both a) and b)
15 b. Shut down
16 c. Ctrl + v
17 d. All of the above
18 a. Antivirus
19 a. Delete
20 c. Spam
21 b. It can overheat.
25 c. Both a) and b)
26 a. Physical
27 b. Identity
28 b. Online Predator
29 d. Internet Scams
55
30 b. https://
56
UNIT 4
Entrepreneurial Skill
•Fosters Creativity
57
Role of society in boosting entrepreneurship:
Qualities of an Entrepreneur
58
The qualities of an Entrepreneur are the key value to success. They play the role to
guide the person to achieve his/her goal. Some qualities of an Entrepreneur are
stated below:
59
QUALITIES OF AN ENTREPRENEUR
INDEPENDENCE ENERGETIC
Hard work: Entrepreneur work hard to be successful. Entrepreneurs use a lot of trial
and error and keep putting in work till they succeed.
Optimism: Positivity and belief in what they do is what takes entrepreneurs far in
their journey. Entrepreneurs should not think negatively or be afraid of adverse
situations. For an entrepreneur, part of being optimistic is about learning from
mistakes and failures and finding alternative ways to do things.
Independence: Entrepreneurs prefer to be their own master and not work under
someone else. Entrepreneurs like the independence to drive a business on their own.
Energetic: Drive and energy is always high in successful entrepreneurs which makes
them extremely proactive. They are continuously taking actions to try multiple
approaches and execute things.
Self-confident: Belief in one’s own vision and abilities and passion for the goal makes
successful entrepreneurs confident. Entrepreneurs are able to transfer this passion
and vision to investors, employees, customers etc. to sell their idea to every
stakeholder.
Perseverant: A way of thinking that helps to accept failure, learn from mistakes, not
give up, continuously experiment etc. is crucial for an entrepreneur. Hence,
entrepreneurs need to be perseverant in their pursuit.
60
Functions of an Entrepreneur
61
Entrepreneurial functions
Risk taking:
● Risk taking is about taking responsibility and planning for a loss or mishap
that may occur in the future due to unforeseen contingencies.
● Some common risks entrepreneurs take are around return on investment,
hiring of new employees, working with vendors etc.
● An entrepreneur plays the function of developing a certain risk-taking
appetite and taking calculative risks to reduce adverse consequences.
Innovation:
● Entrepreneurs innovate by introducing new concepts, products, services,
designs, ideas etc.
● They may introduce something new and innovative in any branch of economic
activity.
● An entrepreneur foresees a potentially profitable opportunity and innovates in
the effort to exploit it.
Promotional functions
Idea Discovery:
● The first step towards entrepreneurship is discovery of a business idea.
● An entrepreneur comes up with a business idea and thinks about ways to implement
it.
● It is about seeking opportunities for a specific type of business and
finding ways to commercialise it.
● Usually, entrepreneurs work around the process of idea discovery by
exploiting natural resources, finding a market need or calculating the profit
potential.
Detailed Investigation:
62
● While coming up with ideas can seem like an easy process, the challenge is to
understand if the idea has the potential to turn into a viable business venture.
● For this, an entrepreneur conducts research, investigates and evaluates an
idea considering various factors and estimates the total demand for a new
product or service.
63
Assembling the Requirements:
● Some basic business requirements include infrastructure or office
space, human resources, key vendors or partners, working capital etc.
● In a manufacturing or product-based business, some requirements are
selecting the factory site, sourcing plant and machinery, hiring staff,
finding the right suppliers etc.
● No matter what is the type of the business, an entrepreneur has to work
towards assembling and organising all the requirements once he/she is sure
about the practicality and profitability of the proposition.
● Once this function is performed, the project is set to start smoothly.
Financing:
Managerial functions
Planning
● An entrepreneur documents a business idea in the form of a business plan, to
detail each element of the business such as product or service description,
operations, marketing, finance, accounting, growth plan etc.
● A business plan serves as a guide to determine the business objectives and
the course of action.
● It helps to detail the “what, when, how and who” of doing every specific task.
Organizing
● Organizing in the managerial context refers to setting specific and
attainable goals and objectives to be achieved by different departments
and by each employee.
● It is about arranging, directing, guiding, coordinating, and controlling the
key business activities
Directing
● Directing is about initiating planned action and ensuring that each employee
is performing effectively.
● This also includes doing continuous performance reviews and organizing
tasks according to plans.
64
Staffing
● Staffing refers to different sub-processes around human resource
management, such as manpower planning, recruitment, selection,
placement, training, transfer, salary, promotion, payroll, appraisal, etc.
● The objective of staffing is to fill a particular position with the right
employee at the right time.
Leadership
● Leadership is more of a skill than a function for an entrepreneur as he or she
has to lead, guide and supervise people who work for the business.
● It is the process by which an entrepreneur directs, guides and influences the
work of others in choosing and attaining specified goals by mediating
between the individual and organization in such a manner that both get
maximum satisfaction.
Communication
● An entrepreneur has to communicate every single day, in the form of writing,
responding, drafting emails, verbal instruction, discussion, etc.
● Entrepreneurs spend 75% to 90% of their working time communicating with others.
● It refers to the exchange of ideas, feelings, emotions, knowledge, and
information between two or more persons.
● Nothing happens in management until effective communication takes place.
Supervision
● After issuing instructions, the entrepreneur has to see that the given
instructions are carried out.
● Supervision refers to the job of overseeing subordinates at work to ensure
the maximum utilization of resources, to get the required and directed work
done, to correct the subordinates whenever they go wrong, and ensure each
function of the business runs smoothly.
Motivation
● Along with guiding employees, an entrepreneur also plays the role of
motivating them and encouraging positive behavior and culture within the
organization.
● Motivating employees is about creating an urge in them to exhibit the desired
behavior and positive attitude towards work.
● Employees with high motivation automatically do other things along with it to
perform successfully, such as being productive, flexible, competitive,
comprehensive, efficient, etc.
Co-ordination
65
● Coordination between different departments of the business helps to
ensure that work happens in a timely manner.
● Activities of all employees must be channelized towards goal achievement.
● An entrepreneur has to set certain targets, measures, goals, etc.
66
● With different departments to ensure all are coordinating and working
effectively internally as well.
Controlling
● Sometimes controlling is necessary for the entrepreneur to set
company rules and policies.
● The controlling function helps the entrepreneur to set performance standards,
measure and compare productivity and performance, identify variations, take
corrective action, etc.
Negotiation
● An entrepreneur negotiates terms and conditions for many parts of the
business such as payment terms and timelines, salaries of employees,
vendor quotations, etc.
Commercial Functions
Marketing
● Marketing is about moving the product or service from the producer into the
hands of the end customer or user.
● It involves promotion, advertising, distribution, customer service, etc
● An entrepreneur has to perform this function to make people aware of the
offerings of the business and makes sales.
Innovator’s Role
52
Entrepreneurs innovate by bringing unique and new products and services into the
market. Innovation in the industry results in higher production efficiency which has
led to an increase in employment and income levels.
Agent’s role
Coordinating role
An entrepreneur has to coordinate the various factors for production. It involves the
selection of the best possible combination of factors.
The fruit of bearing risks can be profit, which leads to wealth generation for the
overall economy. Entrepreneurs retain some amount of the profits earned and put it
back into the business. Therefore, by assuming risk entrepreneurs contribute to the
economy.
Entrepreneurs enable the formation of capital by mobilizing idle savings for the
purpose of carrying on the business. This mobilization of capital leads to the
development of assets, trade activities, an increase in capital availability, and
economic development.
Imitating role
Entrepreneurs generate employment, income, and wealth which improves the overall
standard of living in society. Improved standard of living leads to economic
development as it reduces the disparity in income.
Balancing role
Entrepreneurship is encouraged with small and micro enterprises and small-scale
industries as well. This encourages regional development and removes development
imbalances in the economy
53
IMPORTANCE OF AN ENTREPRENEUR
Efficiency improvements
● A successful entrepreneur tends to adapt to an established business and
increase their own efficiency.
● They innovate with current systems and introduce new technologies
which can significantly create advancement in the industry.
● Hence, during any major changes in the economy, entrepreneurs adapt and
do not have to go out of business.
New markets
● Entrepreneurs can often ‘redefine the rules’ of an established industry.
● They do this by creating new markets for existing products and slightly
innovating in small ways to suit the needs of a new target market.
New values
● Sometimes, entrepreneurs choose ethics over profit and offer a more ethical
product to the world, and are transparent about it.
● For example, Jaipur Rugs has multiple artisans who work towards making
rugs that are sold around the world.
● However, Jaipur rugs are very transparent about their artisan community and
they ensure that artisans are given a fair share of profit.
c) Entrepreneurs take risk: While entrepreneurs definitely have to bear some risks,
they do not necessarily put themselves in high-risk situations. Entrepreneurs take
calculated risks and weigh risk versus reward.
**********************************************************************************************
********
A. MCQ QUESTIONS: (Each question carries 1 mark)
a. Software Engineer
b. Entrepreneur
c. Civil Engineer
d. Mechanical Engineer
55
4. The process of developing a business plan, launching and running a business using
innovation to meet customer needs and to make a profit is .
56
a. Software Engineer
b. Entrepreneur
c. Civil Engineer
d. Mechanical Engineer
5. A self-employed person who is always trying to make his/her business better by taking
risks and trying new ideas is an .
a. Business Man
b. Entrepreneur
c. Employer
d. None of the above
6. What do entrepreneurs do when she/he runs their business?
a. Fulfill Customer Needs
b. Use Local Materials
c. Create Jobs
d. All of the above
7. When a person begins a business, he or she may encounter several challenges and
failures. Even while taking a significant risk, an entrepreneur must think .
a. Positively
b. Negatively
c. Both a) and b)
d. None of the above
8. It is necessary for an entrepreneur to continuously towards his/her own and
company’s goals.
a. Work Hard
b. Always take rest
c. Not participate actively
d. None of the above
9. Entrepreneurs need to be open to and try them
without fear of failure.
a. Invest all of money
b. New Ideas
c. Both a) and b)
d. None of the above
10.Experimenting with many ideas is a quality related to .
57
a. Perseverance
b. Confidence
c. Creativity
d. Trial and error
11. An entrepreneur should be able to see a problem from
different perspectives and come up with original and .
a. Creative Solutions
b. New Ideas
c. Both a) and b)
d. None of the above
12. An entrepreneur should be willing to take a and is always open to new
ideas to make his/her business grow.
a. Satisfying human need
b. Product and Service
c. Calculated Risk
d. Regular Production
13. Ravi’s customer comes to his store and starts shouting at him. He does not get angry.
He listens to what his customer is saying. He is .
a. Hardworking
b. Confident
c. Patient
d. Prying new ideas
14. Susheela decides to sell her company tyres in Sri Lanka. It does not sell and she has a
loss. She apologizes to the people who work for her. She says she will plan better next
time. She .
a. takes responsibility for your mistakes
b. thinks before making a decision
c. does not give up
d. is creative
15.A myth, or a misconception about entrepreneurship is .
a. To start a business we required lot of money
b. Business should be unique or special
c. entrepreneurs are born, not made
d. All of the above
58
16. Ramya and Ramu both own plant shops. Ramu sits at his shop every day. When
customers come, he sells to them. Ramya walks around and gets customers to her shop.
She also sells seeds and flowers. Who is Entrepreneur out of Ramya and Ramu.
a. Ramya
b. Ramu
c. Both of the above
d. None of the above
17.What do entrepreneurs do when they run their business?
a. They help in increasing jobs in their area.
b. Helping the people in the society to earn money.
c. Both of the above
d. None of the above
18. Which of the following entrepreneurship refers to starting industries in which
manufacturing, trading, providing services, productions are done on a micro scale?
a. Women Entrepreneurship
b. Agricultural Entrepreneurship
c. Small Scale Entrepreneurship
d. None of the above
19. An enterprise owned and controlled by a woman and giving at least 51 per cent of the
employment generated in the enterprise to women is
a. Agricultural Entrepreneurship
b. Small Scale Entrepreneurship
c. Social Entrepreneurship
d. Women Entrepreneurship
20. Mary buys bulbs for her business from Noida. She learns that bulbs are cheaper in
Faridabad. So, she decides to start buying bulbs from there.
(b)Divides income
(c) Takes
risk
ANSWERS
59
1 a 5 b 9 b 13 c 17 c
2 d 6 d 10 d 14 a 18 c
3 b 7 a 11 c 15 d 19 d
4 b 8 a 12 c 16 a 20 a
B. DESCRIPTIVE QUESTIONS
1 MARK QUESTIONS:
1. What do you mean by Entrepreneur?
Ans: Entrepreneurs are people with vision who recognize and pursue opportunity,
create and establish business or new ventures, take into account the risk involved by
using available resources.
2.What do you mean by Entrepreneurship?
Ans: Entrepreneurship is the organizing an enterprise to undertake a new
production process, raising capital, arranging labour and raw materials, etc.
3.Entrepreneurs are not job seekers but they create opportunities of employment for
people. (True/False)
Ans. True.
2 MARK QUESTIONS:
1. Explain any two role of entrepreneurs?
Ans. Innovator’s Role: Entrepreneurs innovate by bringing unique and new products
and services into the market.
Risk assumption role: Entrepreneurs are not risk aversive and they realize that taking
risks is a part of business.
Employment Generation role: Entrepreneur solves the problem of unemployment by
generating jobs and employing people.
2. State any two benefits of Entrepreneurship to
society. Ans.
a) Entrepreneurs provide new job opportunities
b) Entrepreneurs increase competition & boost productivity
c) Entrepreneurs create new business & new markets.
d) Entrepreneurs add national income.
e) Entrepreneurs introduce innovative technology and low cost products
60
women, where women undertake risks, create enterprises, organize factors of
production, innovate with products/services and generate employment opportunities.
61
4. What is meant by Agricultural Entrepreneurship?
Ans. Agricultural Entrepreneurship can be defined as being primarily related to the
marketing and production of inputs and products used in agricultural activities.
63
f) Managerial skills: The Entrepreneur must have right managerial skills so as to
handle the group of people efficiently.
g) Organization building: It implies skills to build an organization. Building an
organization is important part of Entrepreneurship development.
14. What do you think are the important functions of an entrepreneur? Write your
answer giving suitable examples.
Ans.
The functions of an entrepreneur are:
Making Decisions: An entrepreneur makes decisions every day. This includes
what to produce or sell, how much and where to sell.
Managing the Business: An entrepreneur plans the future of his or her
business. He/she arranges for raw material, hires people for work, and tells
64
everyone what to do. They also check if the plan is being followed.
Divide Income: The entrepreneur divides the business money into many
groups. He/she spends money to buy material, pays rent of the building and
salaries to people.
65
Taking Risk: Risk is the chance of something going wrong. An entrepreneur
takes risks against fires, lost items and theft.
Create a new Method, Idea, or Product: An entrepreneur is always trying new
things. He/she does this to increase their importance and income.
66
Ans. Planning, organizing, decision making, managing, innovating, risk bearing, etc.
67
18.How do entrepreneurs contribute to society?
entrepreneur are:
Innovator’s
role Agents’
role Innovator
Risk Assumption
Capital formation
Employment
generation
Ans. Entrepreneurship is becoming the most pursued career choice. The term
entrepreneurship is defined as the type of self-employment where one is running a
business and looking for ways to make the business better to make profits.
21.“Entrepreneurs are born, not made.” Do you agree with this statement? Justify
your answer. Ans. No, this is a myth/misconception about entrepreneurship.
Being an entrepreneur starts with a way of thinking. One must believe that anything
is possible and it shall be achieved. It starts with thinking of an idea that you want to
work on, making it different.
SUSTAINABLE DEVELOPMENT
As the human race progressed, we neglected the vitality of nature in our lives. In
pursuit to fulfil our unending wants we started exploiting the nature that has resulted
in what we see today, the scarcity. There is scarcity of clean water to drink, scarcity
of pure air to breathe, scarcity of unadulterated food, rising issue of global warming,
depletion of ozone layer.
69
Everyone in the world today is talking about the measures to curb these rising
problems. There are World Summits being organised to find a solution to these global
problems. And the solution to these problems is only one – SUSTAINABILITY.
Sustainability focuses on how human beings can live in peace and harmony with
nature without creating ecological disturbance. The aim is that we visualize the long
term impact of our actions on environment and take corrosive measures to maintain
balance between our demands and the supply of natural resources.
SUSTAINABLE DEVELOPMENT
In our daily life we can contribute to create a Sustainable Society by following 4Rs’ and
1U of
Sustainability. These are REFUSE, REDUCE, REUSE, RECYCLE and UPCYCLE.
70
REFUSE - Not to use products that may not harm the environment.
REDUCE - To minimize the use of the products that may cause harm to the
environment.
71
REUSE - To reuse products as far as possible, in order to reduce the waste
generation.
RECYCLE - After reusing the product, we must try to recycle it as far as possible.
UPCYCLE - Any product that is not usable can be upcycled with creativity and
innovation. It gives a new look to the old product and makes it look desirable.
2. Not only for the next generation but even for the
existing generation, the quality of basic resources
is deteriorating
leading to major health concerns such as Cancer, Bronchitis etc. Ensuring
sustainability will help curb these problems.
3. Rising demands is leading to economic disparity. The rich is becoming richer while
the poor is becoming poorer. The uneven distribution of available resources across
different economic fronts is leading to discrimination, giving rise to crime and
creating
social imbalance. To ensure proper balance
Sustainability is important.
72
Sustainable Development.
5. Adoption of Sustainable Development in our daily life and at our work place will
also promote economic growth. Young entrepreneurs with minimum investment can
produce better output. Introduction of Solar Power Plants, Waste Water Treatment
Plants, Electric Vehicles etc. will not only help in protecting Environment but shall
also contribute in Saving money and resources. The
73
economy that reduces environmental risks and strikes ecological balance is termed
as Green Economy.
1. poverty
2. Zero Hunger
3. Good Health and Well Being
4. Quality Education
5. Gender Equality
6. Clean water and Sanitation
7. Affordable and Clean Energy
8. Decent Work and Economic Growth
9. Industry Innovation and Infrastructure
74
10. Reduced Inequalities
11. Sustainable Cities and Communities
12. Responsible Consumption and Production
13. Climate Action
76
3.With the existing issues of climate change, number of species has extinct and
many are on verge of their extinction. Under such circumstances striking a balance in
the food chain is a big responsibility.
4. The market all over the world is trying to capture as many resources as possible to
maximize their profit. In pursuit of maximising the profit they overuse and exploit the
resources.
5. In the time of nuclear race, where every developing country is trying its hand to
become developed nation, ensuring world peace is a global challenge.
6. It is the responsibility of every country to ensure having a full proof policy towards
Sustainable Development. While the challenge remains that many are simply leaving
loose ends in the execution of policies.
7. Last but most important, while it is the responsibility and accountability of every
individual to promote Sustainable Development, there is a huge world population
which is simply insensitive towards its need.
QUESTIONS
1 mark QUESTIONS
17
3. Give any one practice / sustainable process that is being used to help
preserve the environment.
77
6. What do you mean by Sustainable Development Goals?
Food and nutrition security, safe drinking water, energy security, and
waste management.
Any product that is not usable can be upcycled with creativity and
innovation to give a new look to an old product, this helps in
sustainable development.
10. What is meant by REFUSE in context of creating sustainable
environment?
REFUSE implies refusing use of those products which may cause harm to
environment.
DESCRIPTIVE (2 MARKS)
Using solar power i.e., power generated using the sun does
not cause pollution as it does not require burning of non-
renewable fuels, such as coal.
Use of biogas is also an eco-friendly alternative to natural gas.
78
3. ‘Reduced Inequalities’ is one of the Sustainable development goals set
by the UN.
Give any two ways to reduce inequalities.
Food: Large areas of rich, fertile land needed to grow crops, which
is becoming less as we are using up more and more land for other
purposes – cities, roads, airports, industries, etc. Soil nutrients are
also getting depleted and lots of chemicals are spoiling the soil
due to use of chemical fertilizers.
Water: We use fresh water from rivers and ponds for drinking
and cleaning but dump garbage into them. The rivers and ponds
are getting polluted. This way after several years, we will have
no clean water for our use.
Fuel: We are using a lot of wood from trees as fuels and for
construction of homes and furniture. As more and more trees are
being cut, it is affecting the climate of the place. Extreme
weather conditions, such as floods, extreme cold or heat, are
seen in many places, which affect the people
living there.
5. Briefly explain importance of sustainable development.
It will ensure that resources like air, water, forests are saved
to future generation.
Problems like Climate Change, Emission of Green House gases
can be taken care of with the help of Sustainable
Development.
Adoption of Sustainable Development in our daily life and at our
work place
will also promote economic growth.
79
INTRODUCTION TO ARTIFICIAL INTELLIGENCE
Humans developed machines to make their lives easier to accomplish tasks which
are too tedious or are time consuming. Therefore humans put efforts in making the
machines more sophisticated and smart.
Children are asked to compare old TV and smart TVs. How they differ in their working.
Similarly Old phones and smartphones are compared, to understand about latest
facilities in smart phones.
ARTIFICIAL INTELLIGENCE:
Artificial is something which is man-made, which does not occur naturally.
Intelligence is the ‘ability to perceive or infer information, and to retain it as knowledge to be applied
towards adaptive behaviours within an environment or context.’
ARTIFICIAL INTELLIGENCE
ARTIFICIAL INTELLIGENCE
HUMAN INTELLIGENCE:
Human Intelligence is defined in terms of :
1. Ability to observe, recognize and understand
2. Ability to make ‘smart’ decisions and solve problems
3. Ability to learn and increase knowledge
80
Any device that can perform the above, can be termed as intelligent device.
When a machine possesses the ability to mimic human traits i.e make decisions,
predict the future, learn and improve on its own by collecting data, understand it,
analyse it , learn from it and improve it, it is said to have Artificial Intelligence.
Machines become intelligent once they are trained with data and algorithm.
81
There are mainly 9 types of Intelligence :-
82
Exercise – 1 :
Teachers can list out some professions and ask students to identify the type of
intelligence used in their professions.
For Eg:
83
Lawers : Linguistic Intelligence
Musicians : Musical Intelligence
Architect : Mathematical, Logical Reasoning
Exercise – 2 :
Allow students to check on, the type of intelligence used by them, when they are
exposed to various scenarios.
Identify and list the intelligence types that you have in descending order.
What is Intelligence? Explain in brief any three types of intelligence that are mainly
perceived by human beings?
84
With the use of big data, AI in E-Commerce is impacting customer choices by
recording the data of previous purchases, searched products, and online browsing
habits.
d. Navigate to Places:
To help us navigate to places, apps like UBER and Google Maps exist. Thus, one no
longer needs to stop to ask for directions.
e. Improved Gaming Experience:
AI has changed the world of gaming by making the game more intelligent with
enhanced graphics, providing the ability to learn using machine learning algorithms.
Games, understand human patterns and give responses to new difficulty levels. AI
can adapt to your playing style by making the game more exciting.
f. Platforms that provide recommendations:
Platforms like Netflix, Amazon, Spotify, YouTube etc. show us recommendations on
the basis of what we like. They even cater to needs of connecting with friends on
social media platforms with apps like Facebook and Instagram. They also send us
customized notifications about our online shopping details, auto-create playlists
according to our requests and so on. Taking selfies with Snapchat filters are all
possible now.
g. Monitor Health:
AI is also being used to monitor our health. Chatbots and other health apps are
available, which continuously monitor the physical and mental health of its users.
The humanoids like Sophia, to get citizenship, biometric security systems like the
face locks in phones, real-time language translators, weather forecasts, all use AI.
86
An air conditioner can be turned on and off remotely with the help of internet but still
needs a human touch. This is an example of Internet of Things (IoT).
c. Automated Robots :
Robots which might follow a path or maybe can avoid obstacles but need to be
primed accordingly each time.
d. Automated Projects using Sensors :
A lot of projects which can automate our surroundings with the help of sensors, bots
or the automation machine is not trained with any data, it does not count as AI.
e. All "smart" devices are not AI-enabled :
For example, a TV does not become AI-enabled if it is a smart one.
NOTE: It gets the power of AI when it is able to think and process on its own.
AI, ML & DL :
87
Deep Learning (DL)
88
It enables software to train itself to perform tasks with vast amounts of data. In Deep
Learning, the machine is trained with huge amounts of data which helps it in training
itself around the data. Such machines are intelligent enough to develop algorithms
for themselves.
DL is a ML algorithm that
AI is a computer ML is an AI algorithm uses deep (more than
algorithm which which allows system to one layer) neural
exhibits intelligence learn from data. networks to analyze data
through decision and provide output
making. accordingly.
If you are clear about the
If you have a clear idea
math involved in it but
about the logic (math)
don’t have idea about
involved in behind and
Search Trees and much the features, so you
you can visualize the
complex math is break the complex
complex functionalities
involved in AI. functionalities
like K-Mean, Support
into
Vector Machines, etc.,
linear/lower
then it defines the ML
89
dimension features by
aspect.
adding more layers, then
it defines the DL aspect.
It attains the highest
The aim is to basically The aim is to increase
rank in terms of
increase chances of accuracy not caring
accuracy when it is
success and not much about the success
trained with large
accuracy. ratio.
amount of data.
DL can be considered as
neural networks with a
Three large number of
Three parameters layers lying
broad in one of the four
categories/types Of AI broad fundamental
are: Artificial categories/types Of ML network
are: Supervised architectures:
Narrow Intelligence Unsupervised Pre-trained
(ANI), Artificial General Learning, Unsupervised
Intelligence (AGI) and Learning and Networks, Convolutional
Artificial Super Reinforcement Learning
Intelligence (ASI) Neural
Networks, Recurrent
Neural Networks and
Recursive Neural
Networks
The efficiency Of AI is Less efficient than DL as
More powerful than ML
basically the efficiency it can’t work for longer
as it can easily work for
provided by ML and DL dimensions or higher
larger sets of data.
respectively. amount of data.
Examples of AI
applications Examples of ML Examples of DL
applications include: applications include:
include: Google’s AI- Virtual Personal Sentiment based news
Powered Predictions, Assistants: Siri, Alexa, aggregation, Image
Ridesharing Apps Like Google, etc., Email Spam analysis and caption
Uber and Lyft, and Malware Filtering. generation, etc.
Commercial Flights Use
an AI Autopilot, etc.
INTRODUCTION TO AI DOMAINS:
Artificial Intelligence becomes intelligent according to the training which it gets. For
training, the machine is fed with datasets. According to the applications for which the
AI algorithm is being developed, the data which is fed into it changes.
With respect to the type of data fed in the AI model, AI models can be broadly
categorized into three domains:
90
91
a. Data Sciences
Data sciences is a domain of AI related to data systems and processes. The system
collects numerous data, maintains data sets, and derives meaning/sense out of them.
The information extracted through data science can be used to make a decision
about it. Example of Data Science:
Price Comparison Websites
These websites are being driven by lots of data giving us the convenience of
comparing the price of a product from multiple vendors at one place.
PriceGrabber, PriceRunner, Junglee, Shopzilla, DealTime are some examples of
price comparison websites.
b. Computer Vision
Computer Vision (CV) , is a domain of AI that depicts the capability of a machine to
get and analyze visual information and predict some decisions about it. The entire
process involves image acquiring, screening, analyzing, identifying and extracting
information. This extensive processing helps computers to understand any visual
92
content and act on it accordingly.
93
In computer vision, Input to machines can be photographs, videos and pictures from
thermal or infrared sensors, indicators and different sources.
Computer vision related projects translate digital visual data into descriptions. This
data is then turned into computer-readable language to aid the decision-making
process. The main objective of this domain of AI is to teach machines to collect
information from pixels.
Examples of Computer Vision
Self-Driving cars/ Automatic
Cars
CV systems scan live objects and analyse them, based on whether the car decides to
keep running or to stop.
Face Lock in Smartphones
Smartphones come with the feature of face locks in which the smartphone’s owner
can set up his/her face as an unlocking mechanism for it. The front camera detects
and captures the face and saves its features during initiation. Next time onwards,
whenever the features match, the phone is unlocked.
c. Natural Language Processing
Natural Language Processing (NLP) , is a branch of artificial intelligence that deals
with the interaction between computers and humans using the natural language.
Natural language refers to language that is spoken and written by people, and natural
language processing (NLP) attempts to extract information from the spoken and
written word using algorithms.
The ultimate objective of NLP is to read, decipher, understand, and make sense of
the human languages in a manner that is valuable.
It has two main components:
Natural Language Understanding (NLU): It is used for spoken or written language to
provide a link between natural language inputs and what they present. It analyzes
different aspects of language.
Natural Language Generation (NLG): It helps to produce meaningful phrases and
sentences along with Text planning, Sentence Planning, and Text realization.
Examples of Natural Language Processing
Email filters
Email filters are one of the most basic and initial applications of NLP online. It started
out with spam filters, uncovering certain words or phrases that signal a spam
message.
Smart assistants
Smart assistants like Apple’s Siri and Amazon’s Alexa recognize patterns in speech,
then infer meaning and provide a useful response.
94
What are AI Domains ?
95
Pick the odd one out and justify your answer:
a. Snap Chat Filter
b. Face Lock in Phone
c. Chatbot
d. Image search Option
Answer: Chatbot, as it is NLP based, the other three are Computer vision based
We nowadays have pocket assistants that can do a lot of tasks at just one command.
Alexa, Google Assistant, Cortana, Siri are some very common examples of the voice
assistants which are a major part of our digital devices.
To help us navigate to places, apps like UBER and Google Maps come in there. Thus,
one no longer needs to stop repeatedly to ask for directions.
AI has completely enhanced the gaming experience for its users. A lot of games
nowadays are backed up with AI which helps in enhancing the graphics, come up
with new difficulty levels, encourage gamers, etc.
96
AI has not only made our lives easier but has also been taking care of our habits,
likes, and dislikes. This is why platforms like Netflix, Amazon, Spotify, YouTube etc.
show us recommendations on the basis of what we like.
AI is also being used to monitor our health. A lot of chatbots and other health apps
are available, which continuously monitor the physical and mental health of its users.
These applications are not limited to smart devices but also vary to humanoids like
Sophia, the very first humanoid robot sophisticated enough to get citizenship,
biometric security systems like the face locks we have in our phones, real-time
language translators, weather forecasts, and whatnot! This list is huge, and this
module will go on forever if we keep tabulating them. So, take some time, discuss
with a friend and identify more and more AI applications around you!
AI Ethics
AI ethics is a set of values, principles and techniques that employee widely accepted
standards of right and wrong to guide moral conduct in the development and use of
AI technology.
AI Bias and AI Access
Bias means inclination or prejudice for or against one person or group, especially in
a way considered to be unfair. When AI programs, tool, and algorithm exhibit any
kind of bias, it is called AI bias.
AI Access
Since Artificial Intelligence is still a budding technology, not everyone has the
opportunity to access it. The people who can afford AI enabled devices make the
most of it while others who cannot are left behind. Because of this, a gap has
emerged between these two classes of people and it gets widened with the rapid
advancement of technology
97
AI Project Cycle
Let us take some daily examples as projects, requiring steps to solve the
problem. Creating a birthday card.
1. Checking the factors like budget, etc which will help us decide the next
steps and understanding the Project.
2. Acquiring data from different sources like online, with friends etc for Designs and
ideas.
3. Making a list of the gathered data.
4. Creating or modelling a card on the basis of the data collected.
5. Showing it to Parents or cousins to let them check it or evaluate it.
1. Problem Scoping
Problem Scoping refers to understanding a problem, finding out various factors which
affect the problem, define the goal or aim of the project.
The Sustainable Development Goals (SDGs), also known as the Global Goals, were
adopted by all United Nations Member States in 2015 as a universal call to action to
end poverty, protect the planet, and ensure that all people enjoy peace and
prosperity
98
4 W's of Problem Scoping
4 Problem Statement Template
The 4W’s of Problem Scoping are Who, What, Where, and Why.
This W’s helps in identifying and understanding the problem in a better and efficient
manner.
Who - “Who” part helps us in comprehending and categorizing who all are affected
directly
and indirectly with the problem and who are called the Stake Holders.
What - “What” part helps us in understanding and identifying the nature of the
problem and under this block, you also gather evidence to prove that the
problem you have selected exists.
Where - "Where” does the problem arise, situation, context, and location?
Why - “Why” is the given problem worth solving?
99
2. Data Acquisition
The process of collecting accurate and reliable data to work with.
100
Two types of Data Sets
Base Training set Testing set
Use Used for Training the model Used for Testing the model after it
is trained
Size Is allot bigger than testing It is smaller than Training set
data and constitutes about and constitutes about 20% to 30%
70% to 80%
Data Features
o Refer to the type of data you want to collect.
o Eg: Salary amount, increment percentage, increment period, bonus etc.
Big data
o It includes data with sizes that exceed the capacity of traditional software to
process within an acceptable time and value.
o The main focus is on unstructured type of data
Volume
Amount of data produced
Variety
Types of data produced
Big Data
Velocity
Speed of data produced
Web Scraping
Web Scraping means collecting data from web using some technologies.
We use it for monitoring prices, news and etc.
Example: Web Scrapping using beautiful soup in python.
Sensors
Sensors are very important but very simple to understand.
Sensors are the part of IoT (Internet of things)
Sensors collect the physical data and detect the changes.
Cameras
Camera captures the visual information and then that information which is
called image is used as a source of data.
Cameras are used to capture raw visual data.
API
Application Programming interface.
API is a messenger which takes requests and tells the system about requests
and gives the response.
Ex: Twitter API, Google Search API
Observations
When we observe something carefully, we get some information
For ex: Scientists Observe creatures to study them.
Observations are a time-consuming data source.
Surveys
The survey is a method of gathering specific information from a sample of people.
Example, a census survey for analysing the population
101
3. Data Exploration
In this stage of project cycle, we try to interpret some useful information out of the
data we have acquired. For this purpose, we need to explore the data and try to put
it uniformly for a better understanding. This stage deals with validating or verification
of the collected data and to analyze that:
The data is according to the specifications decided.
The data is free from errors.
The data is meeting our
needs This stage is divided into 2
sub stages.
1) Data Cleaning
2) Data Visualization.
Data Cleaning
Data cleaning helps in getting rid of commonly found errors and mistakes in a data
set. These are the 3 commonly found errors in data.
1) Outliers: Data points existing out of the range.
2) Missing data: Data points missing at certain places.
3) Erroneous data: Incorrect data points.
Outliers
An outlier is a data point in a dataset that is distant
Missing Data
What do these NaN values indicate? They
are the missing values in the data set.
103
Erroneous data is test data that falls outside of what is acceptable and should be
rejected by the system.
Student Name Class
RIYA GEORGE XA
JOSHUA SAM XA
APARNA BINU XA
SIDHARDH V R XA
NITHILA M 57
ATHULYA M S XA
ANUJA MS XB
KEERTHI
XB
KRISHNANATH
Data Visualization
Why we need to explore data through visualization?
1) We want to quickly get a sense of the trends, relationships, and patterns
contained within the data.
2) It helps us define strategy for which model to use at a later stage.
3) Visual representation is easier to understand and communicate
to others. Example:
104
Data Visualization Techniques
1. Area Graphs
Area Graphs are Line Graphs but with the area below
2. Bar Charts
The classic Bar Chart uses either horizontal or vertical
3. Histogram
A Histogram visualizes the distribution of data
over a continuous interval or certain time period.
Each bar in a histogram represents the tabulated
frequency at each interval/bin. Histograms help
give an estimate as to
where values are concentrated, what the extremes are
4. Line Graphs
Line Graphs are used to display quantitative values
105
the y-axis has a quantitative value, while the x-axis is a
timescale or a sequence of intervals. Negative values
5. Pie Charts
Pie Charts help show proportions and percentages between categories, by dividing a
circle into proportional segments. Each arc length represents a proportion of each
category, while the full
106
circle represents the total sum of all the data, equal to 100%. Pie Charts are ideal for
giving the reader a quick idea of the proportional distribution of the data.
6. Scatterplots
Scatterplots use a collection of points placed
using Cartesian Coordinates to display values
from two
variables. By displaying a variable in each axis, you can detect
if a relationship or correlation between the two variables exists.
7. Flow Charts
This type of diagram is used to show the sequential
107
4. Modelling
It’s the fourth stage of AI project cycle. In previous stage, i.e. graphical representation
makes
the data understandable for humans as we can discover trends and patterns out of it.
108
But when it comes to machines accessing and analyzing data, it needs the data in
the most basic form of numbers (which is binary – 0s and 1s) and when it comes to
discovering patterns and trends in data, the machine goes in for mathematical
representations of the same.
The ability to mathematically describe the relationship between parameters is the
heart of every AI model.
Generally, AI models can be classified as follows:
Rule Based
AI Models
Machine Learning
Learning Based
Deep Learning
dat
Rule based approach answers
a
rule
s
Thus, machine learning gets introduced as an extension to this as in that case,
the machine adapts to change in data and rules and follows the updated path only,
while a rule-based model does what it has been taught once.
data answers
Learning based approach109
rules
110
After training, the machine is now fed with testing data. Now, the testing data might
not have similar images as the ones on which the model has been trained. So, the
model adapts to the features on which it has been trained and accordingly predicts
the output.
In this way, the machine learns by itself by adapting to the new data which is
flowing in.
This is the machine learning approach which introduces the dynamicity in the
model. Generally, learning based models can be classified as follows:
Dimensionality
Regression Classification Clustering
Reduction
I. Supervised Learning
In a supervised learning model, the dataset which is fed to the machine is
labelled. In other words, we can say that the dataset is known to the person who is
training the machine only then he/she is able to label the data. A label is some
information which can be used as a tag for data. For example, students get grades
according to the marks they secure in examinations. These grades are labels which
categorize the students according to their marks.
There are two main types of supervised learning models:
Regression
Supervised
Learning
Classification
a) Classification
In this model, data is classified according to the labels. For
example, in the grading system, students are classified on the basis
of the
grades they obtain with respect to their marks in the
examination. This model works on discrete dataset which
111
b) Regression
This model work on continuous data. For example, if you wish
to predict your next salary, then you would put in the data of your
previous salary, any increments, etc., and would train the model.
Here, the data which has been fed to the machine is
continuous.
Clustering
Unsupervised Learning
Dimensionality Reduction
a) Clustering
It refers to the unsupervised learning algorithm which can cluster
the unknown data according to the patterns or trends identified out of
it. The patterns observed might be the ones which are known to the
developer or it might even come up with some unique patterns out
of it.
b) Dimensionality Reduction
We humans are able to visualize up to 3-Dimensions
113
III. Reinforcement Learning
It a type of machine learning technique that enables an agent(model) to learn in
an interactive environment by trial and error using feedback from its own actions and
experiences. Though both supervised and reinforcement learning use
mapping
between input and output, unlike supervised learning
where feedback provided to the agent(model) is
correct set of actions for performing a
task,
reinforcement learning uses rewards
and punishment as signals
for positive and negative
behavior. Reinforcement learning is all about
5. Evaluation
Evaluation is a process of understanding the reliability of any AI model, based on
outputs by feeding the test dataset into the model and comparing it with actual
answers. i.e. oonce a model has been made and trained, it needs to go through
proper testing so that one can calculate the efficiency and performance of the model.
Hence, the model is tested with the help of Testing Data (which was separated out of
the acquired dataset at Data Acquisition stage.
The efficiency of the model is calculated on the basis of the parameters mentioned below:
1. Accura
cy
Accuracy
is defined
percentage of correct predictions out of all the observations. as
the
2. Precision
Precision is defined as the percentage of true positive cases versus all the cases
where the prediction is true.
3. Recall
Recall is defined as the fraction of positive cases that are correctly Identified.
114
4. F1 score
The F1 score is a number between 0 and 1 and is the harmonic mean of precision and
recall
115
Questions
1 mark
Questions
1) Which of the following is correct about the rule-based approach?
a. We cannot provide enough rules to the machine.
b. A drawback/feature for this approach is that the learning is static.
c. Once the rules are fed into the system, it takes into consideration
any changes made in the original training dataset.
d. It can improve itself based on the feedbacks.
4) Assertion (A): We can use histograms when data is in categories (such as "Pop",
"Rock", ”Jazz”, ”Hip-Hop” etc.)
Reason (R): We use bar charts when we have continuous data (such as a person's
height or weight)
a. (A) is false but (R) is true
b. (A) is true but (R) is false
c. Both (A) and (R) are true
d. Both (A) and (R) are false
5) Choose the correct option
a. Unsupervised learning ->labelled dataset, Regression
b. Supervised learning -> labelled data set, Regression
c. Unsupervised learning ->unlabelled dataset, Classification
d. Supervised learning -> unlabelled data set, Regression
117
d) None of the above
17) Define the term Machine Learning. Also give 2 applications of Machine
Learning in our daily lives.
120
a) Pixel it activity
b) Decision trees
c) Histogram
d) Illustration diagram
21) Match the best choice of graph for the data below.
1. Chart to show the number of students in a school over past 5 years.
2. Chart to show the temperature on each day of the week.
3. Chart to show percentage of each sale of ticket type at a concert
121
28) is one of the types supervised learning model, where
data is classified according labels and data need not be continuous.
[CBSE TERM-1 2021]
a) Regression
b) Clustering
c) Classification
d) Dimensionality reduction
123
d) A is false but R is true.
36) Which type of graphical representation suits best for continuous
type of data like monthly exam scores of a student?
2 Mark Questions
37) What are the two different approaches for AI modelling? Define them
38) Draw the graphical representation of Classification AI model. Explain in brief.
39) Draw the graphical representation of Regression AI model. Explain in brief
40) Draw the graphical representation of Clustering AI model. Explain in brief.
41) Explain Data Exploration stage
3 Mark questions
42) Differentiate between rule-based and learning-based AI modelling approaches.
43) Explain the following:
a. Supervised Learning b. Unsupervised Learning
44) Differentiate between classification and clustering algorithms with the
help of suitable examples.
124
NATURAL LANGUAGE PROCESSING
INTRODUCTION
Computers can understand the structured form of data like spreadsheets and
the tables in the database, but human languages, texts, and voices form an
unstructured category of data, and it gets difficult for the computer to
understand it, and there arises the need for Natural Language Processing.
1. Chatbots
126
question asked and collect all the data from the user that may be required to
answer the question. Then they answer the question appropriately.
3. Voice Assistants
These days voice assistants are all the rage! Whether its Siri, Alexa, or Google
Assistant, almost everyone uses one of these to make
calls, place reminders, schedule meetings, set alarms,
surf the internet, etc. These voice assistants have made
life much easier. But how do they work? They use a
complex combination of speech recognition, natural
language understanding, and natural language
processing to understand what humans are saying and
then act on it. The long term goal of voice assistants is to
become
a bridge between humans and the internet and provide all manner of services
based on just voice interaction. However, they are still a little far from that
goal seeing as Siri still can’t understand what you are saying sometimes!
4. Language Translator
Want to translate a text from English to Hindi but don’t know Hindi? Well,
Google Translate is the tool for you! While it’s not
exactly 100% accurate, it is still a great tool to convert
text from one language to another. Google Translate
and other translation tools as well as use Sequence to
sequence modeling that is a technique in Natural
Language Processing. It allows the algorithm to convert
a sequence of words from one language to another
which is
translation. Earlier, language translators used Statistical machine translation
(SMT) which meant they analyzed millions of documents that were already
translated from one language to another (English to Hindi in this case) and
then looked for the common patterns and basic vocabulary of the language.
However, this method was not that accurate as compared to Sequence to
sequence modeling.
103
5. Sentiment Analysis
good, bad, or neutral. Companies can use sentiment analysis in a lot of ways
such as to find out the emotions of their target audience, to understand
product reviews, to gauge their brand sentiment, etc. And not just private
companies, even governments use sentiment analysis to find popular opinion
and also catch out any threats to the security of the nation.
6. Grammar Checkers
Emails are still the most important method for professional communication.
However, all of us still get thousands of promotional Emails that we don’t want
to
read. Thankfully, our emails are automatically divided into 3 sections
8. Text Summarization
105
Text summarization is the process of creating a shorter version of the text with
only vital information and thus, helps the user to understand the text in a
shorter amount of time. The main advantage of text summarization lies in the
fact that it reduces user’s time in searching the important details in the
document.
There are two main approaches to summarizing text documents –
1. Extractive Method: It involves selecting phrases and sentences from the
original text and including it in the final summary.
Example:
Original Text: Python is a high-level, interpreted, interactive, and object-oriented
scripting language. Python is a great language for the beginner-level programmers.
Extractive Summary: Python is a high-level scripting language is great language for
beginner-level programmers.
2. Abstractive Method: The Abstractive method involves generating
entirely new phrases and sentences to capture the meaning of source
document.
Example:
Original Text: Python is a high-level, interpreted, interactive, and object-oriented
scripting language. Python is a great language for the beginner-level programmers
Abstractive Summary: Python is interpreted and interactive language and it is easy
to learn.
1. Text Classification
Texts are a form of unstructured information that possesses very
prosperous records inside them. Text Classifiers categorize and
arrange exceptionally a great deal with any form of textual content
that we use currently. Text classification makes it possible to assign
predefined categories to a document and organize it to help you find
the information you need or simplify some activities. For example, an
application of text categorization is spam filtering in email. A very
fundamental key and remarks for commercial enterprise would be how
their merchandise is touching their meant buyers and Text
Classification offers solutions to enterprise questions with the aid of
classifying people’s opinions on the stated brand, price, and aspects.
Questions
106
4 Which application of NLP assigns predefined categories to a
document and organize it to help customer to find the
information they
want
5 I used to identify opinions online to help what customers
think about
the products and services. Who am I?
INTRODUCTION TO CHATBOTS
Chatbots is a computer program designed to simulate conversation with human
users, especially over the internet powered by Artificial intelligence.
Eg:
Mitsuku Bot
https://www.pandorabots.com/mitsuku/
https://www.cleverbot.com/
• Jabberwacky*
http://www.jabberwacky.com/
`
• Haptik*
https://haptik.ai/contact-us
107
• Rose*
http://ec2-54-215-197-164.us-west-
1.compute.amazonaws.com/speech.php
• Ochatbot*
https://www.ometrics.com/blog/list-of-fun-chatbots/
108
Types of Chatbots
1. Simple Chatbot (Script bots)
2. Smart Chatbots (AI based Smart bots)
3. After processing the signal, the brain 3. Now, if we want the machine
gains an understanding of its to understand our language,
meaning of it. If it is clear, the signal how should this happen?
gets stored. Otherwise, the listener What are the possible
asks for clarity from the speaker. difficulties a machine would
This is how human languages are face in processing natural
processed by humans. language? Let us take a look
at some of them here:
There are rules in human language. There are nouns, verbs, adverbs, and
adjectives. A word can be a noun at one time and an adjective some other time.
There are rules to provide structure to a language.
Besides the matter of arrangement, there’s also meaning behind the language we
use. Human communication is complex. There are multiple characteristics of the
human language that might be easy for a human to understand but extremely
difficult for a computer to understand.
1. His face turned red after he found out that he had taken the wrong bag
o What does this mean? Is he feeling ashamed because he took another
person’s bag instead of his? Is he feeling angry because he did not
manage to steal the bag that he has been targeting?
2. The red car zoomed past his nose
o Probably talking about the colour of the car, that travelled close to him in a
flash.
3. His face turns red after consuming the medicine
o Is he having an allergic reaction? Or is he not able to bear the taste of that
medicine?
110
Perfect Syntax, no Meaning
111
Sometimes, a statement can have a perfectly correct syntax but it does not mean
anything.
For example
Chickens feed extravagantly while the moon drinks tea.
Sample Questions
1. Which of these chatbots is/are not AI based 1
a) Script bot b) Smart bot c) Hybrid bot d) None of these
Answers
1 A) Script bot
2 AskDISHA 2.0
Activity
1. List some statements with syntax and same semantics and vice-versa.
2. Enact the Smartbot in the class. Incorporate the communication skills.
113
Text Normalisation
He visited Goa
HE VISITED GOA
hE vISItED GoA
1. Sentence Segmentation
Under sentence segmentation, the whole text is divided into individual
sentences. Eg
Hello world.
Hello world. AI is fun to know. It has started impacting our lives in many ways. Many m
AI is fun to know.
It has started impacting our lives in many ways.
Many more revolutionary
will soon
technologies evolve out of it.
114
2.Tokenisation
After segmenting the sentences, each sentence is then further divided into tokens.
Tokens is a term used for any word or number or special character occurring in a
sentence. Under tokenisation, every word, number and special character is
considered separately and each of them is now a separate token.
These words occur the most in any given sentence but talk very little or nothing
about the context or the meaning of it. Hence, to make it easier for the computer to
focus on meaningful terms, these words are removed.
Along with these words, the sentence might have special characters and/or numbers.
Now it depends on the type of sentence in the documents that we are working on
115
whether we should keep them in it or not. For example, if you are working on a
document containing email IDs, then you
116
might not want to remove the special characters and numbers whereas in some
other textual data if these characters do not make sense, then you can remove them
along with the stop words.
Here in this example, the all the 6 forms of hello would be converted to lower case and hence
would be treated as the same word by the machine.
5.Stemming
In this step, the remaining words are reduced to their root words. In other words,
stemming is the process in which the affixes of words are removed and the words
are converted to their base form.
Note that in stemming, the stemmed words (words which are we get after removing
the affixes) might not be meaningful. Here in this example as you can see: healed,
healing and healer all were reduced to heal but studies was reduced to studi after
117
the affix removal which is not a meaningful word. Stemming does not take into
account if the stemmed word is meaningful or not. It just removes the affixes hence
it is faster.
118
6. Lemmatization
Stemming and lemmatization both are alternative processes to each other as the
role of both the processes is same – removal of affixes. But the difference between
both of them is that in lemmatization, the word we get after affix removal (also
known as lemma) is a meaningful one. Lemmatization makes sure that lemma is a
word with meaning and hence it takes a longer time to execute than stemming.
As you can see in the same example, the output for studies after affix removal has
become study instead of studi.
With this we have normalised our text to tokens which are the simplest form of
words. Now it is time to convert the tokens into numbers. For this, we would use the
Bag of Words algorithm
2. The frequency of these words (number of times it has occurred in the whole corpus).
Here calling this algorithm “bag” of words symbolises that the sequence of
sentences or tokens does not matter in this case as all we need are the unique words
and their frequency in it.
Here is the step-by-step approach to implement bag of words algorithm:
121
Document 3: [anil, went, to, download, a, health, chatbot]
Note that no tokens have been removed in the stopwords removal step. It is
because we have very little data and since the frequency of all the words is almost
the same, no word can be said to have lesser value than the other.
Step 2: Create Dictionary
Go through all the steps and create a dictionary i.e., list down all the words which
occur in all three documents:
Dictionary:
Note that even though some words are repeated in different documents, they
are all written just once as while creating the dictionary, we create the list of unique
words.
Since in the first document, we have words: aman, and, anil, are, stressed. So, all
these words get a value of 1 and rest of the words get a 0 value.
Step 4: Repeat for all documents
Same exercise has to be done for all the documents. Hence, the table becomes:
122
In this table, the header row contains the vocabulary of the corpus and three rows
correspond to three different documents. Take a look at this table and analyse the
positioning of 0s and 1s in it.
Finally, this gives us the document vector table for our corpus. But the tokens have
still not converted to numbers. This leads us to the final steps of our algorithm:
TFIDF.
123
Take a look at this graph. It is a plot of occurrence of words versus their value.
As you can see, if the words have highest occurrence in all the documents of the
corpus, they are said to have negligible value hence they are termed as stop words.
These words are mostly removed at the pre-processing stage only. Now as we move
ahead from the stop words, the occurrence level drops drastically and the words
which have adequate occurrence in the corpus are said to have some amount of
value and are termed as frequent words. These words mostly talk about the
document’s subject and their occurrence is adequate in the corpus. Then as the
occurrence of words drops further, the value of such words rises. These words are
termed as rare or valuable words. These words occur the least but add the most
value to the corpus. Hence, when we look at the text, we take frequent and rare
words into consideration.
TFIDF stands for Term Frequency and Inverse Document
word.
Term Frequency
Term frequency is the frequency of a word in one document. Term frequency can
easily be found from the document vector table as in that table we mention the
frequency of each word of the vocabulary in each document.
124
Here, you can see that the frequency of each word for each document has been
recorded in the table. These numbers are nothing but the Term Frequencies!
Here, you can see that the document frequency of ‘aman’, ‘anil’, ‘went’, ‘to’ and ‘a’
is 2 as they have occurred in two documents. Rest of them occurred in just one
document hence the document frequency for them is one.
Talking about inverse document frequency, we need to put the document frequency
in the denominator while the total number of documents is the numerator. Here, the
total number of documents are 3, hence inverse document frequency becomes:
125
Here, you can see that the IDF values for Aman in each row is the same and similar
pattern is followed for all the words of the vocabulary. After calculating all the
values, we get:
126
Finally, the words have been converted to numbers. These numbers are the
values of each for each document. Here, you can see that since we have less amount
of data, words like ‘are’ and ‘and’ also have a high value. But as the IDF value
increases, the value of that word decreases. That is, for example:
Total Number of documents: 10
Number of documents in which ‘and’ occurs: 10
Therefore, IDF(and) = 10/10 = 1
Which means: log (1) = 0. Hence, the value of ‘and’ becomes 0.
On the other hand, number of documents in which ‘pollution’ occurs: 3
IDF(pollution) = 10/3 = 3.3333…
Which means: log (3.3333) = 0.522; which shows that the word ‘pollution’ has
considerable value
in the corpus.
Summarising the concept, we can say that:
1. Words that occur in all the documents with high term frequencies have the
least values and are considered to be the stop words.
2. For a word to have high TFIDF value, the word needs to have a high term
frequency but less document frequency which shows that the word is
important for one document but is not a common word for all documents.
3. These values help the computer understand which words are to be considered
while processing the natural language. The higher the value, the more
important the word is for a given corpus.
4.
Applications of TF-IDF
1. Document Classification: TF-IDF helps in classifying the type and genre of
a document by looking at the frequencies of words in the text. Based on
the TF-IDF values, it is easy to classify emails as spam or ham, to classify
news as real or fake and so on.
2. Topic Modelling: It helps in predicting the topic for the corpus. Topic
modelling refers to a method of identifying short and informative
descriptions of a document in a large collection that can further be used
for various text mining tasks such a summarisation, document
classification etc.
127
3. Key word Extraction: It is also useful for extracting keywords from text.
4. Information Retrieval System: To extract the important information out of a
corpus.
128
5. Stop word Filtering: It helps in removing unnecessary words out of a text body.
NLTK is a leading platform for building Python programs to work with human
language data. It provides easy-to-use interfaces to over 50 corpora and lexical
resources such as WordNet, along with a suite of text processing libraries for
classification, tokenization, stemming, tagging, parsing, and semantic reasoning,
wrappers for industrial-strength NLP libraries, and an active discussion forum.
NLTK is suitable for linguists, engineers, students, educators, researchers, and
industry users alike. NLTK is available for Windows, Mac OS X, and Linux. Best of all,
NLTK is a free, open source, community-driven project.
NLTK has been called “a wonderful tool for teaching, and working in, computational
linguistics using Python,” and “an amazing library to play with natural language.”
Natural Language Processing with Python provides a practical introduction to
programming for language processing. Written by the creators of NLTK, it guides the
reader through the fundamentals of writing Python programs, working with corpora,
categorizing text, analyzing linguistic structure, and more.
Installing NLTK
Mac/Unix
Windows
These instructions assume that you do not already have Python installed on your machine.
129
After installing the NLTK package, please do install the necessary datasets/models for specific
functions to work.
If you’re unsure of which datasets/models you’ll need, you can install the “popular” subset of
NLTK data, on the command line type python -m nltk.downloader popular, or in the Python
interpreter import nltk; nltk.download('popular')
For details, see https://www.nltk.org/data.html
*********************************************************************************************
*******
131
Document 1: Divya and Rani both are stressed
Note that no tokens have been removed in the stopwords removal step.It
is because we have very little data and since the frequency of all the
words is almost the same, no word can be said to have lesser value than
the other.
Dictionary:
In this step, the repeated words are written just once and we create a list of
The formula is
133
Total Number of documents: 10
This means log(3.3333) = 0.522; which shows that the word ‘pollution’ has
considerable
value in the corpus
***************************************************************************************
*****
Ha! Ha!
1. Create document vectors for the given documents (Term Frequency Table)\
134
2. Record the occurrence of the word in the document using term
frequency table (Document Frequency Table)
3. Draw the inverse document frequency table wherein, we need to put the
document frequency in the denominator while the total number of documents
is the numerator. Here, the total number of documents are 4, hence inverse
document frequency becomes:
4. The formula of TFIDF for any word W becomes: TFIDF(W) = TF(W) * log (IDF(W))
135
MCQ (Answers are bolded)
137
a) Syntax b) Semantics c) Tokens d) Stop words
138
1. What is text normalisation?
139
Text normalisation is the process to reduce the variations in text’s word forms to a
common
form when the variations mean the same thing.
2. What is a corpus?
The whole collection of words from all the documents being processed is called
corpus.
3. What is tokenisation?
Tokenisation is the process of splitting up individual sentences into smaller
units called token.
4. What are stop words?
Stop words are words in any language which do not add much
meaning to a sentence.
5. What do you mean by stemming?
The process of extracting the root form of the word by removing
affixes is known as stemming.
6. What is lemmatisation?
It is the process of converting a word to its actual root form linguistically.
7. What is case normalisation?
Case normalisation refers to conversion of all the words in the
same case. (often lower case)
8. What is Bag – of-words?
Bag – of-words is a model used for extracting features from text for use
14. How many tokens are there in the sentence given below?
Traffic Jams have become a common part of our lives nowadays. Living in an
urban area means you have to face traffic each and every time you get out
on the road. Mostly, school students opt for buses to go to school.
140
Ans: 46 tokens
141
15. Identify the stop words in the given sentence:
Pollution is the introduction of contaminants into the natural environment that
cause adverse change. The three types of pollution are air pollution, water
pollution and land pollution.
Stem is the root word generated by stemming process and the lemma is the root
word generated by lemmatisation process.
Stemming and Lemmatisation both generate the foundation sort of the inflected
words, but the difference between a stem and a lemma is that a stem may not
be an actual word in the dictionary, whereas, a lemma is an actual language
word.
143
2. What is lemmatisation?
For example, in lemmatisation the word “studied” get reduced to its lemma
‘study’ similarly, the word ‘advisable’ gets reduced to its lemma ‘advise’.
4. What is NLTK?
NLTK is a Python Package that you can use for NLP.It is a platform used for
building Python programs that work with human language data for applying in
statistical natural language processing (NLP). It contains text processing
libraries for tokenisation, parsing, classification, stemming, tagging and
semantic reasoning.
Very Long Answer Questions (4 marks)
1. What is text normalisation? What is its use in NLP?
Text normalisation is the process of transforming a text into a canonical (standard)
form, e.g.
the word “gooood” and “gud” can be transformed to “good” , its canonical form .
After text normalisation, only the real, contributing words are left in the text,
which is useful in NLP in two ways:
(i) The dataset size is now reduced with unimportant words removed and
thus less processing is required.
(ii) It is easier to gauge the intent from the remaining words.
144
Explain. The steps of Text normalisation
are:
1. Sentence Segmentation: It is the process of dividing the whole text
into smaller components, i.e., individual sentences
2. Tokenisation is the process of splitting up individual sentences into smaller
units called token.
145
3. Removing punctuation and stop words: In this step, the unnecessary tokens
are removed from the token list.
4. Stemming: In this step the remaining words are reduced to their root words
5. Converting text to a common case: Here the whole text is converted into a
similar case, preferably lower case.
6. Lemmatisation: It is the process of converting a word to its actual root form
linguistically.
3. Explain from the given graph, how the value and occurrence of a word are
related in a corpus?
As shown in the graph, occurrence and value of a word are inversely proportional.
The words which occur most (like stop words) have negligible value. As the
occurrence of the words drops, the value of such words rises. These words are
termed as rare or valuable words. These words occur the least but add the most
value to the corpus.
147
EVALUATION
Activity: 1
Imagine that you have come up with an AI-based prediction model which has been
deployed on the roads to check traffic jams. Now, the objective of the model is to
predict whether there will be a traffic jam or not. Now, to understand the efficiency
of this model, we need to check if the predictions which it makes are correct or not.
Thus, there exist two conditions which we need to ponder upon: Prediction and
Reality.
Traffic Jams have become a common part of our lives nowadays. Living in an urban
area means you have to face traffic each and every time you get out on the road.
Mostly, school students opt for buses to go to school. Many times, the bus gets late
due to such jams and the students are not able to reach their school on time.
Considering all the possible situations make a Confusion Matrix for the above situation.
Ans:
Case 1: Is there a traffic Jam?
Prediction: Yes Reality: Yes True Positive
The Reality
confusio Yes No
n Matrix
True Positive False Positive
Yes
Predic TP FP
ti on False Negative True Negative
No
FN TN
Activity: 2
Shweta is learning NLP. She read about the F1 score but did not understand the
need for the F1 score formulation. Support her by giving an answer.
Ans.:
148
The F1 score is also known as the F score or F measure of AI model’s test accuracy. It is
calculated from the precision and recall of the test. Here
149
1) The precision is the number of correctly recognized positive results divided by
the number of all positive results, including those not identified correctly.
2) The recall is the number of correctly identified positive results divided by the
number of all samples that should have been identified as positive.
3) The F1 score is defined as the harmonic mean of the test’s precision and recall.
The formula of F1 score is as below:
(𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 𝑋 𝑅𝑒𝑐𝑎𝑙𝑙)
(𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛+𝑅𝑒𝑐𝑎𝑙𝑙)
F1 Score =2X
i) A good F1 score means that you have high true positives and high true
negatives. It means that the machine is correctly identifying real threats and not
disturbs the users by false alarms.
ii) An F1 score is considered perfect when it’s 1 while the model is a total failure when it’s
0.
Activity: 3
Calculate accuracy, precision, recall, and F1 score for the following Confusion Matrix.
Suggest which metric would not be a good evaluation parameter and why?
The Realit
Reality:
Confusio y: 1
0
n Matrix
50 30
Prediction:
1 TP FP
15 25
Ans: Prediction: 0
FN TN
a) Accuracy: It is defined as the percentage of correct predictions out of all the observations.
(𝑇𝑃+𝑇𝑁)
(𝑇𝑃+𝐹𝑁+𝑇𝑁+𝐹𝑃)
Accuracy= x100%
𝑥100%=
(50+25)
(50+15+25+3 80 x100%= 0.67
0)
120
150
b) Precision: It is defined as the percentage of true positive cases versus all the
cases where the prediction is true.
151
= 0.625
𝑇𝑃
50
(𝐹𝑃+𝑇𝑃) 50
Precision =
80
=
=(30+50
)
c) Recall: It is defined as the fraction of positive cases that are correctly identified.
𝑇𝑃
(𝐹𝑁+𝑇𝑃) =50 = 0.769
Recall =
50
=(15+50 65
)
1) False Positive: Suppose if we see the above confusion matrix for the heart attack
cases then a person is predicted with heart attack but does not have heart attack
in reality.
2) False Negative: A person is predicted with no heart attack but in reality person
is suffering from the heart attack.
Hence False negative miss the actual patients. So recall needs more improvement.
Activity: 4
In schools, a lot of times it happens that there is no water to drink. At a few places,
cases of water shortage in schools are very common and prominent. Hence, an AI
model is designed to predict if there is going to be a water shortage in the school in
the near future or not. The confusion matrix for the same is:
The
Confusion Reality: Reality: 0
1
Matrix
22 12
Prediction:
1 TP FP
47 118
Prediction: 0
FN TN
Find out Accuracy, Precision, Recall and F1 Score for the given problems.
Ans:.
152
Calculation:
(𝑇𝑃+𝑇𝑁)
1.
(𝑇𝑃+𝐹𝑁+𝑇𝑁+𝐹𝑃)
Accuracy= x100%
153
𝑥100%=
(22+118) 140
(22+47+118+1 199
x100%= 0.703
2)
𝑇𝑃
(𝐹𝑃+𝑇𝑃) 22
2. Precision =
=(12+22 = 0.647
)
𝑇𝑃
(𝐹𝑁+𝑇𝑃) 22
3. Recall =
=(47+22 = 0.318
)
4. (𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 𝑋 𝑅𝑒𝑐𝑎𝑙𝑙)
(𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛+𝑅𝑒𝑐𝑎𝑙𝑙)
F1 Score =2X
Accuracy = 0.703
Precision = 0.647
Recall = 0.318
F1 Score =
0.426
154
ADVANCE PYTHON
Jupyter Notebook
The Jupyter Notebook is an incredibly powerful tool for interactively developing and
presenting AI related projects. The Jupyter project is the successor to the earlier
IPython and it is an interactive way of running python code in the terminal using the
REPL model. (Read Eval Print Loop)
155
Prompt with the help of a local host
156
>python-m pip install jupyter
Virtual environment
Imagine a scenario where we are working on two Python-based projects and one of
them works on Python 2.7 and the other uses Python 3.7. In such situations virtual
environment can be really useful to maintain dependencies of both the projects as
the virtual environments will make sure that these dependencies are not conflicting
with each other and no impact reaches the base environment at any point in time.
Thus, different projects developed in the system might have another environment to
keep their dependencies isolated from each other.
Creating virtual environments is an easy task with Anaconda distribution. Steps to create
one are:
2. As we open the Anaconda prompt, we can see that in the beginning of the
prompt message, the term (base) is written. This is the default environment in
which the anaconda works. Now, we can create our own virtual environment
and use it so that the base does not get affected by anything that is done in
the virtual environment.
157
3. Let us now create a virtual environment named env. To create the environment,
write conda create -n env python=3.7
4. After some processing, the prompt will ask if we wish to proceed with installation
or not. Type y on it and press enter. Once we press enter, the packages will start
getting installed in the environment.
5. Depending upon the internet speed, the downloading of packages might take
varied time. The processing screen will look like this:
6. Once all the packages are downloaded and installed, we will get a message like this
7. This shows that our environment called env has been successfully created. Once
an environment has been successfully created, we can access it by writing the
following:
158
This would activate the virtual environment and we can see the term written in
brackets has changed from (base) to (env).Now our virtual environment is ready to
be used.
But, to open and work with jupyter notebooks in this environment, we need to install
the packages which help in working with jupyter notebook. These packages get
installed by default in the base environment when anaconda gets installed.
It will again ask if we wish to proceed with the installation, type Y to begin the
installation. Once the installations are complete, we can start working jupyter
notebooks in this environment.
Introduction to Python
Python is a programming language which was created by Guido Van Rossum . It can
be used to follow both procedural approach and object-oriented approach of
programming. Python has a lot of functionalities which makes it so popular to use.
159
Applications of Python
There exist a wide variety of applications when it comes to Python. Some of the
applications are:
160
PYTHON BASICS
Comments
Comments are the statements which are incorporated in the code to give a better
understanding of code statements to the user.
1. Single Line
2. Multi Line
A single-line comment is used to add some explanatory text in the program for better
understanding of the next line. A # sign is used to write a single line comment in the
python program
For example,
# statement to add two
numbers res = 6 + 7
#Print the result
print(res)
Multiline comments
The multiline comments are written in python using triple quotes. You can write
number lines starting with triple quotes and end with triple quotes.
For example,
'''Write a python program to display the difference between two numbers, the first
number should be larger than second number'''
n1=5
n2=2
res=n1 - n2
print(res)
Keywords are the reserved words or pre-defined words with a special meaning to the
machine by default. So the user cannot use them anywhere else or it cannot be
changed or modified in the entire program. They are always case-sensitive.
141
Identifiers
Identifiers are names used in programs to identify small units of programs such
as variables, objects, classes, functions etc.
Identifiers defined by the following few rules as follows:
differently Examples:
142
Variables
A variable is a named location used to store data in the memory. It is helpful to think
of variables as a container that holds data which can be changed later throughout
programming.
For example,
a=10
b=20
These declarations make sure that the program reserves memory for two variables
with the names a and b. The variable names stand for the memory location.
Note:
Datatypes
In program, you have a choice to use any type of data such as real numbers,
numbers with decimals, numbers without decimals, text, etc. These type of data is
defined by datatype in Python. The python interprets the type of the variable
according to the value stored in the variable. Follow the below-given link to know
more about data types.
143
Python Input and Output
We use the print() function to output data to the standard output device (screen). We
can also output data to a file.
An example is given
below. a = "Hello
World!" print(a)
The output of the above code will be: Hello World!
a = 20 30
b = 10
print(a + b)
print(15 + 35) 50
144
input() function
The input() function is used to accept values from the user at runtime. This function
accepts and returns the text data by default. Therefore, you need to specify the data
type if you want to use numbers or any other datatype. This process is known as
typecasting
Python Operators
Operators are special symbols which represent computation. They are applied on
operand(s), which can be values or variables. Same operators can behave differently
on different data types. Operators when applied on operands form an expression.
Operators are categorized as Arithmetic, Relational, Logical and Assignment
operators. Values and variables when used with operators are known as
operands.
145
Conditional Statements
146
condition which gets fulfilled. There exist different types of conditional statements in
Python.
147
Some of them are:
Simple if Statement
If you have only one condition to be execute or one possibility of output, simple if
statement is useful for the same. Simple it executes the True condition block.
Suppose, If gate is open you are allowed to go inside!
if <condition>:
statement(s)
Example:
gate_status =
"open"
if gate_status=="open":
print("Entry is permitted")
if else statement
148
If else statement evaluates the test expression and will execute body of if only if the
condition is true . If the condition is false body of else will be executed .The blocks
are separated using proper indentation.
if <condition>:
statement(s)
else:
statement(s)
Python if-elif-else ladder is used in the case when you have more than two choices or
possibilities. The elif is a short form of else if. The ladder means it will continue upto
n possiblities.
if <condition1>:
statement(s)
elif <condition2>:
149
statement(s)
elif <condition3>:
150
statement(s)
....
....
....
else:
statement(s)
Example :
if num > 0:
print("Positive
number") elif num == 0:
print("Zero")
else:
print("Negative number")
Python loops
151
Loops are a collection of statements executed repeatedly until the condition
evaluates to false. It is also known as iteration or iterative statements. It can be also
considered as step by step execution of python statements until the condition
evaluates to false.
Types of Loop
1. While: A while loop is used when you have different repetitive statements with
a single condition. When the condition gets false, your loop will terminate itself.
While loop may have else block too quite often.
2. For: The easy and popular loop is for a loop. It is very easy to write and
understand because all the parts of loops are written in the same line in for
loop. It will reduce the lines of codes as three parts of loops are written in a
single line.
while loop
152
Observe this code which displays a series of numbers from 1 to 10.
153
i=1
while i<=10:
print(i
) i=i
+1
print("End of loop")
For Loop
The for loop is used to execute the sequence of statements executed in a series. It is
the most popular loop among python developers. It is also work in a similar way as
while loop is working. Observe the syntax of for loop:
for <variable> in
<sequence>: body
loop
So here variable is a variable from and then you can take a sequence to execute the
statements. The in operator is used to take check the value in the specified
sequence.
The range() function takes three basic parameters. The first is a start, the second is a
stop and the third is a step.
range(start,stop,ste
p) for i in
range(1,10,1):
print(i)
In the above code, the range function is used. Hence, the loop starts with 1, stops
with 9 and taking one step in every execution. The output will be 1 to 9 numbers
only.
PYTHON PRACTICALS :
154
1 Display the message “Welcome to Python "
2 Print your School Address
3 Sum of 2 numbers
4 Sum and Average of 3 numbers
5 Area and perimeter of a circle
6 Square and Cube of a Number
7 Area and perimeter of a Rectangle
8 Calculate Percentage after inputting 5 marks
9 Area of a triangle
10 Arithmetic Operations (+,-,*,?)
11 Calculate Simple Interest
CONDITIONAL STATEMENTS
12 Check whether a given number is even or odd using if else
13 Largest among two numbers using if else
42 Print day name in words using if elif else ladder
Print the grade of a student based on percentage using if elif else
15 ladder after inputting marks in 5 subjects
16 Print a single digit in words using if elif else ladder
17 Design a four function calculator using if elif else ladder
18 Electricity Bill Calculation using if else if ladder
LOOPING STATEMENTS
19 Print natural numbers upto N
20 Print sum of natural numbers upto N
21 Printing even no.s upto a limit
23 To check whether a number is Armstrong or not
24 To find the reverse of a number
25 Print Fibonacci series up to N
26 Find the Factorial of a number
27 Print Multiplication Table
28 Find the Sum and Average of even and odd numbers from a set of N
numbers
29 Find the Largest among N numbers
155
DATA SCIENCES
Python for Data science
Every AI project requires a programming-based model which is trained to produce
outcomes. Data Sciences also are heavily dependent on programming language that
is capable of processing large amounts of data while applying data science functions.
Python is one such language and is mostly used I data science projects.
Numpy
Numpy, which stands for Numerical Python,
Python library that provides functionality to do the following:
Create a multidimensional array object (called ndarray or Numpy array).
Providing tools for working with
ndarrays, Numpy Arrays
An array in general refers to named group of homogeneous elements
A Numpy array is simply a grid that contains values of the
same/homogeneous type. import numpy as np
list =[1, 2,3,4]
A1=np.array(list)
print(a1)
Although Numpy Arrays look similar to python Lists.
Difference between Numpy Array and Python Lists
Lists Numpy Arrays
Python lists can store any type of Numpy Arrays can store only
data and mixed type of data in homogeneous data in them
them.
Lists are part of core Python so no Numpy arrays require Numpy
library is needed to create them. library to be imported first of all
that is following statement must be
first written in the program before
using Ndarrays
Import Numpy as np
Lists size can easily be changed Numpy arrays cannot be
resized directly.
Mathematical functions cannot be Ndarray support vector operations
applied directly to lists. and hence mathematical and
statistical can be directly applied
to Ndarray elements.
156
Lists consume more memory than Ndarrays are faster than lists.
Ndarray.
Adding new elements to a list does Adding new elements to an Ndarray
not create a new lists. internally creates anew Ndarray and
old ndarray is deleted
PANDAS
Pandas or Python pandas are python’s library for data analysis. Pandas have derived
its name from “Panel data system” which is an econometrics term for multi -
dimensional, structured data sets.
Pandas is a software library written for the python programming language for data
manipulation and analysis, and are a popular choice for data science.
The Pandas library has two primary data structure, Series (1-dimensional) and Data
frame (2- dimensional), that can handle the vast majority of typical use cases in
finance, statistics, social science, and many areas of engineering.
import pandas as
pd Example:
import pandas as pd
mydataset = {
'cars': ["BMW", "Volvo",
"Ford"], 'passings': [3, 7, 2]
}
myvar =
pd.DataFrame(mydataset)
print(myvar)
MATPLOTLIB
Matplotlib is a Python library used for Data Visualization. Data Visualization is an
essential component of data sciences.
import matplotlib as mp1
You can create bar-plots, scatter-plots, histograms and a lot more visualizations with
Matplotlib.
Data Visualization
Data Visualization basically refers to the graphical or visual representation of
157
information and data using visual elements like charts, graphs, and maps etc.
For data visualization in python, the Matplotlib library’s Pyplot interface is used.
158
Pyplot is a collection of methods within matplotlib library which allows user’s to
construct 2D plots easily and interactively.
1. Line Chart
A line chart or line graph is a type of chart which displays information as a series of
data
points called ‘markers’
A line chart is created using plot() function.
2. Bar Chart
A bar chart or bar graph is a chart or graph that presents categorical data with
rectangular bars with heights or lengths proportional to the values that they
represent.
With Pyplot, a bar chart is created using bar() and barh() functions.
3. Scatter Plot
The scatter plot is similar to a line chary, the major difference is that while line
graph connects the data points with a line, scatter chart simply plots the data
points to show the trend in the data.
With Pyplot, a scatter chart is created using scatter () function.
4. Pie Chart
A pie chart is a circular statistical graphic, which is divided into slices to illustrate
numerical proportion.
With Pyplot, a pie chart is created using pie () function.
5. Histogram Plot
A histogram is atype of graph that provides a visual interpretation of
numerical data by indicating the number of data points that lie within a
range of values.
With Pyplot, a histogram is created using hist () function.
6. BoxPlot Chart
A Box Plot is the visual representation of the statistical five number summary of a
given data set.
With Pyplot, a boxplot is created using boxplot () function.
STATISTICAL LEARNING
Data processing mainly aims at transforming data into a form most suited for an
application. There are many statistical techniques used for data processing some
basic and commonly used statistical techniques useful for different types of
measures.
MEASURES OF CENTRAL TENDENCY
A measure of central tendency is a single value that attempts to describe a set of
data by identifying the central position within that set of data. The most common
measures of central tendency are mean, median, and mode.
159
1. Mean
The measure of central location.
160
statistics.mean()
2. Median
Another measure of central location that, unlike the mean is not affected by
extremely large or extremely small data values.
statistics.median()
3. Mode
The data entry that occurs with the greatest frequency.
statistics.mode()
Measures of Variability
Measures of variability refer to the scatter or spread of scores around their central
tendency. The measures of variability indicate how the distribution scatters above
and below the central tendency. The most common measures of variability are
range, variance, and standard deviation.
Range
The Range is the difference between the lowest and highest values of a given set of
values. Range=(Max.data entry)-(Min.data entry)
Variance
The variance is the average of the squared differences from the mean.
statistics.variance()
Standard Deviation
Standard Deviation is a statistic used to describe the spread of data about the mean,
which is found by calculating the positive square root of the variance.
statistics.stdev()
161
Example:
import numpy
speed = [99,86,87,88,111,86,103,87,94,78,77,85,86]
x = numpy.mean(speed)
print(x)
output
89.76923076923077
KNN is a simple, supervised machine learning (ML) algorithm that can be used for
classification or regression tasks - and is also frequently used in missing value
imputation. It is based on the idea that the observations closest to a given data
point are the most "similar" observations in a data set, and we can therefore classify
unforeseen points based on the values of the closest existing points. By choosing K,
the user can select the number of nearby observations to use in the algorithm.
KNN is a supervised Learning algorithm that classifies a new data point into the
target class, counting on the features of its neighbouring data points.
Features: The variables based on which similarity between two points is calculated.
Scoring function: The function which finds the majority score and class for the query
point.
163
• For Recommender system
• For Looking for similar documents
• For Text categorisation
• For Detecting frauds
• In Health and Medicine
• For Estimating soil Water parameter
Practicals
1.
import numpy as np
arr = np.array([1, 2, 3, 4,
5]) print(arr)
2.
import numpy as
np arr =
np.array(42)
print(arr)
3.
import pandas as pd
mydataset = {
'cars': ["BMW", "Volvo", "Ford"],
'passings': [3, 7, 2]
}
myvar =
pd.DataFrame(mydataset)
print(myvar)
4.
import pandas as
pd a = [1, 7, 2]
myvar = pd.Series(a)
print(myvar
) 5.
164
import pandas as pd
data = {
165
"calories": [420, 380, 390],
"duration": [50, 40, 45]
}
myvar = pd.DataFrame(data)
print(myvar)
6.
import statistics
print(statistics.mean([1, 3, 5, 7, 9, 11, 13]))
print(statistics.mean([1, 3, 5, 7, 9, 11]))
print(statistics.mean([-11, 5.5, -3.4, 7.1, -9, 22]))
7.
import statistics
print(statistics.median([1, 3, 5, 7, 9, 11, 13]))
print(statistics.median([1, 3, 5, 7, 9, 11]))
print(statistics.median([-11, 5.5, -3.4, 7.1, -9, 22]))
8.
import statistics
print(statistics.mode([1, 3, 3, 3, 5, 7, 7 9, 11]))
print(statistics.mode([1, 1, 3, -5, 7, -9, 11]))
print(statistics.mode(['red', 'green', 'blue', 'red']))
9.
import statistics
print(statistics.stdev([1, 3, 5, 7,
9, 11]))
print(statistics.stdev([2, 2.5, 1.25, 3.1, 1.75, 2.8]))
print(statistics.stdev([-11, 5.5, -3.4, 7.1]))
print(statistics.stdev([1, 30, 50, 100]))
10.
import statistics
print(statistics.variance([1, 3, 5, 7,
9, 11]))
print(statistics.variance([2, 2.5, 1.25, 3.1, 1.75, 2.8]))
print(statistics.variance([-11, 5.5, -3.4, 7.1]))
print(statistics.variance([1, 30, 50, 100]))
11.
import matplotlib.pyplot as
plt import numpy as np
xpoints = np.array([1, 2, 6, 8])
ypoints = np.array([3, 8, 1,
10]) plt.plot(xpoints,
ypoints) plt.show()
166
QUESTIONS
I. One mark question:
1. A python package which stands for ‘Numerical Python’ is named and used as
in Python programs.
2. is another name for Numpy arrays.
3. Series is a data structure belonging to python’s library.
4. The is the mathematical average of a set of data value.
5. KNN refers to .
167
COMPUTER VISION
169
Agriculture: Drones mounted with computer vision technology are being used for
crop monitoring. Computer vision systems can monitor animals such as cattle, sheep,
pigs or other with cameras
Google Translate App: By using optical character recognition to see the image and
augmented reality to overlay an accurate translation, Google translate app is a
convenient tool that uses Computer Vision to read signs in a foreign language and to
translate it to your preferred language.
Questions
Fill in the blanks
1. Emoji Scavenger Hunt game is based on technology.
2. A is a computer vision-based technology that identifies or verifies or
matches a digital image of a human face against a database of stored face
image.
3. refers to a search where the search query is formed using a pasted
image and the search engine looks for matching or similar images from around
the web.
4. Google reverse image search facility is officially known as
5. technology makes computers, machines and devices analyse and
understand the images captured by camera.
Short Answer Questions
1. What is computer vision?
2. What are some applications of computer vision?
3. What is reverse image search?
Answers
1. CV
2. Facial recognition
3. Reverse Image Search
4. Google Search by Image
5. CV
Computer vision concepts
Digital Images used with C
1. Pixel: - A pixel represents the smallest piece of the screen that can be
controlled individually in terms of colour and intensity.
170
2. Pixel Colour and Intensity: - Combination of three different colour signals- Red,
Green, Blue
(RGB) ◦ White - (255,255,255) ◦ Black - (0,0,0)
171
3. Resolution: - It refers to the quality and size of an image in terms of the number of
pixels it
contains, typically as ‘width x height’. ◦ Eg:- 100 * 100 pixel image has a total of 10000 pixels.
4. Colour Depth / Pixel Value: - The amount of information that is stored about a
pixel determines its colour depth (pixel value), which controls how precisely
the pixel’s colour can be specified.
5. Grayscale Images:- It is an image in which the only colours are shades of gray
172
Image Features:
An image feature is a measurable piece of data in image which is unique to this
specific object, such as a distinct colour, specific shape or an image segment
174
2. Image...........refers to the quality and size of an image in terms of the number of
pixels it
contains, typically as ‘width x height’.
Ans: Resolution
3. RGB value..............represents black colour.
Ans: (0,0,0)
4. RGB value..................represents white colour.
Ans: (255,255,255)
5. An....................is a measurable piece of data in your image which is unique to this
specific
object, such as a distinct colour, specific shape or an image segment.
Ans: Image feature
OpenCV
OpenCV or Open-Source Computer Vision Library is that tool which helps a
computer extract these features from the images. It is used for all kinds of images
and video processing and analysis. It is capable of processing images and videos
to identify objects, faces, or even handwriting.
To install OpenCV library, open anaconda prompt and then write the following
command:
pip install opencv-python
175
In order to work with OpenCV in Python programs or scripts, import the module first.
import cv2 # import OpenCV
from matplotlib import pyplot as plt # import matplotlib
176
import numpy as np # import numpy
We import numpy as we want to store the pixel values in the numpy array We
import matplotlib to allow us to display our images on the Jupyter notebook itself
img = cv2.imread('Images/man.jpg')
plt.imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
plt.title('man')
plt.axis('on')
plt.show()
177
roi = img[1500:2500,1000:2000] #img[range of y, range of x]
plt.imshow(cv2.cvtColor(roi, cv2.COLOR_BGR2RGB))
plt.title('man')
plt.axis('off')
plt.show()
Convolutional Layer
The convolutional layer is where the action begins. The convolutional layer is
designed to discover image features.
Convolutional Layer is the backbone of CNN working model. In this layer, pixel by
pixel scanning takes place of the images and then it creates a feature map to define
future classification
As per its name, this layer uses convolution operation on the images with the help of
several kernels to produce several features such as edges, colour, gradient
orientation, etc. This way collected outputs (features) are gathered in the form of
Feature Map or the Activation Map.
180
Rectified Linear Unit layer (aka ReLu)
This layer is considered as an extension of a convolutional layer. The goal of
ReLu is to increase the image’s non-linearity. It is the technique of removing
excess fat from a picture in order to improve feature extraction.
Pooling layer
The pooling layer is used to minimize the number of input parameters, i.e. it
focuses on the most important aspects of the information obtained.
Connected layer
It is a standard feed-forward neural network. It’s the last straight line before the finish
line,
where everything is already visible. It’s only a matter of time until the results are
confirmed.
we see
the
two
graphs
side
by
side,
the
one on
the left
is a
linear
graph.
This
grap
h
when passed through the ReLU layer, gives the
one on the right. The ReLU graph starts with a horizontal straight line and then
increases linearly as it reaches a positive number.
181
Now the question arises, why do we pass the feature map to the ReLU layer? it is to
make the colour change more obvious and more abrupt
As
shown in the above convolved image, there is a smooth grey gradient change from
black to white. After applying the ReLU function, we can see a more abrupt change in
colour which makes the edges more obvious which acts as a better feature for the
further layers in a CNN as it enhances the activation layer
Pooling Layer
The Pooling layer is responsible for reducing the spatial size of the Convolved
Feature while still retaining the important features.
There are two types of pooling which can be performed on an image.
1) Max Pooling: Max Pooling returns the maximum value from the portion of the
image covered by the Kernel.
2) Average Pooling: Average Pooling returns the average value from the portion of
the image covered by the Kernel.
The pooling layer is an important layer in the CNN as it performs a series of tasks
which are as follows :
1) Makes the image smaller and more manageable
182
2) Makes the image more resistant to small transformations, distortions and
translations in the input image.
183
Testing CNN
Now let us see how this comes into practice. To see that, go to the link
http://scs.ryerson.ca/~aharley/vis/conv/flat.html
This is an online application of classifying different numbers. We need to analyse the
different layers in the application on the basis of the CNN
What is a kernel?
In Convolutional neural network, the kernel is nothing but a filter that is used to
extract the features from the images. A Kernel is a matrix used for applying various
effects on image through convolution such as for blurring, sharpening, embossing,
edge detection and more
In Image processing, the Kernel’s value depends upon the type of effect being
applied. The output of the convolution process changes with the changing kernel
values(Fig 3.3).For example , for sharpening the image, the kernel values will be
different from the blurring kernel. And accordingly the same picture will look different
with one thing common that the same effect will be applied to each pixel of the
image
a) ReLU b) Kernel
c) Pooling d) None of these
3) Which of the following is not a layer of the CNN architecture?
184
a) Convolutional layer b) ReLU layer
b) c) Pooling layer d) Flattening layer
185
4) In a CNN, which of these layers use convolution operation on the images with
the help of several kernels?
186
5 Define the term ‘Kernel’?
Ans) A Kernel is a matrix used for applying various effects on image
through convolution such as for blurring, sharpening, embossing, edge
detection and more In Convolutional neural network, the kernel is
nothing but a filter that is
used to extract the features from the images
187
PRACTICAL PROGRAMS
PROGRAM NO-1
Python Basics-1
AIM- Write a Python program to print the following string in a specific format.
SOURCE CODE-
print("Twinkle, twinkle, little star, \n\tHow I wonder what you are! \n\t\tUp a
OUTPUT-
RESULT- The source code is executed successfully and the output was verified.
188
PROGRAM NO-2
Python Basics-2
AIM- Write a Python program to print 5 lines about yourself using print() function.
SOURCE CODE-
OUTPUT-
RESULT- The source code is executed successfully and the output was verified.
189
PROGRAM NO-3
Python Basics-3
190
OUTPUT-
RESULT- The source code is executed successfully and the output was verified.
191
PROGRAM NO-4
Python Basics-4
SOURCE CODE-
192
OUTPUT-
RESULT- The source code is executed successfully and the output was verified.
193
PROGRAM NO-5
Python Basics-5
AIM- A tours and travels company charges their customer as per following
criteria according to customer category.
Category Charges
A 18
B 15
C 12
D 10
Others 20
SOURCE CODE-
OUTPUT-
RESULT- The source code is executed successfully and the output was verified.
194
PROGRAM NO-6
LISTS AND ITS
AIM- Write a Python OPERATIONS
program:-
1. To declare a list as num = [10, 30, 40, 20, 50] and print it.
2. To sort the list num in Ascending and the Descending order in Python.
3. To create a list as List1 = ['Hello', 10, 'world', 20] and iterate in reverse order.
4. To remove an element of List1 using List1.pop() .
5. To add an element to a List1 using List1.append().
SOURCE CODE-
196
OUTPUT-
RESULT- The source code is executed successfully and the output was verified.
197
PROGRAM NO-7
DATA SCIENCE
Data Visualization Tools
AIM- Write a short note about five essential plots that can help in data visualization
and write a Python program to show each.
Introduction: Data visualization is the process of turning your data into graphical
representations that communicate logical relationships and lead to more
informed
decision-making.In short, data visualization is the representation of data in a
graphical or pictorial format.
There are five essential plots that have we need to know well for basic data visualization.
Line Plot
Bar Chart
Histogram Plot
Scatter Plot
Pie Chart
1. Line Plot:
• A line plot is used to show observations gathered at regular intervals.
•The x-axis shows the regular interval, such as time.
•The Y- axis shows the observations.
• A line plot can be built by the calling the plot() function and
passing the X- axis data for the regular interval, and Y – axis for
the observations.
# code to create a line
plot pyplot.plot(x, y)
2. Bar Plot:
A bar chart presents relative quantities for multiple categories.
The x-axis shows the categories that are spaced evenly.
The Y- axis shows the quantity for each category and is drawn as a bar from the
baseline to the required level on the Y-axis.
A bar chart can be built by the calling the bar() function and passing the
category names for the X-axis and the quantities for the Y – axis.
3. Histogram Plot
Histogram plots are used for summarizing the distribution of a data sample.
The x-axis shows distinct bins or intervals for the observation.
The Y- axis shows the frequency or tally of the number of
observations in the dataset that has assigned to each bin.
A Histogram plot can be designed by the calling the hist()
function and passing a list or array that shows the data
sample.
# code to create a histogram plot
pyplot.hist(x, y)
4. Scatter Plot:
A scatter plot can be designed by the calling the scatter() function and
198
passing a list or array that shows the data sample.
199
# code to create a scatter plot
pyplot. Scatter(x, y)
5. Pie Chart
A Pie Chart is a circular statistical plot that can display only one series of
data.
The area of the chart is the total percentage of the given data. The area
of slices of the pie represents the percentage of the parts of the data
# code to create a pie plot
pyplot.pie(values, labels = Names)
SOURCE CODE-
200
201
OUTPUT-
202
RESULT- The source code is executed successfully and the output was verified.
203
PROGRAM NO-8
INTRODUCTION TO COMPUTER VISION
AIM- Write a Python program
a. To read and display an image using OpenCV in Google Colab.
b. To dsiplay the height and width of an input image.
c. To covert BGR format of OpenCV to RGB format.
Introduction:
Computer Vision Computer vision is a field/domain of artificial intelligence (AI) that
enables computers and systems to derive meaningful information from digital
images, videos and other visual inputs — and take actions or make
recommendations based on that information.
OpenCV-Python is a library of Python bindings designed to solve computer vision
problems. Python is a general purpose programming language started by Guido van
Rossum that became very popular very quickly, mainly because of its simplicity and
code readability. It enables the programmer to express ideas in fewer lines of code
without reducing readability. OpenCV was started at Intel in 1999 by Gary Bradsky,
and the first release came out in 2000. Vadim Pisarevsky joined Gary Bradsky to
manage Intel's Russian software OpenCV team. In 2005, OpenCV was used on
Stanley, the vehicle that won the 2005 DARPA Grand Challenge.
SOURCE CODE-
# Importing the OpenCV library
import cv2
# Importing the matplotlib library
import matplotlib.pyplot as plt
204
OUTPUT-
RESULT- The source code is executed successfully and the output was verified.
205
PROGRAM NO-9
COMMON IMAGE MANIPULATION USING OpenCV
SOURCE CODE-
# Importing the OpenCV library
import cv2
# Importing the matplotlib library
import matplotlib.pyplot as plt
206
OUTPUT-
RESULT- The source code is executed successfully and the output was verified.
207
PROGRAM NO-10
ADVANCED IMAGE MANIPULATION USING OpenCV
SOURCE CODE-
# Importing the OpenCV library
import cv2
# Importing the matplotlib library
import matplotlib.pyplot as plt
# Thresholding is cool
ret,thresh1 = cv2.threshold(image,127,255,cv2.THRESH_BINARY)
ret,thresh2 = cv2.threshold(image,127,255,cv2.THRESH_BINARY_INV)
ret,thresh3 = cv2.threshold(image,127,255,cv2.THRESH_TRUNC)
ret,thresh4 = cv2.threshold(image,127,255,cv2.THRESH_TOZERO)
ret,thresh5 = cv2.threshold(image,127,255,cv2.THRESH_TOZERO_INV)
for i in range(6):
plt.subplot(2,3,i+1),plt.imshow(images[i],'gray'
) plt.title(titles[i])
plt.xticks([]),plt.yticks([])
plt.show()
plt.imshow(image), plt.title('Original')
plt.show()
plt.imshow(blur), plt.title('Blurred')
plt.show()
output = image.copy()
# Adding the text using putText() function
text = cv2.putText(output, 'USE OF OpenCV', (500, 550),
cv2.FONT_HERSHEY_SIMPLEX, 4, (255, 255, 0), 5)
plt.imshow(text), plt.title('Original with TEXT ')
plt.show()
OUTPUT-
209
RESULT- The source code is executed successfully and the output was verified.
210
ARTIFICIAL INTELLIGENCE (417)
Sample Question Paper
Class X Marks: 50
Time: 2 Hours
211
act as an interface between the user and the computer.
a) Operating System
b) Ms Excel
4 1
c) Impress
d) Digital Documentation
212
is the process of understanding the reliability of any AI
model, based on outputs by feeding
test dataset into the model and comparing with actual answers.
a) Evaluation 1
8
b) Problem Scoping
c) Data acquisition
d) Data Exploration
The people who face the stated problem and would be benefitted from the
solution are termed as
9 a) Stakeholders 1
b) Key Persons
c) Who
d) End user
How many SDGs have been announced by the United nations?
10 a) 20 1
b) 17
c) 30
d) 25
You would feed the data into the machine. This is the data with which
the machine can be trained. Now, once it is ready, it will predict his
next data efficiently. This previous data is known as .
12 a. Testing Data 1
b. Training Data
c. Exploring Data
d. All of the above
213
Name any 2 methods of collecting data.
a) Surveys and Interviews
14 1
b) Rumors and Myths
c) AI models and applications
d) Imagination and thoughts
214
makes it possible to assign predefined categories to a
document and organize it to help you find the information you need
or simplify some activities.
a. Automatic Summarization
19 1
b. Sentiment Analysis
c. Text Classification
d. All of the above
SECTION B
21 Name any 4 qualities of an entrepreneur. 2
Section C
215
200