0% found this document useful (0 votes)
15 views

Ai - Ia 2 QB

The document discusses the key steps involved in natural language processing including lexical analysis, syntactic analysis, semantic analysis, discourse integration, and pragmatic analysis. It also explains the difference between forward chaining and backward chaining, and lists several problems that robots can help solve in areas like manufacturing, logistics, healthcare, agriculture, exploration, domestic tasks, customer service, and education.

Uploaded by

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

Ai - Ia 2 QB

The document discusses the key steps involved in natural language processing including lexical analysis, syntactic analysis, semantic analysis, discourse integration, and pragmatic analysis. It also explains the difference between forward chaining and backward chaining, and lists several problems that robots can help solve in areas like manufacturing, logistics, healthcare, agriculture, exploration, domestic tasks, customer service, and education.

Uploaded by

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

1.

Discuss in detail steps involved in the process of Natural Language


Processing

Natural Language Processing (NLP) breaks down the complex task of understanding human
language into a series of steps. These steps can be broadly categorized into two main
functionalities:

1. Natural Language Understanding (NLU): This involves breaking down and analyzing the
text to understand its meaning.
2. Natural Language Generation (NLG): This involves using the understanding of the
language to produce human-like text.
Here's a breakdown of the key steps involved in the NLU process:
 Lexical Analysis (or Tokenization): This is the initial step where the text is divided into its
basic building blocks. Sentences are segmented, and further broken down into words or
meaningful units called tokens.
 Syntactic Analysis (Parsing): Here, the system analyzes the grammatical structure of the
sentence. It examines how the tokens relate to each other and identifies the parts of speech
(nouns, verbs, adjectives etc.). This helps understand the sentence structure and the
relationships between words.
 Semantic Analysis: This step goes beyond the grammatical structure to focus on the actual
meaning of the words and sentences. It involves tasks like identifying synonyms, antonyms,
and understanding the context of the words used. This is crucial for tasks like sentiment
analysis or topic modeling.
 Discourse Integration: Language understanding often involves considering the bigger
picture. This step analyzes how individual sentences relate to each other within a larger
context, such as a paragraph or conversation. It considers factors like the order of sentences
and how they flow together to convey a coherent meaning.
 Pragmatic Analysis: This is the most advanced stage of NLU, where the system tries to
understand the intent behind the language. It considers the context of the situation, the
speaker's background, and subtle cues to interpret the implied meaning beyond the literal
words. This is important for tasks like identifying sarcasm or humor in text.

2. Difference between forward chaining and backward chaining


3. Forward Chaining Backward Chaining

When based on available data a decision is Backward chaining starts from the goal and
1. taken then the process is called as Forward works backward to determine what facts must
chaining. be asserted so that the goal can be achieved.

Backward chaining is known as goal-driven


Forward chaining is known as data-driven
technique because we start from the goal and
2. technique because we reaches to the goal
reaches the initial state in order to extract the
using the available data.
facts.

3. It is a bottom-up approach. It is a top-down approach.

4. It applies the Breadth-First Strategy. It applies the Depth-First Strategy.

Its goal is to get the possible facts or the


5. Its goal is to get the conclusion.
required data.

6. Slow as it has to use all the rules. Fast as it has to use only a few rules.

It operates in forward direction i.e it works It operates in backward direction i.e it works
7.
from initial state to final decision. from goal to reach initial state.

Forward chaining is used for the planning, It is used in automated inference engines,
8. monitoring, control, and interpretation theorem proofs, proof assistants and other
application. artificial intelligence applications

4. Differentiate between Partial order planning and Total order planning.

Feature Partial Order Planning Total Order Planning

Plan Defines ordering constraints Defines a strict order for all actions
Structure between some actions, but not all in the plan

More flexible, can explore Less flexible, fixed order might not
Flexibility different action orderings for be optimal in dynamic
execution environments

Can potentially find solutions


May be slower due to needing to
Efficiency faster by exploring actions in
explore all possible orderings
parallel
Can be more complex to reason
Simpler to reason about and
Complexity about as orderings need to be
implement
considered

Problems with concurrency Problems with clear sequential


Suitable for (independent actions), dynamic dependencies between actions,
environments static environments

Making breakfast (boiling water


Assembly line tasks (each step
Example and frying eggs can happen
must be done in a specific order)
concurrently)

5. Convert to predicate logic


6. Explain problems robotics can solve

Robots can tackle a wide range of challenges that improve our lives, bezpieczeństwo
(safety) and our understanding of the world. Here are some examples:

 Manufacturing: Robots can automate tedious and repetitive tasks in factories and
assembly lines, which improves efficiency and product quality. They can perform
tasks with greater precision and consistency than humans, and can work tirelessly
for long periods.

 Logistics: In warehouses, robots can automate picking and packing items, sorting
products, and expediting deliveries. This frees up human workers for more complex
tasks and contributes to a faster and more efficient supply chain.

 Healthcare: Robots can play a significant role in assisting surgeons during complex
procedures. They can provide greater precision and stability, which can lead to better
outcomes for patients. Robots can also be used for remote surgery, allowing
surgeons to operate on patients located in different locations.

 Agriculture: Robots can automate tasks like planting, weeding, and harvesting
crops. This can increase yield, reduce labor costs, and improve the efficiency of
farms. They can also be used for tasks like monitoring crop health and applying
pesticides with greater precision.

 Exploration: Robots can be deployed in hazardous environments, such as space or


underwater, to collect data and perform exploration tasks. This allows us to study
these environments without putting human lives at risk. Robots can also be used in
search and rescue operations, locating victims in disaster zones or collapsed
buildings where it may be too dangerous for humans to enter.

 Domestic Tasks: Robots can help with household chores like vacuuming and
mowing lawns, freeing up people's time for other activities. In the future, robots may
be able to perform a wider range of domestic tasks, making our lives easier and
more convenient.

 Customer Service: Robots can be used to answer customer questions and provide
support, 24/7. This can improve customer satisfaction and reduce the need for
human customer service representatives.

 Education: Robots can be used to provide interactive learning experiences for


students. This can make learning more engaging and effective, and can personalize
the learning experience for each student.

 Entertainment: Robots can be used for companionship, education, and


entertainment. For example, robots can be used as toys for children or companions
for the elderly.

7. Explain Context-free grammar with example


Context-Free Grammar (CFG) is a way to define the structure of valid strings in a formal
language. It's like a set of rules that tells you how to build grammatically correct sentences,
but without considering the actual meaning of the words. Here's a breakdown:
 Components:
o Terminal Symbols: These are the basic building blocks like words, numbers,
punctuation marks (a, b, 1, 2, comma, etc.) that appear in the final string.
o Non-Terminal Symbols: These are placeholders representing patterns of terminal
symbols. They are usually written in uppercase (S, A, B, etc.).
o Production Rules: These rules define how non-terminal symbols can be rewritten
using terminal symbols or other non-terminals. They are written as arrows (S -> NP
VP).
o Start Symbol: This is a special non-terminal symbol (S) that marks the starting point
for generating any valid string in the language.
 Key Feature: Context-Free - Unlike some grammar models, CFG rules can be applied
regardless of the surrounding symbols. The replacement happens based on the specific non-
terminal itself.
Example:
Imagine a simple grammar for sentences with a noun phrase (NP) and a verb phrase (VP).
Here's how it would be defined using CFG:
1. Terminal Symbols: Noun (boy, girl), Verb (runs, jumps), Determiner (the, a)
2. Non-Terminal Symbols: S (Sentence), NP (Noun Phrase), VP (Verb Phrase)
3. Production Rules:
o S -> NP VP (A sentence consists of a noun phrase followed by a verb phrase)
o NP -> Det Noun (A noun phrase starts with a determiner followed by a noun)
o VP -> Verb (A verb phrase can simply be a verb)
4. Start Symbol: S
Using these rules, we can generate valid sentences like "The boy runs" or "A girl jumps".
Here's how:
1. We start with the Start symbol (S).
2. According to rule 1, we can rewrite S as NP VP.
3. Rule 2 allows us to rewrite NP as Det Noun (e.g., "The boy").
4. Finally, rule 3 lets us replace VP with Verb (e.g., "runs").
This process demonstrates how the grammar helps build correct sentence structures step-by-
step. You cannot generate nonsensical phrases like "Runs boy the" because the rules don't
allow such arrangements.

8. Explain Context-sensitive grammar with example


Context-Sensitive Grammar (CSG) is a more powerful kind of grammar compared to
Context-Free Grammar (CFG). While CFGs define how to build sentences without
considering surrounding elements, CSG takes context into account when applying rewriting
rules.
Here's how CSG differs from CFG:
 Context Sensitivity: In CSG rules, the decision to rewrite a non-terminal symbol depends not
just on the symbol itself but also on the surrounding symbols. Imagine a grammar for
sentences describing objects. A rule might rewrite "the" to "a" only if it precedes a singular
noun (e.g., "the book" vs. "a car").
 More Complex Rules: CSG rules can have a more intricate format compared to CFG's
simple arrow notation. They might specify conditions or checks on the surrounding symbols
before allowing a rewrite.
Example:
Let's consider a grammar for describing objects with singular and plural nouns:
1. Terminal Symbols: Noun (book, car), Adjective (red, blue), Determiner (a, the)
2. Non-Terminal Symbols: S (Sentence), N (Noun), Adj (Adjective)
3. Production Rules: (Simplified notation)
o S -> Det Adj N (Basic sentence structure)
o Det -> "the" (if N is singular) Context-sensitive rule
o Det -> "a" (otherwise)
o N -> "book" | "car"
o Adj -> "red" | "blue"
Here's how context sensitivity works:
 To generate "the red car", we use S -> Det Adj N.
 The Det rule checks the following noun (car) and being singular, it rewrites Det to "the".
 Finally, Adj and N are replaced with their respective values.
However, for "a blue book", the context-sensitive rule applies differently:
 Following S -> Det Adj N, the Det rule checks the noun (book) which is singular, but this
time it doesn't trigger the "the" rewrite because there's an "else" condition in the rule.
 Therefore, Det is rewritten to "a".
This example showcases how CSG rules can handle agreements between determiners and
nouns based on their singularity or plurality, something CFGs struggle with.
Applications: CSGs are less common than CFGs due to their complexity. However, they can
be useful for tasks like:
 Natural Language Processing (NLP): Handling agreement between words and complex
sentence structures.
 Machine Translation: Preserving grammatical agreements during translation between
languages.
 Programming Languages: Certain aspects of some programming languages might benefit
from CSGs.

9. Explain types of planning

Popular different types of planning in ai include:


 Classical Planning: In this style of planning, a series of actions is created to
accomplish a goal in a predetermined setting. It assumes that everything is static and
predictable.
 Hierarchical planning: By dividing large problems into smaller ones, hierarchical
planning makes planning more effective. A hierarchy of plans must be established,
with higher-level plans supervising the execution of lower-level plans.
 Temporal Planning: Planning for the future considers time restrictions and
interdependencies between actions. It ensures that the plan is workable within a
certain time limit by taking into account the duration of tasks.
1. Classical Planning:
 This is the simplest and most well-defined type of planning.
 Assumptions:
o The environment is fully observable (the AI can sense everything).
o The environment is deterministic (actions always have the same outcome).
o The environment is static (the world doesn't change while the plan is being executed).
o The environment is discrete (the world consists of distinct states).
 Suitable for: Solving problems with a well-defined set of states and actions (e.g., navigating a
maze).
 Limitations: Not suitable for real-world scenarios with uncertainty, partial observability, or
continuous change.
2. Non-Classical Planning:
 This encompasses all planning scenarios that violate the assumptions of classical planning:
o Partially Observable Planning: The AI doesn't have complete information about the
environment.
o Probabilistic Planning: Actions have uncertain outcomes with probabilities.
o Planning with Preferences: Incorporating preferences or goals beyond just reaching
a specific state (e.g., minimizing resource usage).
 These types of planning require more sophisticated algorithms to handle uncertainty,
reasoning, and decision-making under incomplete information.
3. Hierarchical Planning:
 This approach breaks down complex problems into smaller, more manageable sub-problems.
 It creates a hierarchy of plans, where high-level plans define the overall goals, and lower-
level plans detail specific actions to achieve those subgoals.
 This reduces the complexity of planning for large problems and allows for reusing sub-plans
in different contexts.
4. Planning and Scheduling:
 This type of planning considers not only the sequence of actions but also the timing
constraints.
 It determines when each action should be executed, taking into account factors like resource
availability, deadlines, and potential conflicts between actions.
5. Reactive Planning:
 This is a more flexible approach suitable for dynamic environments.
 The AI continuously monitors the environment and replans as needed based on new
information or unexpected changes.
 It reacts to situations rather than following a predetermined, rigid plan.

10.Numericals on Bayesian Belief network


11.Define Bayes Theorm
Bayes' theorem, also known as Bayes' rule or Bayes' law, is a fundamental concept in
probability theory that is especially useful in AI applications. It provides a way to update our
beliefs or the probability of an event occurring based on new evidence or information.
Here's how it works:
Imagine you have a hypothesis (event A) and some evidence (event B). Bayes' theorem
allows you to calculate the posterior probability, which is the probability of the hypothesis
being true given the evidence.
The formula for Bayes' theorem is:
P(A|B) = ( P(B|A) * P(A) ) / P(B)
where:
 P(A|B): The posterior probability - The probability of event A being true given that event B
has already occurred. (This is what we want to find)
 P(B|A): The likelihood - The probability of observing event B given that event A is true.
 P(A): The prior probability - The initial belief about the probability of event A occurring,
regardless of any evidence.
 P(B): The marginal probability of event B - The probability of observing event B regardless
of whether A is true or false. (This acts as a normalization factor to ensure all posterior
probabilities sum to 1)
Benefits of using Bayes' theorem in AI:
 Reasoning with Uncertainty: AI systems often deal with situations where information is
incomplete or unreliable. Bayes' theorem allows them to incorporate new evidence and
update their beliefs accordingly.
 Improved Decision Making: By calculating posterior probabilities, AI systems can make
more informed decisions based on the available evidence and their prior knowledge.
 Machine Learning: Bayes' theorem is a core principle behind Bayesian learning, a
powerful machine learning technique for classification and parameter estimation.
Here are some examples of how Bayes' theorem is used in AI:
 Spam Filtering: Email filters use Bayes' theorem to classify emails as spam or not spam
based on the presence of keywords and other indicators.
 Medical Diagnosis: AI systems can use Bayes' theorem to analyze patient data and
symptoms to calculate the probability of having a specific disease.
 Autonomous Vehicles: Self-driving cars can use Bayes' theorem to assess the likelihood of
pedestrians or obstacles being present based on sensor data.

12.Generating the parse tree


13.

14.Sums on resolution tree


15.Sums on Forward chaining and Backward Chaining
16.Explain WUMPUS world environment with how percept sequence is
generated.
The Wumpus world is a classic example used in Artificial Intelligence (AI) to understand
planning and decision-making for an agent in an uncertain environment. Here's a breakdown
of the environment and percept sequence generation:
Environment:
 The Wumpus world is a cave represented as a grid of rooms (usually 4x4).
 The agent resides in one of these rooms and can move around (up, down, left, right).
 There are three hidden dangers in the cave:
o Wumpus: A creature that lives in one room and will kill the agent if it enters the
same room.
o Pits: Bottomless pits located in some rooms. If the agent enters a pit, it falls in and
dies.
 Gold: The treasure the agent seeks to find. It's located in one room.
Agent's Perception:
 The agent is blind and cannot directly see its surroundings.
 It can only perceive its environment through limited sensory information upon entering a new
room. This information is called the percept.
 The percept consists of five possible elements (each can be present or absent):
o Stench: Perceived if the agent is in a room adjacent (not diagonally) to the Wumpus.
o Breeze: Perceived if the agent is in a room adjacent (not diagonally) to a pit.
o Glitter: Perceived if the agent is in the same room as the gold.
o Bump: Perceived if the agent tries to move forward and hits a wall.
o Scream: A one-time percept if the agent shoots the Wumpus (successful or not). This
can be heard from any room.
Percept Sequence Generation:
 The percept sequence is a history of all the percepts received by the agent as it explores the
cave.
 It's a crucial element for the agent's decision-making process.
 Here's how the percept sequence is generated:
1. Initially, the percept sequence is empty.
2. As the agent enters a new room, it receives a percept based on the elements present in
that room and its surrounding rooms (e.g., stench if Wumpus is nearby).
3. This percept is then added to the existing percept sequence.
4. The agent uses this growing sequence of percepts to build a mental map of the cave
and identify the locations of dangers and the gold.
Example:
Imagine the agent starts in a room and perceives a breeze. This gets added to the percept
sequence. The agent can infer there's a pit in an adjacent room but doesn't know the exact
direction. As it explores further, the percept sequence might include "breeze, stench"
indicating a pit next to a room with the Wumpus. Based on this growing knowledge, the agent
can make informed decisions about safe movement and avoid dangers while searching for the
gold.

17.Give the partial World plan for the following problem.


Refer PPT
18.Explain Reinforcement learning.
Reinforcement learning (RL) is a type of machine learning technique where an agent learns to
take actions in an environment to maximize a reward. It's like training a dog with treats - the
dog learns which actions (behaviors) get rewarded (treats) and adjusts its behavior
accordingly.
Here's a breakdown of how RL works:
 Agent: This is the AI system that's learning. It interacts with the environment by taking
actions.
 Environment: This is the world the agent operates in. It could be a physical environment like
a robot's workspace or a simulated environment like a game.
 Actions: These are the things the agent can do in the environment.
 Rewards: This is the feedback the agent gets from the environment. It can be positive (a
good outcome) or negative (a bad outcome). The agent's goal is to learn to take actions that
maximize the total reward it gets over time.
RL is different from other machine learning approaches because it doesn't require labeled
data. The agent learns by trial and error, interacting with the environment and getting rewards
(or penalties) for its actions. Over time, the agent learns which actions lead to the best
outcomes.
Here are some real-world applications of reinforcement learning:
 Training robots: RL can be used to train robots to perform tasks in complex environments.
 Playing games: RL algorithms are used to train AI agents to play games at a superhuman
level.
 Recommendation systems: RL can be used to personalize recommendations for users, such
as product recommendations on shopping websites.

19.Explain in detail applications of AI.


1. Powering our Digital Lives:
 Recommendation Systems: AI algorithms are the brains behind the "recommended for you"
sections on streaming services, online stores, and social media platforms. By analyzing your
past behavior and preferences, AI can suggest products, content, or even people you might be
interested in.
 Virtual Assistants: Smart speakers like Alexa and Google Home, and virtual assistants on
smartphones like Siri and Bixby, all leverage AI for natural language processing (NLP) to
understand your voice commands and respond accordingly.
 Spam Filtering: AI algorithms wade through your inbox, meticulously analyzing emails to
identify and filter out spam messages before they clutter your inbox.
2. Transforming Industries:
 Healthcare: AI is making waves in healthcare by assisting with medical diagnosis, predicting
disease outbreaks, and even developing personalized treatment plans. AI-powered tools can
analyze medical images for early detection of diseases and aid in drug discovery processes.
 Finance: AI is a weapon against fraud in the financial sector. AI algorithms can analyze vast
amounts of financial data to detect suspicious patterns and prevent fraudulent transactions.
Additionally, AI can be used for algorithmic trading, where complex models analyze market
trends and make investment decisions.
 Transportation: Self-driving cars are a prime example of AI's potential in transportation. AI
algorithms process visual data from cameras and LiDAR sensors to navigate roads, perceive
surroundings, and make real-time decisions for safe autonomous driving.
3. Security and Threat Detection:
 Cybersecurity: AI can be a powerful tool to combat cyber threats. AI algorithms can analyze
network traffic patterns to identify and prevent cyberattacks in real-time. Additionally, AI can
be used to detect malware and other malicious software that might try to infiltrate computer
systems.
 Facial Recognition: Facial recognition technology, powered by AI, is used for security
purposes in various ways. It can be used to identify authorized personnel at security
checkpoints, or even for criminal identification by law enforcement agencies.
4. Redefining Customer Service:
 Chatbots: AI-powered chatbots are increasingly used to provide customer service on
websites and apps. These chatbots can answer frequently asked questions, troubleshoot
problems, and even direct customers to the appropriate resources.
 Personalized Marketing: AI can personalize marketing campaigns by analyzing customer
data and preferences. This allows businesses to target their marketing efforts more effectively
and deliver relevant content to their audience.

You might also like