Escolar Documentos
Profissional Documentos
Cultura Documentos
Part A
(Compulsory)
1. Answer the following questions.
a. Explain meaning representation of natural language using FOPC.
We can express the meaning in natural language. In order to analyze and manipulate the meaning of sentences, we will
transform the sentences into a meaning representation language. The simplest form is propositional logic, but it is not
powerful enough for our purposes. Predicate logic combines predicates and their arguments. Predicate logic has simple
rules of inference, such as modus ponens. There are many other issues which we may need to address in our meaning
representation language:
generalized quantifiers (for some, most, )
tense and aspect
modality and belief (need to allow formulas as arguments: John believes Fred likes Mary =
believe(John,like(Fred,Mary)) )
presupposition (All the men on Mars drink Coca-Cola.)
fuzziness (The milk is warm.)
b. What are the contents of an iplan.
Agents behavior does not follow a well formed plan, the plan recognition component must be able to recognize actions
based on this more general model of intentional behavior. For this purpose we can use a structure called
iplan(intentional plan) which consists of
1. A tree hierarchy of goals, with one leaf goal marked the active goal
2. A sequence of actions, where the final action achieved the active goal, and one action is marked the current
action.
Plan inference algorithm is adapted to model the decomposition chaining and other reasoning is used to fill out the goal
hierarchy and plan the sequence of actions to achieve the active goal. The agents behavior is defined in terms of a set of
rational updates to the iplan which is a relation between two iplans.
c. Explain about local discourse state.
Each discourse segment is associated with a local discourse state which consists of the following:
1. The sentences that are in the segment
2. The local discourse context, generated from the sentences in the segment.
3. The semantic content of the sentences in the segment together with the semantic relationships that make the
segment coherent.
The language as a multi agent activity requires some means for the agents to coordinate their communicative acts and to
monitor whether they are being understood. In dialogue, agents use various mechanism to signal that they understand
each other.
This assumption is referred to as the Markov assumption, and networks are called Markov Chains.
The network representation can now be extended to include the lexical generation probabilities as well: we
allow each node to have an output probability which gives a probability to each possible output that could
correspond to the node.
For instance the node N in Fig. would be associated with a probability table that gives, for each word, how
likely that word is to be selected if we randomly select a noun.
A network like that in Figure with output probabilities associated with each node is called a Hidden Markov
Model (HMM).
More generally, the approximate probability of generating a sentence w1, ..., wT together with the sequence of
tags C1, ..., CT is
To find the most likely sequence, sweep forward through the words one at a time finding the most likely
sequence for each ending category.
In other words, you find the four best sequences for the two words Flies like: the best ending with like as a V,
the best as an N, the best as a P and the best as an ART.
You then use this information to find the four best sequences for the the words flies like a, each one ending in
a different category.
This process is repeated until all the words are accounted for.
For a problem involving T words, and N lexical categories, the Viterbi algorithm is guaranteed to find the
most likely sequence using kTN2 steps for some constant k.
Initialization Step
for lexcat = 1 to N do
SeqScore(lexcat, 1) = Prob(w1 | Llexcat) Prob(Llexcat | <start>)
BackPtr(lexcat, 1) = 0
Iteration Step
for t = 2 to T do
for lexcat = 1 to N do
SeqScore(lexcat, t) = Maxj=1,N(SeqScore(j, t1) Prob(Llexcat | Lj)) Prob(wt | Llexcat)
BackPtr(lexcat, t) = index of j that gave the max above
3. In the tables in the examples below, the name of the lexcat is used rather than the number.
SeqScore BackPtr
lexcat
(lexcat,1) (lexcat,1)
V 7.6106
N 0.00725
P 0
ART 0
= 3.12 104
Ambiguity is a serious problem during semantic interpretation. We can define a word as being semantically
ambiguous if it maps to more than one sense. But this is more complex than it might first seem, because we need to
have a way to determine what the allowable senses are. A few linguistic tests have been suggested to define the notion
of semantic ambiguity more precisely. One effective test exploits the property that certain syntactic constructs
typically require references to identical classes of objects. Virtually all senses involve some degree of vagueness, as
they might always allow some more precise specification. A similar ambiguity test can be constructed for verb senses
as well. In addition to lexical ambiguity, there is considerable structural ambiguity at the semantic level. Some forms
of ambiguity are parasitic on the underlying syntactic ambiguity. But other forms of structural ambiguity are truly
semantic and arise from a single syntactic structure. A very common example involves quantifier scoping. Quantifiers
also vary with respect to vagueness. The quantifier all is precise in specifying every member of some set, but a
quantifier such as many, as in Many people saw the accident, is vague as to how many people were involved.
A very important aspect of context-independent meaning is the co-occurrence constraints that arise between word
senses. Often the correct word sense can be identified because of the structure and meaning of the rest of the sentence.
One of the most important tasks of semantic interpretation is to utilize constraints such as this to help reduce the
number of possible senses for each word.
or
3. (a) Explain about Best First Parsing algorithms in detail.
Algorithms can be developed that attempt to explore the high-probability constituents first called best-first parsing
algorithms. The best parse can be found quickly and much of the search space, containing lower-rated possibilities, is
never explored. All the chart parsing algorithms can be modified fairly easily to consider the most likely constituents
first. The central idea is to make the agenda a priority queue - a structure where the highest rated elements are always
first in the queue. The parser then operates by always removing the highest-ranked constituent from the agenda and
adding it to the chart. With the modified algorithm, if the last word in the sentence has the highest score, it will be
added to the chart first. The problem this causes is that you cannot simply add active arcs to the chart (and depend on
later steps in the algorithm to extend them). In fact, the constituent needed to extend a particular active arc may
already be on the chart. Thus, whenever an active arc is added to the chart, you must check to see if it can be extended
immediately, given the current chart. Thus we need to modify the arc extension algorithm. The complete algorithm is
shown as follows:
Adopting a best-first strategy makes a significant improvement in the efficiency of the parser.
Write a short note on Probabilistic Context Free Grammar.
Context Free Grammars with some probabilities assigned to every possible rule of the grammar such that the sum of
all probabilities for all rules expanding the same non terminal is equal to 1. Non-terminals that expand more than one
way distribute their probabilities over their rules. The motivation behind augmenting CFGs with probabilities lies in
the fact that in the real world phrases are not uniformly distributed. PCFG parsing takes advantage of probabilities by
giving the most probable parse for a sentence. This makes for a more accurate natural language understander parsing
can be done in O(n3) time using CKY parsing algorithm or its variants. PCFGS are still not powerful to describe the
context sensitive languages. They describe exactly the same languages as their non stochastic counterparts
Properties of PCFG:
1. Assigns a probability to each left most derivation or parse tree allowed by the underlying CFG.
2. Say we have a sentence S, set of derivations for that sentence is T(S). Then a PCFG assings a probability P(t)
to each member of T(S) i.e. we now have a ranking in order of probability.
3. The most likely parse tree for a sentence s is Argmax tT(S)P(t)
Example :
(S SEM (?semvp ?semnp)) -> (NP SEM ?semnp) (VP SEM ?sernvp)
(S SEM ?semvp) -> (NP SEM ?semnp) (VP SUBJ ?semnp SEM ?semvp)
The SEM of the subject is passed into the VP constituent as the SUBJ feature and the SEM equations for the VP insert
the subject in the correct position. The new version of rule that does this is
UNIT- IV & V
4. (a) Explain Plan Inference algorithm and its limitations.
Whenever an action is added to a plan, all its preconditions and effects must be included with the appropriate
arcs linking them to the actions. The A-set, P-set, E-set must be updated with the new information. There are 3
classes of input depending on whether the new sentence describes
An action
A state
A goal.
The algorithm considers each case separately.
Case 1: when input describes a goal:
1. If E is the empry plan then
1.1 If G describes an action, add the action and its preconditions and effects to the E-plan and mark the
action as goal.
1.2 If G describes a state then find all actions A1,A2,.An that could have G as an effect. Create a
new E-plan for each Ai as described in step 1.1.
2. If E is not empty then
2.1 Try to incorporate G into E
2.2 If 2.1 failed, then let Old G be the goal of E. build the possible new E-plans with G as the foal. Then
try to incorporate Old G into the new E-plans. For those that match successfully add Old G and the
Old E-plan into the new E-plan.
Case 2: Incorporating action
If the E-plan is empty then incorporate the action using the incorporate goal algorithm.
If the E-plan is not empty then you can check for matches into the plan in 3 ways:
1. The action matches an action in the A-set.
2. The action has an effect that matches a state in the P-set.
3. The action has a precondition that matches a state in the E-set.
For each match found, a new E-set can be generated by adding the action and links appropriate to the part of the E-
plan method.
Whenever an action is added, all its preconditions and effects are added as well.
If no match found using these techniques then you may expand the actions in the E-plan and try again.
Case 3: The final class of input to be handled involves sentences that describe states but are not goal statements. Such
statements are typically used to provide background or to describe the effects of actions in the plan. If current E-plan
is empty then the state should be interpreted as background information. This is done by adding the state to the E-set
and P-set of the plan. While it is not an effect or precondition of an action currently in the plan this allows the state to
be connected to actions that are incorporated later.
Limitations:
1. This would not be able to find the connection between the two sentences in the discourse.
2. It cannot handle undesirable state and suggest goals.
AGENT
Agent is one who performs some actions. AGENT is a label representing the role of an agent.
Joe played well and won the price.
Here, Joe is the person who did playing.
CAUSE
EXPERIENCER
BENEFICIARY
LOCATION
INSTR
Specific Roles
FROM-LOC
TO-LOC
means to location.
AT-TIME
e. Semantic Networks.
A semantic network or net is a graph structure for representing knowledge in patterns of interconnected nodes and
arcs. Computer implementations of semantic networks were first developed for artificial intelligence and machine
translation, but earlier versions have long been used in philosophy, psychology, and linguistics. The Giant Global
Graph of the Semantic Web is a large semantic network.
What is common to all semantic networks is a declarative graphic representation that can be used to represent
knowledge and support automated systems for reasoning about the knowledge. Some versions are highly informal, but
others are formally defined systems of logic. Following are six of the most common kinds of semantic networks:
1.Definitional networks
2.Assertional networks
3.Implicational networks
4.Executable networks
5.Learning networks
6.Hybrid networks
ADITYA COLLEGE OF ENGINEERING
PUNGANUR ROAD, MADANAPALLE-517325
IV-B.Tech (R13) II Sem- II Internal Examinations April-2017 (Objective) (CODE A)
(13A05802) NATURAL LANGUAGE PROCESSING (Computer Science & Engineering)
Name: Roll No:
Time: 20 min Max Marks: 10
Examples:
The man in the corner ate lunch.
PP modifies NP the man
With a PP modifying an NP, the sem of the PP is a unary predicate to be applied to the sem of the
NP:
Given in the corner if the sem of the in is at_loc1, and the sem of the NP is the<c1, corner1>, then
the sem of the PP would be the unary predicate
lambda(Y, at_loc1(Y, the<c1, corner1>))
In the context the man in the corner, we need a rule to attach the PP to the CNP (common noun
phrase) man:
[Here & means "and". It is used here as a prefix operator. Thus& (happy(fido), dog(fido)) would
mean "Fido is happy and Fido is a dog".& (man1(x), in_loc1(x, the<c1, corner1>)) means "x is a
man and (&) x is in the corner".