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

Unit II

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

Unit II

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

A state space is a mathematical representation of a problem that defines all possible

states that the problem can be in. Furthermore, in search algorithms, we use a state
space to represent the current state of the problem, the initial state, and the goal state.
Additionally, we represent each state in the state space by a set of variables.

State space search is a method used widely in artificial intelligence and computer
science to find a solution to a problem by searching through the set of possible states
of the problem. Furthermore, a state space search algorithm uses the state space to
navigate from the initial state to the goal state.

Problem formulation is the process of defining the scope of a problem, formulating


questions about it, and establishing the assessment methods needed to address the
questions.
A problem formulation consists of:
Objectives (goals of stakeholders)
Decision variables (management actions)
Constraints (limitations on the management actions)

Depth-First Search (DFS) and Breadth-First Search (BFS) are two fundamental graph
traversal algorithms, each with its own set of merits and use cases:

**Depth-First Search (DFS):**

1. **Memory Efficiency:** DFS typically uses less memory compared to BFS


because it explores one branch of the graph as deeply as possible before backtracking.

2. **Simplicity:** DFS is often easier to implement recursively, making it a


straightforward choice for simple tree or graph traversals.

3. **Useful for Pathfinding:** DFS can be adapted for pathfinding algorithms like
finding all paths between two nodes, topological sorting, and cycle detection.

4. **Space Complexity:** In the worst case, DFS can have a high space complexity if
the graph is very deep, potentially leading to a stack overflow.

**Breadth-First Search (BFS):**

1. **Shortest Path:** BFS is guaranteed to find the shortest path in unweighted


graphs. It explores nodes level by level, starting from the source.

2. **Completeness:** BFS is complete, meaning it will find a solution if one exists,


as long as the branching factor is finite.

3. **Memory Intensive:** BFS typically uses more memory than DFS because it
needs to maintain a queue to store nodes at each level.
4. **Useful for Shortest Path and Connectivity:** BFS is suitable for finding the
shortest path, connected components, and can be useful in algorithms like Dijkstra's
for weighted graphs.

Natural Language Processing (NLP) refers to AI method of communicating with an


intelligent systems using a natural language such as English.

Processing of Natural Language is required when you want an intelligent system like
robot to perform as per your instructions, when you want to hear decision from a
dialogue based clinical expert system, etc.

**Natural Language Understanding (NLU):**

- **Definition:** NLU is the process of comprehending and extracting meaning from


human language. It focuses on interpreting and making sense of input text or speech.
- **Tasks:** NLU involves tasks such as text classification, sentiment analysis,
named entity recognition, and understanding the semantics and context of language.
- **Goal:** The primary goal of NLU is to enable a computer system to grasp the
meaning and intent behind human language, allowing it to answer questions, provide
relevant information, or take appropriate actions based on input.

**Language Generation (NLG):**


- **Definition:** NLG is the process of creating human-like text or speech from
structured data or instructions. It focuses on generating coherent and contextually
relevant language output.
- **Tasks:** NLG includes tasks such as text generation, summarization, translation,
and dialogue system responses.
- **Goal:** The primary goal of NLG is to enable a computer system to produce
language that is natural-sounding and appropriate for the given context, often with the
aim of communicating information or engaging in a conversation.

1. **Transition Network (TN):**

- **Definition:** A Transition Network is a finite automaton used to recognize and


process natural language. It consists of nodes (states) connected by labeled transitions.

- **Functionality:** TNs are primarily used for syntactic parsing, where each node
represents a grammatical category, and transitions represent allowable transitions
between categories.

- **Limitation:** Transition Networks are not very expressive and are typically
used for simple syntactic parsing tasks.

2. **Recursive Transition Network (RTN):**

- **Definition:** An RTN is an extension of the Transition Network that allows


transitions to loop back to previous states, introducing recursion into the parsing
process.

- **Functionality:** RTNs can handle more complex grammatical structures and


recursion, making them suitable for parsing context-free grammars.

- **Use Cases:** RTNs have been used in the past for parsing natural language
with more complex syntactic structures.

3. **Augmented Transition Network (ATN):**

- **Definition:** An ATN is a more advanced and flexible formalism for natural


language processing. It extends the capabilities of RTNs by allowing semantic actions
to be associated with transitions.

- **Functionality:** ATNs can perform both syntactic and semantic processing.


They are equipped to handle a wide range of natural language phenomena, including
parsing and generating sentences, semantic interpretation, and dialogue management.

- **Use Cases:** ATNs have been used in various NLP applications, including
natural language understanding, dialogue systems, and machine translation.
Parsing is the process of analyzing a sentence based on a given grammar to determine
its syntactic structure. In this case, we will use top-down parsing to analyze the
sentence "Tom ate an apple" based on the provided grammar rules:

Grammar Rules:
1. sentence → noun phrase, verb phrase
2. noun phrase → proper noun
3. noun phrase → determiner, noun
4. verb phrase → verb, noun_phrase
5. proper noun → Tom
6. noun → [apple]
7. verb → [ate]
8. determiner → [an]

Now, let's parse the sentence "Tom ate an apple" using top-down parsing:

1. Start with the sentence rule:


- sentence → noun phrase, verb phrase

2. Apply the first production rule for noun phrase:


- noun phrase → proper noun
- This matches "Tom."

3. Apply the production rule for verb phrase:


- verb phrase → verb, noun_phrase
- This matches "ate an apple."

4. Continue parsing the noun phrase:


- noun phrase → determiner, noun
- This matches "an apple."

5. Parse the determiner:


- determiner → [an]
- This matches "an."

6. Parse the noun:


- noun → [apple]
- This matches "apple."

7. Parse the verb:


- verb → [ate]
- This matches "ate."

The entire sentence "Tom ate an apple" has been successfully parsed based on the
provided grammar, and it is valid according to the grammar rules.

**Task Environment Specification:**

Specifying a task environment involves defining the key components and


characteristics of a task that an intelligent agent or system is designed to perform. It
helps in understanding the context, goals, and constraints of the task. To specify a task
environment, you need to consider the following aspects:

1. **Performance Measure:** Define how the success of the task will be measured.
This could be a quantitative measure or a subjective evaluation.

2. **Environment:** Describe the environment or context in which the task will be


performed. Consider factors like the physical setting, objects, agents, and other
elements.

3. **Actuators:** Identify the actuators or mechanisms through which the agent


interacts with the environment. These can be physical devices or software interfaces.

4. **Sensors:** Specify the sensors or means through which the agent perceives the
environment and gathers information.

5. **Goals:** Define the goals and objectives of the task. What does the agent need
to achieve or accomplish?

**PEAS (Performance measure, Environment, Actuators, Sensors):**

PEAS is an acronym used to represent the key components of a task environment:

- **Performance Measure:** How the success of the agent's task is measured.


- **Environment:** The external context or surroundings in which the agent operates.
- **Actuators:** The mechanisms or devices through which the agent can perform
actions.
- **Sensors:** The means or sensors through which the agent perceives and gathers
information from the environment.

**Example: Taxi Driver Task Environment (PEAS):**


- **Performance Measure:** The performance measure for a taxi driver can be
defined in terms of several factors, including:
- Total number of successful passenger pick-ups and drop-offs.
- Total distance traveled during a shift.
- Average customer ratings and feedback.
- Income earned during a shift.

- **Environment:** The environment for a taxi driver includes:


- The city or urban area where the taxi operates.
- Road network, traffic conditions, weather, and passenger locations.
- Other vehicles and pedestrians sharing the road.
- Taxi dispatch system and communication channels.

- **Actuators:** The actuators used by a taxi driver include:


- The vehicle's steering wheel, brakes, and accelerator pedal.
- The taxi's communication system for interacting with passengers and dispatch.
- Payment processing equipment (e.g., card reader or cash handling).

- **Sensors:** The sensors used by a taxi driver include:


- Visual perception (e.g., eyes) for observing the road, traffic signals, and passengers.
- Auditory perception (e.g., ears) for listening to passenger requests and traffic
sounds.
- GPS and navigation systems for route planning and tracking.
- Communication devices (e.g., smartphone or radio) for receiving passenger
requests.
A* search is the most commonly known form of best-first search. It uses heuristic
function h(n), and cost to reach the node n from the start state g(n). It has combined
features of UCS and greedy best-first search, by which it solve the problem efficiently.
A* search algorithm finds the shortest path through the search space using the
heuristic function. This search algorithm expands less search tree and provides
optimal result faster. A* algorithm is similar to UCS except that it uses g(n)+h(n)
instead of g(n).

In A* search algorithm, we use search heuristic as well as the cost to reach the node.
Hence we can combine both costs as following, and this sum is called as a fitness
number.

**Strong Artificial Intelligence (Strong AI):**


- Strong AI refers to artificial intelligence systems that possess human-like cognitive
abilities, including consciousness, self-awareness, and general intelligence.
- Strong AI can understand, learn, and reason about a wide range of tasks and possess
the ability to apply knowledge to solve problems.
- Strong AI has not been achieved yet and is largely a theoretical concept.

**Weak Artificial Intelligence (Weak AI or Narrow AI):**


- Weak AI refers to artificial intelligence systems that are designed and trained for
specific tasks or narrow domains.
- Weak AI systems excel in performing specific tasks but lack general intelligence or
consciousness.
- Examples include virtual personal assistants, recommendation systems, and image
recognition software.

**Difference between AI, ML, and DL:**

1. **Artificial Intelligence (AI):**


- AI is the broader field of computer science focused on creating intelligent agents
or systems that can mimic human intelligence to perform tasks.
- It encompasses various subfields, including machine learning and deep learning.
- AI can refer to both weak AI (narrow AI) and strong AI (general AI).

2. **Machine Learning (ML):**


- ML is a subset of AI that involves the development of algorithms and statistical
models that enable computers to improve their performance on a specific task through
learning from data.
- ML algorithms can be trained to make predictions, classify data, or discover
patterns without being explicitly programmed.
- It includes supervised learning, unsupervised learning, and reinforcement learning.

3. **Deep Learning (DL):**


- Deep learning is a subfield of machine learning that focuses on neural networks
with many layers (deep neural networks).
- DL has been particularly successful in tasks such as image recognition, natural
language processing, and speech recognition.
- It relies on large datasets and can automatically learn hierarchical representations
of data.

1. Lexical Analysis and Morphological

The first phase of NLP is the Lexical Analysis. This phase scans the source code as a
stream of characters and converts it into meaningful lexemes. It divides the whole text
into paragraphs, sentences, and words.

2. Syntactic Analysis (Parsing)

Syntactic Analysis is used to check grammar, word arrangements, and shows the
relationship among the words.

In the real world, Agra goes to the Poonam, does not make any sense, so this sentence
is rejected by the Syntactic analyzer.
3. Semantic Analysis

Semantic analysis is concerned with the meaning representation. It mainly focuses on


the literal meaning of words, phrases, and sentences.

4. Discourse Integration
Discourse Integration depends upon the sentences that proceeds it and also invokes
the meaning of the sentences that follow it.

5. Pragmatic Analysis

Pragmatic is the fifth and last phase of NLP. It helps you to discover the intended
effect by applying a set of rules that characterize cooperative dialogues.

END OF PREVIOUS YEAR

UNIT II
NLP stands for Natural Language Processing, which is a part of Computer Science,
Human language, and Artificial Intelligence. It is the technology that is used by
machines to understand, analyse, manipulate, and interpret human's languages. It
helps developers to organize knowledge for performing tasks such as translation,
automatic summarization, Named Entity Recognition (NER), speech recognition,
relationship extraction, and topic segmentation.

Natural language parsing techniques aim to analyze the grammatical structure of


human language. Common methods include:
1. **Dependency Parsing:** Identifies syntactic relationships between words,
represented as a dependency tree.
2. **Constituency Parsing:** Breaks down sentences into constituents (phrases or
clauses) based on grammar rules.
3. **Chart Parsing:** Employs dynamic programming to generate all possible parse
trees and select the best one.
4. **Transition-Based Parsing:** Uses a sequence of actions to build the parse tree
incrementally.
5. **Probabilistic Parsing:** Utilizes statistical models, like PCFGs or neural
networks, to assign probabilities to parse structures. These techniques are crucial for
natural language understanding and applications like machine translation and
sentiment analysis.

**Context-Free Grammars (CFGs):**


- CFGs are a formalism in AI used to represent the syntax or structure of languages,
including programming languages and natural languages.
- They consist of rules (productions) defining how symbols (e.g., non-terminals and
terminals) can be combined.
- CFGs are often used in parsing algorithms to analyze and generate sentences or code.

**Transformational Grammars:**
- Transformational grammars, introduced by Noam Chomsky, focus on
transformations applied to sentences to generate different grammatical forms.
- These grammars are part of generative grammar theory and played a role in early AI
research.
- Transformational rules describe how sentences can be transformed into equivalent or
related sentences, aiding in language generation and transformation tasks.

Transition Nets (TN) in brief:


- Transition Nets are a type of Finite-State Automaton used in Natural Language
Processing (NLP).
- They are used for syntactic parsing and understanding the structure of sentences or
language input.
- TNs consist of nodes (states) connected by labeled transitions.
- Each node represents a grammatical category, and transitions represent allowable
transitions between categories.
- TNs were used in early NLP systems but have been largely replaced by more
advanced parsing techniques like augmented transition networks (ATNs) and
probabilistic parsing methods.

**Augmented Transition Nets (ATNs) in short:**


- Augmented Transition Nets (ATNs) are a formalism used in Natural Language
Processing (NLP).
- They are an extension of Transition Nets (TNs) and are more expressive and
versatile.
- ATNs can handle both syntactic and semantic processing tasks.
- They allow semantic actions to be associated with transitions.
- ATNs have been used in various NLP applications, including natural language
understanding and dialogue systems.

**Key Points about Augmented Transition Nets (ATNs):**

- Extension of Transition Nets (TNs).


- Versatile and expressive, capable of handling both syntax and semantics.
- Support for semantic actions associated with transitions.
- Used in various NLP applications for understanding and generating natural language.

Fillmore's grammars refer to linguistic theories and frameworks proposed by


Charles J. Fillmore, a prominent linguist known for his contributions to the study of
syntax and semantics. These theories have had a significant influence on the field of
linguistics. Two of the most well-known frameworks associated with Fillmore are:

1. **Case Grammar:**
- Case Grammar, developed by Fillmore in the 1960s, focuses on the roles that
words play in sentences and their relationships to one another.
- It introduces the concept of "cases" to represent the grammatical functions of
words within a sentence, such as the agent, patient, and instrument.
- Case Grammar aims to provide a deeper understanding of sentence structure and
meaning by emphasizing the roles played by words in context.

2. **Frame Semantics:**
- Frame Semantics is another linguistic theory developed by Fillmore, emphasizing
the importance of semantic frames or structured mental representations.
- It proposes that words and phrases are associated with frames, which are
knowledge structures that capture the meaning and context of linguistic expressions.
- Frame Semantics is particularly relevant in understanding how words and phrases
derive their meanings from the situations or contexts in which they are used.

Shanks Conceptual Dependency

Conceptual Dependency (CD) is a linguistic and cognitive theory introduced by


Roger Schank in the 1970s to represent the meaning of sentences and knowledge in a
way that computers could understand. In simple terms:

- CD models knowledge as a set of concepts and relationships.


- It uses semantic primitives like "act," "object," and "prop" to represent actions,
objects, and propositions.
- CD structures sentences into propositions, making it easier for machines to process
language.
- It emphasizes understanding actions, intentions, and goals within sentences.
- CD has influenced early work in natural language processing and knowledge
representation, though modern AI systems often use other approaches.
**Grammar-Free Analyzers:**
- Grammar-free analyzers are linguistic tools that don't rely on traditional grammar
rules for language processing.
- They use statistical or machine learning techniques to understand and generate text.
- These analyzers work by analyzing patterns and relationships in large amounts of
text data.
- They are often used for tasks like sentiment analysis, text classification, and
information retrieval.
- Grammar-free analyzers can be effective for languages with complex grammar or
informal text, like social media posts.

**Sentence Generation:**
- Sentence generation involves creating coherent and meaningful sentences using
computer programs or models.
- It can be used in chatbots, content creation, and automatic report generation.
- Techniques like template-based generation, rule-based generation, and neural
language models are used.
- The goal is to produce text that sounds natural and contextually relevant.
- Sentence generation is essential in natural language processing and artificial
intelligence applications.

**Translation:**
- Translation is the process of converting text from one language to another.
- Machine translation uses algorithms and models to perform this task.
- It helps people understand and communicate in different languages.
- Popular examples include Google Translate.
- Quality varies depending on language pairs and context, with neural machine
translation offering significant improvements in recent years.

You might also like