IT-802-B Natural Language Processing

Natural Language Processing (IT-802-B) Important Questions

RGPV · B.Tech · IT · Semester 8 · Current scheme · 0 papers

  1. Read the answers

    Start with the topics that come every year.

  2. Revise unit notes

    Go through each unit once to score more.

Paperwala Imp Topics - Natural Language Processing important questions

Download Paperwala Imp Question & Answer (PDF)

Chosen from the syllabus. No past paper of this subject is on this site yet, so repeats could not be counted.

Natural Language Processing important questions with answers

Each answer starts with the short answer. Then come the points to write, a diagram and an exam tip. The topics are chosen from the syllabus.

Q1. Levels of NLP, ambiguity and computational challenges

From the syllabus · Unit 1

From the papers

  • “Unit 1: Introduction to various levels of NLP, ambiguities and computational challenges.” (Syllabus)

The short answer

The levels of NLP are steps from sound or characters up to meaning in use: lexical, syntactic, semantic, discourse and pragmatic. Ambiguity at each level is the main computational challenge.

Write these points

Levels

  1. Lexical and morphological: words and their parts.
  2. Syntactic: how words form phrases and sentences.
  3. Semantic: the meaning of words and sentences.
  4. Discourse: how sentences link, for example pronoun reference.
  5. Pragmatic: meaning in the situation, such as a polite request.

Ambiguity and challenges

  • Lexical: bank is a money place or a river side.
  • Syntactic: I saw the man with a telescope has two parses.
  • Semantic and pragmatic: Can you open the window? asks for an action.
  • Other challenges: spelling mistakes, slang, mixed languages such as Hinglish, free word order in Indian languages. Many languages also have little labelled data.

One sentence at three levels.

Sentence: Time flies like an arrow.

Lexical: flies is a noun or a verb. Syntactic: time may be the subject or a command verb.

Without context a program cannot choose. A person uses common sense.

Real-life example

When you ask a voice assistant to call Maa, it must find the right contact. It must also read the request as an action. Each level of NLP handles one such task. A mistake at an early level spoils the later ones.

Diagram: Levels of NLP, ambiguity and computational challenges

Same or opposite: lexical and syntactic ambiguity

PointLexical ambiguitySyntactic ambiguitySame or opposite
SourceA word with many sensesA sentence with many parsesOpposite
Examplebanksaw a man with a telescopeOpposite
Solved by contextYesYesSame
Appears in every languageYesYesSame

Exam tip. List the five levels in order. Give one ambiguity example for each of three levels. Close with two challenges for Indian languages.

Back to the topic list

Q2. Real life applications of NLP

From the syllabus · Unit 1

From the papers

  • “Unit 1: Real life applications of NLP such as spell and grammar checkers, information extraction, question answering, machine translation.” (Syllabus)

The short answer

Common real life applications of NLP are spell and grammar checkers, information extraction, question answering and machine translation.

Write these points

Applications

  • Spell and grammar checker: finds a wrong word with edit distance and a dictionary. A grammar checker uses a language model or rules.
  • Information extraction: pulls names, dates and relations out of text into a table.
  • Question answering: returns a short answer from documents.
  • Machine translation: converts text from one language to another.
  • Other uses: summaries, sentiment analysis, chat bots, voice typing.

Spell check by edit distance.

Typed word: recieve. Dictionary word: receive.

Edit distance is the least number of insert, delete or replace steps. Here it is 2 (swap of i and e counts as two replacements).

The checker lists dictionary words within distance 2 and ranks them by how common they are.

Information extraction in short

  • Input: Ravi joined Infosys in Pune on 5 May.
  • Output row: person Ravi, company Infosys, city Pune, date 5 May.

Real-life example

Gmail suggests a correction when you type recieve. Google Translate turns a Hindi sentence into English. A bank chat bot answers What is my balance? from a database. These are the four applications in daily use.

Diagram: Real life applications of NLP

Same or opposite: information extraction and question answering

PointInformation extractionQuestion answeringSame or opposite
OutputTable of factsOne answerOpposite
Driven byFixed fieldsA user questionOpposite
Reads unstructured textYesYesSame
Uses entity recognitionYesOftenSame

Exam tip. Give one line and one real product for each application. Show the edit distance step for the spell checker. This one number shows understanding.

Back to the topic list

Q3. Character encoding

From the syllabus · Unit 2

From the papers

  • “Unit 2: Character encoding.” (Syllabus)

The short answer

Character encoding maps each character to a number and then to bytes. Unicode gives every character one code point and UTF-8 stores it in 1 to 4 bytes.

Write these points

Key ideas

  • ASCII uses 7 bits for 128 English characters. It cannot hold Hindi.
  • Unicode assigns a code point to each character of all major scripts, written U+0905 for the Hindi letter A.
  • UTF-8 is variable length. English letters take 1 byte, so it is compatible with ASCII.
  • UTF-16 uses 2 or 4 bytes. Wrong encoding gives garbled text, called mojibake.
  • For NLP: read and write files in UTF-8 and normalise text, because one letter can be written in more than one way.
CharacterCode pointUTF-8 bytesCount
AU+0041411
éU+00E9c3 a92
अU+0905e0 a4 853
₹U+20B9e2 82 b93

Length of a Hindi word.

The word भारत has 4 characters. In UTF-8 each takes 3 bytes, so the size is 12 bytes.

A program that counts bytes instead of characters will report 12 and cut words in the middle.

Real-life example

When a WhatsApp message in Hindi shows as question marks on an old phone, the phone used the wrong encoding. Unicode fixes this by giving one number to each letter. Every modern app now stores text in UTF-8.

Diagram: Character encoding

Same or opposite: ASCII and Unicode

PointASCIIUnicodeSame or opposite
Characters covered128Over 140,000Opposite
Hindi lettersNoYesOpposite
Maps characters to numbersYesYesSame
English part is the sameYesYesSame

Exam tip. Draw the small table of characters with their bytes. State that UTF-8 matches ASCII for English. Mention the Hindi example to show a script outside ASCII.

Back to the topic list

Q4. Word and sentence segmentation

From the syllabus · Unit 2

From the papers

  • “Unit 2: Word segmentation, sentence segmentation.” (Syllabus)

The short answer

Word segmentation splits text into words and sentence segmentation splits it into sentences. Both look simple in English and are hard in some cases.

Write these points

Word segmentation (tokenization)

  • In English, split on spaces and punctuation. Special cases: do not, U.S.A., 3.14, email and web addresses.
  • Chinese and Thai have no spaces between words. A dictionary or a model finds the breaks.
  • German joins words into long compounds. Hindi has clitics written with a space or joined, so rules vary.

Sentence segmentation

  • A full stop usually ends a sentence. It can also end an abbreviation (Dr., p.m.) or sit inside a number.
  • Rules use the next word: a capital letter after a stop is a hint.
  • A classifier can learn from features such as the word before the stop and its length.

A simple rule fails.

Text: Dr. Rao met Mr. Singh at 5 p.m. on Monday. They left.

Rule: split after a stop followed by a space and a capital letter.

Result: the rule cuts after Dr. and after Mr. and gives 4 pieces. The correct count is 2 sentences.

Fix: keep a list of abbreviations and do not split after them.

Real-life example

A news app that makes short summaries must find where each sentence ends. If it cuts after Dr. the summary shows half a sentence. A list of known abbreviations prevents this.

Diagram: Word and sentence segmentation

Same or opposite: word and sentence segmentation

PointWord segmentationSentence segmentationSame or opposite
Unit foundTokenSentenceOpposite
Main clueSpace and punctuationFull stop and capitalOpposite
Needs rules for special casesYesYesSame
Hard in some scriptsYesLessOpposite

Exam tip. Give the failing text and show the wrong and right count. The example proves that you know the exception. Add one non-English case for word breaks.

Back to the topic list

Q5. Corpora and corpus analysis

From the syllabus · Unit 2

From the papers

  • “Unit 2: Introduction to corpora, corpora analysis.” (Syllabus)

The short answer

A corpus is a large collection of real text kept in digital form. Corpus analysis counts and studies the text to learn how words behave.

Write these points

Corpus

  • It can be raw or annotated with tags, parse trees or senses.
  • It can be balanced (many genres) or special (news only, medical only).
  • Examples: Brown corpus, Penn Treebank. Hindi news sites give raw Hindi corpora.
  • Uses: train taggers and language models, test systems and build dictionaries.

Corpus analysis

  • Tokens and types: tokens are all words, types are the different words.
  • Type token ratio = types / tokens.
  • Frequency list: the most common words are mostly function words such as the and of.
  • Zipf law: frequency is about 1 / rank. The word at rank 10 is about half as common as the one at rank 5.
  • Concordance: shows a word with its neighbours.

Counting a tiny corpus.

Text: the cat sat on the mat the dog sat on the log.

Tokens = 12. Types = 7. Type token ratio = 7 / 12 = 0.583.

Most common: the 4, sat 2, on 2.

Real-life example

A publisher building a Hindi spell checker first collects thousands of news articles. Counting word frequencies tells which words are common enough to put in the dictionary. This count is corpus analysis.

Diagram: Corpora and corpus analysis

Same or opposite: raw and annotated corpus

PointRaw corpusAnnotated corpusSame or opposite
ContentPlain textText with labelsOpposite
Cost to buildLowHighOpposite
Used for counting wordsYesYesSame
Used to train taggersNoYesOpposite

Exam tip. Define tokens and types and show the count with a small text. State Zipf law in one line. Name one annotated corpus.

Back to the topic list

Q6. Inflectional and derivational morphology, analysis with FSTs

From the syllabus · Unit 3

From the papers

  • “Unit 3: Inflectional and derivation morphology, morphological analysis and generation using finite state transducers.” (Syllabus)

The short answer

Inflection changes the form of a word without changing its class and derivation builds a new word. Finite state transducers (FSTs) do morphological analysis and generation.

Write these points

Two kinds of morphology

  • Inflectional: walk, walks, walking. Marks tense, number, case and gender.
  • Derivational: teach, teacher, teachable. Often changes the class.
  • Hindi inflects heavily: ladka, ladke, ladki, ladkiyan.

Analysis and generation with an FST

  • Analysis: surface form to lexical form. Example: cities to city +N +PL.
  • Generation: the reverse. city +N +PL to cities.
  • A lexicon FST holds the stems. Spelling rule FSTs make changes such as y to ie.
  • The machines are joined (composed) into one machine that works in both directions.
def plural(w):
    if w.endswith(('s','x','z','ch','sh')): return w + 'es'
    if w.endswith('y') and w[-2] not in 'aeiou': return w[:-1] + 'ies'
    return w + 's'
# cat->cats  box->boxes  city->cities  boy->boys  church->churches

Generate: fox +N +PL.

The stem is fox. The plural marker is s. The spelling rule says insert e after x before s.

Output: foxes.

Real-life example

A railway site in Hindi must treat gaadi and gaadiyan as the same word when you search. A morphological analyser maps both to the stem. The same tool can produce the right form when the site writes a reply.

Diagram: Inflectional and derivational morphology, analysis with FSTs

Same or opposite: analysis and generation

PointAnalysisGenerationSame or opposite
InputSurface wordStem and tagsOpposite
OutputStem and tagsSurface wordOpposite
Uses the same FSTYesYesSame
Uses spelling rulesYesYesSame

Exam tip. Define both kinds of morphology with two words each. Draw the FST with an input and output label on each arc. Show one analysis and one generation.

Back to the topic list

Q7. Word types and POS tagging

From the syllabus · Unit 3

From the papers

  • “Unit 3: Introduction to word types, POS tagging.” (Syllabus)

The short answer

A word type is a part of speech class such as noun or verb. POS tagging assigns one tag to each word in context.

Write these points

Word types

  • Open classes take new words: nouns, verbs, adjectives, adverbs.
  • Closed classes have a fixed small set: pronouns, prepositions, determiners, conjunctions.
  • Tag sets: the Penn Treebank set has 45 tags such as NN, VB, JJ, DT.
  • The same word has different tags in different places: book in Book a ticket and Read a book.

Tagging in short

  • Rule-based: lexicon plus rules that remove wrong tags.
  • Statistical: HMM or MaxEnt chooses the most likely tag sequence.
  • A baseline of the most frequent tag per word is about 90 percent right on English news text. Good taggers reach about 97 percent.

Tag a sentence.

Ram/NNP eats/VBZ ripe/JJ mangoes/NNS.

Open class words: Ram, eats, ripe, mangoes. A closed class word would be the.

Real-life example

A grammar app that reads She books a ticket marks books as a verb. It then checks that the verb agrees with she. Tagging comes before such checks.

Diagram: Word types and POS tagging

Same or opposite: open and closed word classes

PointOpen classClosed classSame or opposite
New membersAdded oftenRarelyOpposite
ExamplesNoun, verbPronoun, prepositionOpposite
Needed for taggingYesYesSame
SizeLargeSmallOpposite

Exam tip. Name the tag set, then tag one sentence word by word. State the ambiguity example with book. Mention the baseline so that the examiner sees you know accuracy levels.

Back to the topic list

Q8. Maximum entropy model for POS tagging

From the syllabus · Unit 3

From the papers

  • “Unit 3: Maximum entropy models for POS tagging.” (Syllabus)

The short answer

A Maximum Entropy model for POS tagging scores each possible tag from weighted features of the word and its context. It picks the highest.

Write these points

How it tags

  • Features: the word itself, its suffix, a capital letter, the previous tag and the next word.
  • Model: P(tag | context) = exp(sum of weights for active features) / Z. Z is the sum over all tags.
  • Training: find weights that match the counts seen in the tagged corpus.
  • Decoding: tag left to right with beam search, or use Viterbi over tag sequences.
  • Benefit: many overlapping features, unlike a plain HMM.

Score two tags for a word.

Active features: ends in s and previous word is the. Weights for N: 0.2 and 1.5. For V: 0.9 and minus 1.0.

exp(1.7) = 5.47 for N and exp(minus 0.1) = 0.905 for V. Z = 6.38.

P(N) = 0.858 and P(V) = 0.142. The tag is N.

Remember. The weights above are made up to show the working. A real model learns them from data.

Real-life example

Think of a quiz in which the judge adds points for each clue: a capital letter, an ending s, a the before it. The option with the most points wins. A MaxEnt tagger scores tags in the same way.

Diagram: Maximum entropy model for POS tagging

Same or opposite: MaxEnt tagger and HMM tagger

PointMaxEnt taggerHMM taggerSame or opposite
Model typeDiscriminativeGenerativeOpposite
Uses rich featuresYesLimitedOpposite
Needs a tagged corpusYesYesSame
Gives a probability per tagYesYesSame

Exam tip. Write the formula, then show the exp and Z steps with numbers. State why features may overlap. Keep the working in a table or neat lines.

Back to the topic list

Q9. Multi-word expressions

From the syllabus · Unit 3

From the papers

  • “Unit 3: Multi-word expressions.” (Syllabus)

The short answer

A multi-word expression (MWE) is a group of words whose meaning or form cannot be got from the words alone, such as kick the bucket or New Delhi.

Write these points

Types

  • Fixed phrases: by and large, ad hoc.
  • Idioms: kick the bucket (to die), spill the beans.
  • Compound nouns: ice cream, railway station.
  • Phrasal verbs: give up, look after.
  • Named entities: New Delhi, State Bank of India.
  • Collocations: strong tea, heavy rain.

Why they matter and how to find them

  • Word by word translation of an idiom gives nonsense.
  • Find them by frequency, by PMI or by a dictionary list.
  • A tagger or parser treats a fixed phrase as one unit.

PMI of a pair.

In 10,000 words, word a appears 50 times, word b 40 times and the pair a b 20 times.

PMI = log2( (20/10000) / ((50/10000) x (40/10000)) ) = log2(100) = 6.64.

A high value says the words appear together far more than by chance.

Real-life example

A Hindi to English tool that turns aankhon ka tara word by word gets stars of eyes. The correct reading is a dear child. The tool needs a list of such phrases to translate them as one unit.

Diagram: Multi-word expressions

Same or opposite: idiom and collocation

PointIdiomCollocationSame or opposite
Meaning from the wordsNoYes, mostlyOpposite
Can swap a wordNoSometimesOpposite
Fixed in common useYesYesSame
Hard for translation toolsYesYesSame

Exam tip. Give six types with one example each. Show the PMI formula with the worked numbers. State that translation is the main problem.

Back to the topic list

Q10. Language models and simple n-gram models

From the syllabus · Unit 4

From the papers

  • “Unit 4: The role of language models, simple n-gram models.” (Syllabus)

The short answer

A language model gives the probability of a sentence or of the next word. An n-gram model estimates it from counts of n word runs in a corpus.

Write these points

Role of language models

  • Speech recognition: choose the more likely of two similar sounding sentences.
  • Spelling correction and typing: rank suggestions.
  • Machine translation: prefer fluent output.
  • Text generation: predict the next word.

Simple n-gram models

  • Chain rule: P(w1 w2 w3) = P(w1) x P(w2 | w1) x P(w3 | w1 w2).
  • Bigram assumption: only the last word counts, so P(w3 | w1 w2) is replaced by P(w3 | w2).
  • Estimate: P(w2 | w1) = count(w1 w2) / count(w1). This is the maximum likelihood estimate.

Bigram probability of: I like tea.

Corpus: I like tea. I like coffee. You like tea. I drink tea.

P(I | start) = 3/4. P(like | I) = 2/3. P(tea | like) = 2/3. P(end | tea) = 3/3.

P = 0.75 x 0.667 x 0.667 x 1 = 0.333.

Real-life example

The suggestion strip on a phone keyboard shows tea after I like. It looked at what words followed in your earlier messages. This guess is a bigram model at work.

Diagram: Language models and simple n-gram models

Same or opposite: trigram and bigram model

PointTrigramBigramSame or opposite
Words of contextTwoOneOpposite
Data neededMoreLessOpposite
Uses counts from a corpusYesYesSame
Needs smoothingYesYesSame

Exam tip. Write the chain rule, then the bigram estimate, then the worked sentence. Mention applications in a line. Keep the counts visible.

Back to the topic list

Start with the latest papers

Previous year papers will be added soon!

Natural Language Processing (IT-802-B) FAQs

What are the most important topics in Natural Language Processing?

No past paper of this subject is on this site yet, so the topics were chosen from the syllabus. The first five: Levels of NLP, ambiguity and computational challenges; Real life applications of NLP; Character encoding; Word and sentence segmentation; Corpora and corpus analysis.

How were these Natural Language Processing important questions chosen?

Each topic was taken from the syllabus units. No past paper was available to count repeats, and the answers are not teacher-reviewed, so use them together with your syllabus.

Is there a PDF of Natural Language Processing important questions with answers?

Yes. The Paperwala Imp Question & Answer PDF for Natural Language Processing is free to download from this page.

The 10 topics of Natural Language Processing (IT-802-B) for RGPV B.Tech IT semester 8, chosen from the syllabus. No past paper of this subject is on this site yet, so repeats could not be counted.