NLP 1
NLP 1
NLP 1
3 MARKS
1. State the common evaluation metrics used to assess the performance of speech
recognition systems.
NLP is like a bridge between computers and humans. It helps computers understand
and process human language in all its forms, including written, spoken, and signed.
By breaking down language into its individual components (words, phrases, etc.),
NLP gives computers the ability to:
NLP is essential for building many of the technologies we use today, such as:
• Search engines
• Chatbots
• Machine translation tools
• Speech recognition systems
• Extract meaning from text and speech: Understand the intent behind words,
identify named entities, and analyze sentiment.
• Engage in natural language dialogue: Interact with humans using a
conversational style, responding to questions and providing information.
• Generate human-like text: Produce grammatically correct and meaningful
text for tasks like summarizing, translation, or content creation.
©FIADUZ ZAMAN 1
2. Intermediate Processing: Deals with more complex linguistic phenomena,
including semantics and syntax. It involves tasks such as:
• Text Summarization: Condensing a larger body of text into a concise
summary.
• Machine Translation: Translating text from one language to another.
3. Deep Processing: Aims to understand and generate natural language with
a deeper level of comprehension. It includes tasks like:
• Natural Language Understanding: Identifying the meaning and intent
of a text.
• Natural Language Generation: Creating coherent and meaningful text
from machine-generated data.
Tokenization is the process of breaking a text into smaller, meaningful units called
tokens. These units can be words, numbers, punctuation marks, or even smaller
units like characters. Tokenization is the first step in many text processing tasks,
such as:
Tokenization is like cutting a sentence into its building blocks, like words and
punctuation marks. It's the first step in making a computer understand what a piece
of text means.
1. Tokenization:
• Label each token with its grammatical category (e.g., noun, verb).
3. Chunking:
• Group related tokens into phrases or chunks (e.g., "New York City").
4. Feature Extraction:
5. Classification:
6. Post-processing:
10. List the importance of hyperparameter tuning on the performance of an NLP model.
Importance of Hyperparameter Tuning for NLP Model Performance
1. Optimized Model Parameters: Hyperparameter tuning adjusts the internal
settings of the model, such as learning rate or batch size, to find the
optimal combination for a specific task and dataset. This fine-tuning
process ensures the model operates efficiently and avoids overfitting or
underfitting.
2. Improved Accuracy and Generalization: By optimizing hyperparameters, the
model can better capture the underlying relationships in the data and
make more accurate predictions. Hyperparameter tuning also helps prevent
the model from overfitting to specific training examples, resulting in better
generalization to new data.
3. Increased Efficiency: Hyperparameter tuning can identify the most suitable
settings for the model's learning process. This can lead to faster training
times, reduced computational resources, and improved efficiency in
deploying the NLP model for real-world applications.
11. Predict the impact of dataset bias on the fairness of NLP models.
Dataset bias can significantly impact the fairness of NLP models:
• Biased Training Data:
▪ Models trained on biased data inherit and amplify those biases.
▪ This can lead to unfair predictions and discrimination against certain
groups.
©FIADUZ ZAMAN 2
• Underrepresented Groups:
▪ If a dataset lacks data from specific groups, the model may make
unreliable predictions for those groups.
▪ This can result in biased outcomes and perpetuate existing
inequalities.
• Representation in Results:
▪ Biased datasets can skew representation in NLP outputs.
▪ Models may prioritize results that align with the biases present in
the data, rather than providing a balanced view.
12. Discuss the techniques used for feature extraction in speech processing.
Techniques for Feature Extraction in Speech Processing
13. Predict the impact of Hidden Markov Model (HMM) work in speech recognition.
Impact of Hidden Markov Models (HMMs) in Speech Recognition:
14. Predict the impact of Hidden Markov Model (HMM) work in NLP.
Impact of Hidden Markov Model (HMM) in NLP:
1. Improved Speech Recognition: HMMs have enabled highly accurate speech
recognition systems by modeling the sequential nature of speech and
capturing hidden states in the acoustic signal.
2. Enhanced Text Segmentation: HMMs allow for efficient segmentation of text
into phrases, words, and characters. This aids in tasks like text
summarization and topic labeling.
3. Optimized Language Modeling: HMMs provide a framework for language
modeling, predicting the probability of a word occurring based on previous
words. This benefits tasks like machine translation and language generation.
©FIADUZ ZAMAN 3
NLP aims to understand and process human language, which conveys complex
meaning. To do this, it requires ways to represent this meaning in a computer-
understandable form. Here's how NLP handles representation of meaning:
1. Bag-of-Words: This simple model represents a text as a list of words,
ignoring word order and grammatical structure. It assumes that each word
contributes equally to the overall meaning.
2. Vector Space Models: These models represent words as vectors in a
multi-dimensional space. Each dimension represents a different semantic
property (e.g., positivity, negativity). Words with similar meanings have
similar vectors, making it easier for NLP algorithms to understand their
relationships.
3. Topic Modeling: This technique identifies groups of words that frequently
occur together, known as "topics." It helps discover the overarching
themes and information within a text, providing a higher-level understanding
of its meaning.
18. Describe the following two approaches of representation with examples: (a)
Distributional Semantics (b) Semantic Networks
Distributional Semantics:
Semantic Networks:
Quantifiers are symbols that indicate the scope of variables in FOPC statements.
They are used to specify whether a statement applies to all or some members of a
domain of discourse.
Types of Quantifiers:
• Universal quantifier (∀): For all x in the domain, the statement is true.
• Existential quantifier (∃): There exists at least one x in the domain such
that the statement is true.
Example:
20. Discuss Traditional CFG Rules and Semantic Augmentations with examples.
Traditional CFG Rules
Semantic Augmentations
©FIADUZ ZAMAN 4
• S -> NP VP
• This rule states that a sentence (S) consists of a noun phrase (NP)
followed by a verb phrase (VP).
Semantic Augmentation:
• NP -> [person:John]
• VP -> [action:run]
Semantic Interpretation:
21. Discuss the following regarding Relations between Senses with examples: (a)
Synonymy (b) Polysemy
(a) Synonymy
Synonymy refers to words that have the same meaning. For example:
In speech recognition, synonyms can present a challenge as they may sound similar.
For instance, the words "cat" and "hat" have the same first and last sounds, which
can lead to misinterpretation.
(b) Polysemy
Polysemy refers to words that have multiple meanings depending on the context. For
example:
WSD is the task of identifying the intended meaning of a word when it has multiple
meanings.
Example:
WSD involves considering the word's context (surrounding words and sentences) to
determine its most likely meaning. It can be done using machine learning algorithms
or dictionary-based methods.
3 Marks Answer:
Word sense disambiguation helps computers understand the intended meaning of words
that have multiple meanings. By considering the word's context, it can distinguish
between different senses. This is important for accurate speech and natural language
processing because it allows computers to better understand the meaning of sentences
and conversations.
23. Cite three application areas of Word sense disambiguation with brief description.
1. Machine Translation: Word sense disambiguation helps translate a word
accurately in different languages, considering its context. For instance,
"bank" in English can refer to a riverbank or a financial institution.
Disambiguation ensures the correct meaning is conveyed in the target
language.
2. Information Retrieval: Search engines use word sense disambiguation to
retrieve relevant results. The correct sense of a word in a query helps
identify the user's intent. For example, searching for "interest" may return
either articles on hobbies or financial matters, depending on the
disambiguation.
3. Semantic Parsing: Disambiguating word meanings is crucial for
understanding the semantics of a sentence. For instance, "Alice locked
©FIADUZ ZAMAN 5
the door" implies a different meaning depending on whether "locked"
refers to securing or breaking the door. Disambiguation helps natural
language processors interpret the sentence accurately.
Process:
Example:
Syntactic Parsing:
(S
(NP The dog)
(VP chased)
(NP the cat))
Rule-Based Mapping:
Semantic Composition:
• "The dog chased the cat" -> An action of the dog pursuing the cat
Diagram:
25. Distinguish between the following Thematic Roles with example: Agent, Experiencer,
Force
Agent: The entity performing the action of the verb. Example: "The boy (Agent)
kicked the ball (Patient)."
Experiencer: The entity that experiences or undergoes the action of the verb.
Example: "Mary (Experiencer) felt happy (Objective Complement)."
Force: An abstract or impersonal force that causes the action of the verb. Example:
"The wind (Force) blew the leaves (Patient)."
26. Analyse the statement, “The cat chased the mouse across the room” and identify the
agent and patient with explanation.
Agent: The cat Patient: The mouse
Explanation:
In this sentence, the cat is the one performing the action of chasing, while the
mouse is the one being chased. Therefore, the cat is the agent, and the mouse is
the patient.
3 marks answer:
The agent is the noun phrase that performs the action of the verb. In this case,
the cat is the agent because it is the one doing the chasing. The patient is the
noun phrase that receives the action of the verb. In this case, the mouse is the
patient because it is the one being chased.
27. Differentiate between the following with example: (a) RESULT (b) INSTRUMENT (c)
BENEFICIARY
RESULT
INSTRUMENT
BENEFICIARY
©FIADUZ ZAMAN 6
28. Differentiate between Machine Learning and Statistical method for Word Sense
Disambiguation.
Machine Learning (ML) for Word Sense Disambiguation (WSD):
Key Difference:
The primary difference lies in their approach: ML models learn patterns, while statistical
methods rely on frequency and probability. Both methods have their advantages and
disadvantages, and the choice often depends on the specific WSD task and available
data.
29. Explain how Feature Extraction method helps in disambiguation in semantic meaning.
Feature Extraction for Disambiguation in Semantic Meaning
How does feature extraction help disambiguation? When multiple meanings of a word
exist (disambiguation), feature extraction can help distinguish between them. By
analyzing the surrounding context, grammatical structure, and other features, the
disambiguation method can determine the most likely meaning.
Example: Consider the word "bank." It can have multiple meanings, such as a
financial institution or a raised side of a river. Feature extraction would consider the
following:
30. Analyse the sentence, "She went to the bank to deposit money" and explain why Word
Sense Disambiguation is required.
Word Sense Disambiguation (WSD) is important in this sentence because the word
"bank" can have multiple meanings:
This would clearly be incorrect. WSD determines that the intended meaning is the
financial institution, not the geographical feature.
3-Mark Answer:
Word Sense Disambiguation is required in the sentence "She went to the bank to
deposit money" because the word "bank" has multiple meanings. Without WSD, a
computer might interpret the sentence incorrectly.
Coherence refers to how well the ideas and sentences in a text flow together and
make sense as a whole. It ensures that:
32. Alice loves to read books. She often visits the library to borrow new ones. The
librarian there is very helpful and always recommends interesting titles. Write the
referring expressions.
©FIADUZ ZAMAN 7
2. The helpful librarian
3. The librarian who recommends interesting books
33. Prepare Anaphora Resolution using Hobbs Algorithm for the text: “The dog chased
the cat. It ran away.”
Anaphora Resolution using Hobbs Algorithm:
Step 1: Identify the anaphor (the word referring to something mentioned earlier):
• It
Step 2: Find the antecedent (the word that the anaphor refers to):
• The cat
Step 3: Check for intervening noun phrases (NPs) that could potentially be antecedents:
• No intervening NPs
The resolved text: The dog chased the cat. The cat ran away.
34. Prepare Anaphora Resolution using Centering Algorithm for the text: “Alice went to
the store. She bought milk. Then, Bob arrived home.”
Sentence 1: Alice went to the store.
• Center: Alice
35. How does Coreference Resolution structure the following text: "Jessica bought a new
car. She is very happy with it."
Coreference Resolution
Coreference Resolution identifies and connects words or phrases that refer to the
same entity. In this text:
Structure:
• Antecedent: Jessica
• Anaphor: She
• Referent: Same person (Jessica)
This coreference structure makes the text coherent by establishing a clear connection
between "Jessica" and "She". It allows the reader to understand that "She" and
"Jessica" are the same person, and that "She" is a reference to the previously
mentioned "Jessica".
©FIADUZ ZAMAN 8
4. Assign Referents: Assign a unique identifier (e.g., a pronoun) to each
cluster. This identifier becomes the referent for all noun phrases within
the cluster.
5. Resolve Anaphora and Cataphora: Identify and resolve references that occur
before or after the referent noun phrase (e.g., "he", "they", "her").
Key Features:
Uses:
• NLP Model Training: Treebanks provide training data for NLP models that
require an understanding of sentence syntax.
• Syntactic Analysis Evaluation: They are used to evaluate the performance
of NLP models that perform syntactic parsing.
• Language Research: Treebanks facilitate the study of linguistic patterns
and grammatical structures.
39. Explain the various relationships through which Synsets are linked together in
WordNet.
Synsets in WordNet are linked through the following relationships:
3. Troponymy:
4. Entailment:
5. Causation:
40. Develop a Frame titled "Apply_heat" mentioning Lexical Unit and Frame elements
from the sentence: "She cooked a delicious meal in the kitchen". Assume implicit
elements if required.
Frame Title: Apply_heat
Frame Elements:
©FIADUZ ZAMAN 9
researchers to conduct robust statistical analyses and draw reliable
conclusions about language use.
3. Improving Natural Language Processing (NLP): The BNC is heavily used
in the development and evaluation of NLP systems. Its extensive coverage
of real-world language helps researchers test and refine NLP algorithms,
leading to more accurate and effective language processing tools.
Lemmatization:
• Considers the context of the word and its grammatical information (e.g.,
tense, number, gender) to identify the base form.
• Retains the original meaning and part of speech of the word.
• Example: Convert "running" to "run" (verb) instead of "run" (noun).
Stemming:
Nested Coreferences:
Long-Distance Dependencies:
• Refers to two different expressions in a text that refer to the same entity.
• The entities can be people, places, things, or concepts.
• Example: "John went to the store. He bought a bag of chips."
Anaphora:
46. Explain the meaning of "syntactic parsing" and the function it serves in NLP.
Syntactic Parsing
Function in NLP
©FIADUZ ZAMAN 10
Syntactic parsing helps computers understand the structure and meaning of sentences
by:
For example, the sentence "The cat sat on the mat with the mouse" has three
possible interpretations:
Ambiguity in speech and natural language processing can lead to confusion and errors
in communication. It is important to resolve ambiguity using context, grammar, or
disambiguation techniques to ensure clear and unambiguous communication.
48. Determine the fundamental ideas underlying various parsing strategies, such as
shallow parsing and dynamic programming parsing.
Shallow Parsing:
49. Apply the CYK algorithm to parse a simple sentence with probabilities assigned to
CFG rules.
CYK Algorithm (for Probabilistic CFGs):
Steps:
1. Initialization: Create a probability table P[i, j, k] for all positions i, j in
the sentence and all CFG symbols k. Set P[i, j, k] to the probability of
the rule that directly generates the substring from position i to j in the
sentence as symbol k.
2. Recursion: For all positions i, j, and k, iterate over all pairs of positions
i' and j' such that i ≤ i' < j ≤ j' and calculate the probabilities of all
rules that generate a substring from i to j' and a substring from i'+1 to
j as the symbol k. Combine these probabilities using the rule probabilities
to update P[i, j, k].
3. Extraction: Parse tree extraction starts at P[1, length(sentence), S],
where S is the start symbol of the CFG. Select the rule with the highest
probability and recursively extract the substrings it generates from the input
sentence.
Example:
©FIADUZ ZAMAN 11
CYK Table:
T m w
Parse Tree:
S (0.8)
|
NP (0.9) VP (0.7)
| |
The man walks
50. Examine and contrast the capabilities of probabilistic CYK parsing versus regular
CYK parsing.
Probabilistic CYK Parsing:
Key Differences:
51. Illustrate how tense agreement between a verb and its subject is one example of the
additional information that feature structures with unification can capture.
Tense Agreement
In sentences, the verb must agree with the subject in tense. For example:
Feature structures with unification can represent this tense agreement. Each word
(noun and verb) has a feature structure that includes features like person, number,
and tense.
Example
Unification
Using unification, we can match the features of the noun and verb:
[Person: 3] [Number: singular] = [Person: 3] [Number: singular]
©FIADUZ ZAMAN 12
This shows that the features of the noun and verb match, indicating correct tense
agreement.
Benefits:
52. Discover the limitations of Probabilistic Lexicalized CFGs and investigate other
approaches to dealing with complex syntactic occurrences.
Limitations of Probabilistic Lexicalized CFGs:
Other Approaches:
53. Construct a feature structure representation for a specific grammatical category (e.g.,
noun phrase) with relevant features like number and case.
Noun Phrase Feature Structure:
[NP
Num: Singular/Plural
Case: Nominative/Accusative/Dative/Genitive
Head: Noun
]
Features:
54. Determine the advantages and disadvantages of shallow parsing compared to full
parsing for specific NLP tasks (e.g., information extraction).
Advantages of Shallow Parsing:
• Speed and Efficiency: Shallow parsing analyzes only limited aspects of a
sentence, making it faster and less computationally intensive than full
parsing.
• Focused Analysis: It focuses on identifying specific linguistic structures
(e.g., noun phrases, verbs) relevant to the task, resulting in tailored
information for the task.
However, full parsing may be necessary when a deeper understanding of the sentence
structure and semantics is required for complex information extraction tasks.
55. Write about how well shallow parsing works for jobs that need more in-depth syntactic
analysis, such as sentiment analysis.
©FIADUZ ZAMAN 13
Shallow parsing, which focuses on basic sentence structure, is not well-suited for
tasks like sentiment analysis that require more detailed syntactic analysis. To capture
the nuances of sentiment, we need to understand the relationships between words in
a sentence and identify their roles in the sentence. Shallow parsing lacks the depth
to provide this level of insight.
5 MARKS
Thematic roles identify the semantic functions of noun phrases in a sentence. They
describe the relationship between the verb and the participants in the event or action
described by the verb.
1. Agent: The one who performs the action (e.g., "John kicked the ball")
2. Patient: The one or thing that undergoes the action (e.g., "The ball was
kicked by John")
3. Instrument: The tool or means by which the action is performed (e.g.,
"John kicked the ball with his foot")
4. Beneficiary: The one who benefits from the action (e.g., "John gave the
gift to Mary")
5. Location: The place where the action occurs (e.g., "John sat on the
bench")
2. Explain how the Word Sense Disambiguation using Dictionary-Based Methods works.
How Word Sense Disambiguation Using Dictionary-Based Methods Works
• The algorithm combines the information from the dictionary lookup and
context analysis.
• It selects the sense that best fits the context and creates an interpretation
of the text.
Advantages:
Disadvantages:
©FIADUZ ZAMAN 14
• Data dependence: The performance of dictionary-based methods is heavily
dependent on the quality and completeness of the dictionary used.
• Scalability: As the size of the dictionary increases, the computational time
required for disambiguation can become prohibitive.
Statistical WSD:
Frame Semantics:
6. Represent the following statements in FOPC about animals and their habitats, and infer
about their ability to fly. All birds can fly. Penguins are birds. Penguins live in cold
climates. If an animal can fly, it does not live in a cold climate. Question: Do penguins
fly?
Statements in FOPC:
1. ∀x(Bird(x) → Fly(x))
2. Penguin(p)
3. Penguin(p) → ColdClimate(p)
4. Fly(x) → ¬ColdClimate(x)
Question as a query:
5. Fly(p)
Inference:
From statement 2, we know that penguins are birds (Bird(p)). From statement 1,
we know that all birds can fly (Fly(x) → Bird(x)). Therefore, we can infer that
penguins can fly (Fly(p)).
However, statement 4 contradicts this inference. It states that if an animal can fly,
it does not live in a cold climate (Fly(x) → ¬ColdClimate(x)). From statement
3, we know that penguins live in a cold climate (ColdClimate(p)). Therefore, we
cannot definitively conclude that penguins can fly.
Answer:
Based on the given information, we cannot determine whether or not penguins can
fly.
7. Represent the following statements in FOPC about animals and their habitats, and
deduce the identity of Tom's grandmother. Every person has a mother. Julia is Tom's
mother. A grandmother is the mother of a person's mother. Question: Who is Tom's
grandmother?
FOPC Representation:
• ∀person(∃mother(person))
• mother(julia, tom)
• ∀person(∀mother(mother(person), grandmother(mother, person)))
Deduction:
©FIADUZ ZAMAN 15
• grandmother(x, tom)
By definition of mother:
• mother(julia, tom)
• mother(x, julia)
• ∃mother(julia)
8. Given the following data, evaluate the degree of similarity between the common words:
'happy' and 'joyful'.
1. Semantic Similarity: Happy and joyful have similar meanings, both
expressing a state of positive emotion. They convey a sense of contentment
and well-being. This high semantic similarity indicates a strong connection
between the words.
2. Lexical Overlap: Both words contain the shared root 'joy,' further
emphasizing their semantic overlap. This linguistic feature adds to their
degree of similarity.
3. Synonymy: Happy and joyful are often used interchangeably in everyday
speech and writing. They can substitute for each other in many contexts
without significantly altering the meaning. This interchangeability enhances
their similarity.
4. Collocation: Happy and joyful frequently co-occur in phrases and
expressions, such as "happy and joyful news" or "a happy and joyful
occasion." This collocation pattern further supports their association.
5. Usage Patterns: In corpus linguistics, happy and joyful exhibit similar usage
patterns. They are both commonly used to describe emotions, events, and
experiences. This consistency in usage indicates a high degree of similarity
between the words.
9. Differentiate between the following: WSD using Supervised learning, WSD using
Dictionary, WSD using Thesaurus.
WSD using Supervised Learning:
• Uses labeled data to train a model that predicts the correct sense of a
word based on its context.
• Relies on a vast training dataset and requires expert annotation.
• Uses a thesaurus to find synonyms and related terms for the target word.
• Relies on semantic relationships between words and their contexts.
The Naive Bayes classifier is a simple but effective probabilistic model used for
classification tasks in NLP. It assumes that the features of a data point are
independent of each other given the class label. This assumption simplifies the training
and prediction process, as it allows us to calculate the probability of a data point
belonging to a class using Bayes' theorem:
P(Class | Features) = (P(Features | Class) * P(Class)) / P(Features)
where:
Advantages:
Disadvantages:
• The independence assumption is not always true, which can lead to errors
• Can be sensitive to outliers and noise in the data
Steps:
©FIADUZ ZAMAN 16
1. Scan the text: Read the text and identify all the punctuation marks.
2. Mark sentence boundaries:
• If there is a period (.), question mark (?), or exclamation mark
(!), mark the end of a sentence.
• If there is a comma (,) followed by a quotation mark (" or '),
mark the start of a sentence.
3. Handle dashes and parentheses:
• If there is a dash (-) or parenthesis (()), treat it as a
sentence boundary only if it has a sentence endpoint inside (e.g.,
"This is a sentence - I'm sure.").
4. Check for abbreviations:
• If a period is followed by a capitalized letter, it may be an
abbreviation. Verify if it is a common abbreviation before marking
it as a sentence boundary.
5. Break up sequences of punctuation:
• If multiple punctuation marks appear in a row (e.g., "..."), break
them up into separate sentence boundaries.
6. Identify paragraph boundaries:
• If there is a double line break (two blank lines in a row), mark
the start of a new paragraph.
• If there is a single line break followed by a capitalized word, mark
the start of a new paragraph (unless it is a quote).
13. Construct the stemmed word for the word 'running' using Porter Stemmer algorithm.
Porter Stemming Algorithm Steps for 'running':
1. Remove Plural Suffixes (-s, -es, -ies): Not applicable here as 'running'
does not end with -s, -es, or -ies.
2. Remove Past Tense Suffixes (-d, -ed, -ing): Remove '-ing' to get 'run'.
3. Remove Suffixes (-ly, -ic, -ism, etc.): Not applicable here as 'run' does
not end with these suffixes.
4. First Replacement Rule: Not applicable here as 'run' is not one of the
specified irregular words.
5. Second Replacement Rule: Not applicable here as 'run' is not one of the
specified irregular words.
©FIADUZ ZAMAN 17
5. Historical Significance: The Penn Treebank was one of the first large-
scale annotated corpora, and it has played a pivotal role in the
development of NLP research. It continues to be used as a benchmark
and reference dataset, contributing to the advancement of the field.
16. Design a Syntactic Tree according to the Penn Treebank structure for the sentence:
'The quick brown fox jumps over the lazy dog.'
Syntactic Tree (Penn Treebank Structure):
(ROOT
(S
(NP (DT The) (JJ quick) (JJ brown) (NN fox))
(VP (VBZ jumps)
(PP (IN over)
(NP (DT the) (JJ lazy) (NN dog))))))
Explanation:
• ROOT: Represents the root of the sentence, which is the sentence itself.
• S: Indicates the sentence type (in this case, a declarative sentence).
• NP: Noun Phrase, which represents the subject and object of the sentence.
• DT: Determiner (e.g., "the")
• JJ: Adjective
• NN: Noun
• VBZ: Verb (present tense, third person singular)
• PP: Prepositional Phrase
• IN: Preposition (e.g., "over")
Constituent Structure:
17. Prepare a tagging structure using Brill’s Tagger for the sentence – 'They refuse to
permit us to obtain the refuse permit.'
Brill's Tagger Tagging Structure:
Word Tag
They PRP
refuse VB
to TO
permit VB
us PRP
to TO
obtain VB
the DT
refuse NN
permit NN
• Rule 1: If the current word is a verb and the previous word is a modal
verb, tag the current word as a past participle.
▪ "refuse" is tagged as "VBN" after "to" (modal verb).
Word Tag
They PRP
refuse VBN
©FIADUZ ZAMAN 18
Word Tag
to TO
permit VB
us PRP
to TO
obtain VB
the DT
refuse NN
permit NN
• Rule 2: If the current word is a noun and the previous word is a definite
article, tag the current word as a singular noun.
▪ "refuse" is tagged as "NN" after "the".
Word Tag
They PRP
refuse VBN
to TO
permit VB
us PRP
to TO
obtain VB
the DT
refuse NN
permit NN
18. How the word 'car' will be structured in the WordNet based on the following: Synsets,
Hypernyms, Hyponyms, Meronyms, Holonyms.
Synsets:
Hypernyms:
• Vehicle
Hyponyms:
• Sedan
• Coupe
• Truck
• Van
Meronyms:
• Engine
• Transmission
• Wheels
Holonyms:
• Garage
©FIADUZ ZAMAN 19
19. Explain the structure of semantic roles in PropBank using examples.
Structure of Semantic Roles in PropBank
Core Roles:
• Agent (A0): The primary actor performing the action. (e.g., "John" in
"John opened the door.")
• Patient (A1): The recipient or target of the action. (e.g., "the door" in
"John opened the door.")
• Instrument (A2): The means by which the action is performed. (e.g., "the
key" in "He unlocked the door with the key.")
Peripheral Roles:
• Beneficiary (A3): The recipient of the benefits of the action. (e.g., "the
children" in "He bought toys for the children.")
• Destination (A4): The location towards which the action is directed. (e.g.,
"the table" in "He put the book on the table.")
Examples:
20. Provide the structure of annotation in PropBank for the sentence: 'The company sold
the subsidiary.'
Annotation Structure in PropBank:
Predicate: sell
Arguments:
Annotation:
[ARG0 The company] [ARG1 the subsidiary] [V sell]
Breakdown:
• [ARG0 The company] represents the entity that performs the action of
selling.
• [ARG1 the subsidiary] represents the entity that is sold.
• [V sell] represents the verb that describes the action.
This annotation tells us that the semantic roles of the sentence are:
21. Briefly describe Coherence relation between utterances and Coherence relation
between entities.
Coherence Relation between Utterances:
• Ensures that individual sentences within a text flow smoothly and connect
meaningfully.
• Can be achieved through logical connectors (e.g., and, but, or), anaphora
(e.g., pronouns), or shared themes.
©FIADUZ ZAMAN 20
22. Briefly describe Unsupervised and Supervised algorithms for Discourse
Segmentation.
Unsupervised Algorithms
Supervised Algorithms
23. Describe Hebbs proposed solutions for the following discourse relations with example:
Result, Explanation, Parallel.
Result:
Explanation:
Parallel:
24. Identify the Initial Center, Backward Center and Forward Center in the sentence: 'Alice
went to the store. She bought milk. Then, Bob arrived home.'
Initial Center: Alice (The sentence starts with Alice.)
Backward Center: Store (The previous sentence mentions going to the store.)
26. Discourse Analysis is beneficial for Information retrieval. Justify this statement.
Discourse Analysis benefits Information Retrieval (IR) by:
1. Identifying Document Structure: Discourse Analysis reveals how text is
organized into coherent units (e.g., paragraphs, headings). This structure
can guide IR systems to identify relevant passages and focus their retrieval
efforts.
2. Understanding Cohesion and Coherence: Discourse Analysis investigates
how sentences and paragraphs connect logically (e.g., through referential
chains, connectors). This understanding helps IR systems identify
relationships between keywords and select relevant documents that provide
cohesive and coherent information.
3. Inferring User Intent: Discourse Analysis analyzes the context in which
users' queries are formulated. It can help IR systems understand the
user's underlying goals, which can inform the selection of appropriate
documents and ranking of results.
4. Evaluating Relevance: Discourse Analysis provides a framework for
evaluating the relevance of documents to a user's query. By analyzing
the coherence and referential relationships within a document, IR systems
can determine if it adequately addresses the user's information need.
5. Improving User Experience: Discourse-aware IR systems can enhance the
user experience by providing more targeted and contextually relevant
results. This can reduce the effort required for users to find the information
they seek and improve overall satisfaction with the IR system.
27. Discourse Analysis is beneficial for Text summarization. Justify this statement.
©FIADUZ ZAMAN 21
Discourse Analysis Benefits for Text Summarization:
Discourse analysis, which examines the structure and coherence of a text, provides
valuable insights for effective text summarization. Here are the reasons why:
2. Coherence Analysis: By examining how different parts of the text connect and flow
together, discourse analysis ensures that the summary maintains the original text's
coherence. This results in a summary that is well-organized and easy to follow.
5. Maintaining the Author's Purpose: Discourse analysis helps ensure that the summary
accurately conveys the author's intended purpose and perspective. By understanding
the text's language use, tone, and implicit meanings, the summary can effectively
capture the author's main message.
28. Discourse Analysis is beneficial for Machine translation. Justify this statement.
Discourse Analysis Enhances Machine Translation
Discourse analysis, the study of how language is used in context, is crucial for
machine translation because it:
1. Captures Contextual Meaning: Discourse analysis helps understand the
pragmatic and semantic relationships within a text, allowing machines to
translate not just individual words but also entire sentences or passages
coherently.
2. Resolves Ambiguities: Context provides clues to resolve ambiguous words
or phrases. By analyzing discourse, machines can identify the intended
meaning and produce more accurate translations.
3. Preserves Text Structure: Discourse analysis aids in understanding the
overall structure and flow of a text, which is essential for maintaining
coherence and cohesion in the translation.
4. Improves Cohesion and Coherence: It helps identify relationships between
text components (e.g., anaphora, ellipsis) and ensures that these
relationships are accurately reflected in the translation.
5. Enhances Cultural Sensitivity: Discourse analysis helps account for cultural
and linguistic differences between languages, reducing the risk of
mistranslations that arise from literal or surface-level interpretations.
29. Discourse Analysis is beneficial for Question answering. Justify this statement.
Discourse Analysis Enhances Question Answering
Reference phenomena refers to how humans use language to refer to objects, events,
and concepts in the real world. There are three main aspects to consider:
©FIADUZ ZAMAN 22
Reference phenomena is crucial because it allows us to understand how individuals
convey information about shared objects and experiences. It involves the ability to
identify and interpret referring expressions correctly, taking into account the context
and the intentions of the speaker.
31. Summarize the Reference Phenomena for the text: 'Alice loves to read books. She
often visits the library to borrow new ones. The librarian there is very helpful and always
recommends interesting titles.'
Reference Phenomena
32. Summarize the Reference Phenomena for the text: 'John bought a new car. He is very
excited about it. The car is sleek and has advanced features. John plans to take it on a
road trip next week.'
Reference Phenomena:
33. Summarize the Reference Phenomena for the text: 'Alice was walking through the
park when she saw a beautiful flower. She bent down to smell it, but then she noticed a
caterpillar crawling on its petals. Alice screamed and jumped back, startled by the
unexpected creature.'
Reference Phenomena Summary:
2. Reduced Search Space: By pairing potential coreferences, the search space for
coreference resolution is narrowed down. This makes the task more efficient and
reduces the chance of incorrect coreference assignment.
©FIADUZ ZAMAN 23
35. Deep learning, particularly neural networks, has revolutionized coreference
resolution. Justify the statement.
Deep learning has revolutionized coreference resolution for several reasons:
1. Enhanced Feature Extraction: Neural networks can learn complex relationships and
patterns in text that traditional natural language processing (NLP) methods may
miss. This allows them to extract more comprehensive and accurate features for
coreference resolution, leading to improved performance.
5. Integration with other NLP Tasks: Neural networks for coreference resolution can be
easily integrated with other NLP tasks, such as named entity recognition and part-
of-speech tagging. This integration allows for synergistic performance improvements.
NLP involves processing various forms of natural language input, known as modalities.
These include:
37. Recognize the importance of several components that NLP is made up of.
5 Components of NLP and Their Importance
1. Lexicon: A dictionary of words and their meanings. It allows NLP to
understand the words in a text.
2. Syntax: The rules governing how words are combined into sentences. It
helps NLP identify the structure and relationships within text.
3. Semantics: The meaning of words and sentences. It enables NLP to
extract the intent and concepts conveyed by text.
4. Pragmatics: The context and real-world knowledge used to interpret
language. It allows NLP to understand the implied meaning and intentions
behind text.
5. Machine Learning: Algorithms that enable NLP systems to learn from data
and improve their performance over time. It empowers NLP to handle
complex language tasks, such as sentiment analysis and text
summarization.
NLP processing involves several steps to extract meaningful information from text
data:
39. Identify and Describe the ambiguity in following sentences - a. The man kept the dog
in the house b. Book the flight c. I saw a bat d. I made her duck e. John and Mary are
married.
a. The man kept the dog in the house
• Ambiguity: The sentence doesn't specify who the owner of the house is.
It could be the man or someone else.
©FIADUZ ZAMAN 24
c. I saw a bat
• Ambiguity: The sentence doesn't clarify if the speaker saw a baseball bat
or an animal bat.
• Ambiguity: The sentence doesn't specify whether John and Mary are
currently married or were married in the past.
• "beauty" (the root word, which conveys the core meaning of the word)
• "-ful" (the suffix, which adds the meaning of "full of" or "having")
• "-ly" (the adverbial suffix, which indicates that the word is being used
as an adverb)
By analyzing the morphology of "beautiful," we can understand its meaning, its part
of speech, and its relationship to other words in the language. This information is
essential for understanding the syntax and semantics of the sentence in which the
word is used.
41. Summarize the use of FSTs (Finite State Transducers) in morphological analysis.
FSTs (Finite State Transducers) are powerful tools used in morphological analysis,
the study of word structure. They are finite state machines that map input strings to
output strings, allowing for the representation and manipulation of morphological rules
and transformations. FSTs are widely used in NLP (Natural Language Processing)
due to their efficiency, flexibility, and ability to handle complex morphological
phenomena.
Regular expressions are powerful tools that play a significant role in morphological
analysis, the study of how words are structured. They allow us to:
43. Observe the problems associated with stemming and estimate a solution for the
problem.
Problems with Stemming:
• Loss of Meaning: Removing suffixes can alter the meaning of words, e.g.,
"computing" vs. "compute."
• Over-Stemming: Removal of prefixes can result in unintended effects,
e.g., "watermelon" becomes "water."
• Under-Stemming: Stemming algorithms may not remove all relevant
suffixes, leading to imprecise results.
Solution:
Lemmatization provides more accurate stems while preserving the original meaning of
words. However, it requires a larger vocabulary and can be computationally intensive
compared to stemming.
44. Discuss the problems associated with lemmatization and estimate a solution for the
problem.
Problems with Lemmatization:
©FIADUZ ZAMAN 25
• Homographs: Words with the same spelling but different meanings can
have different lemmas (e.g., "bass" for the fish vs. the musical
instrument).
• Context Dependency: Lemmas can vary depending on the context of the
sentence (e.g., "run" can be a verb or a noun).
• Inflectional Variation: Lemmas represent the root form of a word, but
words can have multiple inflections (e.g., "run," "runs," "running").
Estimated Solution:
Additional Strategies:
45. With the help of examples, describe Ngrams, Unigrams, Bigrams, and Trigrams.
Ngrams
Ngrams are sequences of words used in natural language processing. They capture
patterns and relationships within text data.
Types of Ngrams:
3. Trigram (N=3): A sequence of three adjacent words. Example: "the big dog"
Applications:
Example:
Consider the sentence: "The big brown dog ran down the street."
By analyzing these ngrams, we can gain insights into the structure and meaning of
the text.
Given sentence: "The quick brown fox jumps over the lazy dog."
Word level analysis helps machines understand the individual units of speech in a
sentence, enabling them to:
©FIADUZ ZAMAN 26
• Determine the meaning of words and sentences
• Identify grammatical structures
• Recognize relationships between words
47. How to apply context-free grammar rules to analyze the structure of simple English
sentences.
How to Apply Context-Free Grammar Rules to Analyze English Sentences:
Example:
Analyze the sentence "The quick brown fox jumped over the lazy dog." using the
following grammar rules:
• S -> NP VP
• NP -> Det N
• VP -> V NP
• Det -> the
• N -> fox | dog
• V -> jumped | over
Steps:
1. Start symbol: S
2. Parse the sentence: S -> NP VP -> Det N VP -> Det N VP ->
Det N V NP -> Det N V Det N
3. Identify constituents: NP (the fox), NP (the dog), VP (jumped over),
VP (over the)
4. Label constituents: NP, NP, VP, VP
48. Compare and contrast dependency grammar and context-free grammar for
representing sentence structure.
Dependency Grammar
ate
|
The a sandwich
| |
boy
Context-Free Grammar
Comparison
Contrast
©FIADUZ ZAMAN 27
• Dependency grammar focuses on the relationships between words, while
context-free grammar focuses on the rules that generate valid sentences.
• Dependency grammar represents sentence structure as a tree, while
context-free grammar uses rules to define how strings can be transformed.
• Dependency grammar is more suitable for representing complex sentences,
while context-free grammar is more generative.
49. Determine whether a statement has any possible ambiguities and describe how
various parsing algorithms may handle them.
Ambiguity in Natural Language:
Ambiguity occurs when a sentence can be interpreted in multiple ways due to unclear
grammar or semantics.
3. Chart Parsing:
5. Semantic Attachment:
Example:
Bottom-Up Parsing: Can generate multiple parse trees, one for each interpretation.
Chart Parsing: Records both interpretations and allows further processing to resolve
the ambiguity.
50. For particular NLP jobs, compare and contrast the benefits and drawbacks of shallow
parsing versus dynamic programming parsing.
Shallow Parsing
• Benefits:
▪ Fast and efficient
▪ Can handle ungrammatical sentences
▪ Useful for extracting specific information (e.g., named entities)
• Drawbacks:
▪ Does not provide a complete syntactic analysis
▪ May overgenerate or undergenerate parse trees
• Benefits:
▪ Provides a complete syntactic analysis
▪ Can handle complex and ambiguous sentences
▪ Supports disambiguation techniques
• Drawbacks:
▪ Slower and more computationally expensive than shallow parsing
▪ May be impractical for large text corpora
Comparison
©FIADUZ ZAMAN 28
Dynamic Programming
Feature Shallow Parsing
Parsing
Computational
Low High
cost
The first row and first column of the matrix represent the characters in the first and
second strings, respectively. The cell in the ith row and jth column represents the
minimum number of edits required to transform the first i characters of the first string
into the first j characters of the second string.
• If the ith character of the first string is equal to the jth character of the
second string, then the cost of transforming the first i characters of the
first string into the first j characters of the second string is the same as
the cost of transforming the first i-1 characters of the first string into the
first j-1 characters of the second string.
• If the ith character of the first string is not equal to the jth character of
the second string, then the cost of transforming the first i characters of
the first string into the first j characters of the second string is the
minimum of the following three costs:
▪ The cost of transforming the first i-1 characters of the first string
into the first j characters of the second string, plus the cost of
inserting the ith character of the first string.
▪ The cost of transforming the first i characters of the first string into
the first j-1 characters of the second string, plus the cost of
deleting the jth character of the second string.
▪ The cost of transforming the first i-1 characters of the first string
into the first j-1 characters of the second string, plus the cost of
substituting the ith character of the first string with the jth character
of the second string.
The Levenshtein distance between INTENTION and EXECUTION is the value in the
last cell of the matrix, which is 7. This means that it takes 7 edits to transform
INTENTION into EXECUTION.
©FIADUZ ZAMAN 29