Major links



Quicklinks


๐Ÿ“Œ Quick Links
[ DBMS ] [ DDB ] [ ML ] [ DL ] [ NLP ] [ DSA ] [ PDB ] [ DWDM ] [ Quizzes ]


Showing posts with label HMM. Show all posts
Showing posts with label HMM. Show all posts

Monday, December 1, 2025

HMM-Based POS Tagging MCQs | Viterbi, Emission & Transition Explained

✔ Scroll down and test yourself — answers are hidden under the “View Answer” button.

1. In an HMM-based POS tagger, hidden states typically represent:

A. Words in the text
B. POS tags
C. Syntactic chunks
D. Sentence categories

Answer: B
Explanation:

In POS tagging using Hidden Markov Models, hidden states correspond to POS tags like NN, VB, DT, etc., while observations are the actual words.

________________________________________
2. The emission probability in an HMM for POS tagging represents:

A. P(tag | word)
B. P(word | tag)
C. P(tag | sentence length)
D. P(sentence | tags)

Answer: B
Explanation:

Emission probability in HMM defines the likelihood of generating (emitting) a word from a particular POS tag: P(word | tag).

What is emission probability?

In the context of Hidden Markov Models (HMMs), the emission probability refers to the likelihood of observing a particular output (observation) from a given hidden state.

HMM Components

An HMM consists of:

  • Hidden states (S) (These are not directly observable), Observations (O) (These are visible outputs generated by the hidden states),Transition probabilities (A) (Probability of moving from one hidden state to another), and Emission probabilities (B) (Probability of a hidden state generating a particular observation).


Emission Probability Formula

If s is a hidden state and o is an observation:

Emission probability = P(observation | state) = P(o | s)

In POS tagging, this is the probability that a tag emits a particular word.

Example: P("dog" | NN) = 0.005

This means that the word "dog" is generated by the NN (noun) tag with probability 0.005.

Intuition

  • Hidden state: “POS tag of the current word”
  • Observation: “Actual word in the sentence”

Emission probability answers:

“Given that the current word has tag NN, how likely is it to be this particular word?”

________________________________________
3. Transition probabilities in POS HMM tagging capture:

A. Probability of a word given tag
B. Probability of current tag given previous tag
C. Probability of unknown word generation
D. Probability of sentence boundary

Answer: B
Explanation:

Transition probability expresses tag–tag dependency e.g., P(NN | DT) — more likely because determiners commonly precede nouns.

What is transition probability in HMM context?

In Hidden Markov Models (HMMs), the transition probability represents the likelihood of moving from one hidden state to another in a sequence.

Formal Definition

If st is the current hidden state and st-1 is the previous hidden state, then:

Transition Probability = P(sโ‚œ | sโ‚œ₋₁)
  

It answers the question:

Given the previous hidden state, what is the probability of transitioning to the next state?

Where It Applies

In tasks like Part-of-Speech (POS) tagging:

  • Hidden states = POS tags (NN, VB, DT, JJ...)
  • Transition probability models how likely one tag follows another

Example

P(NN | DT) = 0.65
  

Meaning: If the previous tag is DT (determiner), there is a 65% chance the next tag is NN (noun) (common phrase pattern: the cat, a dog, this book).

________________________________________
4. The algorithm used to find the most probable tag sequence in POS HMM is:

A. Forward algorithm
B. CYK algorithm
C. Viterbi decoding
D. Naive Bayes

Answer: C
Explanation:

Viterbi is a dynamic programming algorithm used for optimal decoding — finding the best tag sequence for a sentence.

Viterbi algorithm

The Viterbi algorithm is a dynamic‑programming method that finds the most probable sequence of hidden states (a path) that could have produced a given observation sequence in a Hidden Markov Model (HMM).

________________________________________
5. In HMM POS tagging, unknown words are usually handled using:

A. Ignoring them during tagging
B. Assigning probability zero
C. Smoothing or suffix-based rules
D. Removing them from corpus

Answer: C
Explanation:

Unknown/rare words are tackled using morphological heuristics, smoothing (Laplace, Good-Turing) or suffix-based tagging methods.

What is smoothing and why is it needed?

In HMM POS tagging, we rely on:

  • Transition probabilities → P(tagt | tagt-1)
  • Emission probabilities → P(word | tag)

If a word never appeared in training data, its emission probability becomes:

P(word | tag) = 0

This is a problem because one zero probability makes the entire sentence probability zero, causing the Viterbi decoding to fail.


What Smoothing Does

Smoothing reassigns small probability to unseen words/events instead of zero. It ensures the model can still tag new sentences even with unknown words.

________________________________________
6. If an HMM uses T tags and vocabulary size V, emission matrix dimension is:

A. V × V
B. T × V
C. T × T
D. 1 × V

Answer: B
Explanation:

Every tag generates any word — hence matrix = #Tags × #Words.

________________________________________
7. A bigram POS HMM assumes:

A. Tag depends on all previous tags
B. Tag depends only on previous tag
C. Word and tag are independent
D. Tags follow uniform probability

Answer: B
Explanation:

Markov assumption → P(tแตข | tแตข₋₁), not dependent on entire tag history.

________________________________________
8. The Baum-Welch algorithm trains POS HMM using:

A. Gradient descent
B. Evolutionary optimization
C. Expectation–Maximization (EM)
D. Manual rules

Answer: C
Explanation:

Baum-Welch is an unsupervised EM algorithm re-estimating transition + emission probabilities.

________________________________________
9. Viterbi differs from Forward algorithm because it:

A. Sums probabilities of all paths
B. Chooses the maximum probability path
C. Works only for continuous observations
D. Does not use dynamic programming

Answer: B
Explanation:

Forward algorithm sums over paths. Viterbi picks best single path (max probability).

________________________________________
10. HMM POS tagging suffers most when:

A. Vocabulary is large
B. Words are highly ambiguous
C. Text is short
D. Emission is continuous

Answer: B
Explanation:

Ambiguous words like bank, can, light require context HMM cannot model deeply.

Why does HMM suffer ambiguous words?

HMMs are probabilistic sequence models based on transition and emission probabilities, so when words are highly ambiguous, the model struggles because multiple POS tags have similar probabilities for the same word.

HMM suffers with highly ambiguous words because it relies only on emission and transition probabilities, so when multiple tags are equally likely for the same word, the model becomes uncertain and may choose the wrong POS tag.

Monday, November 24, 2025

Top 10 Hidden Markov Model (HMM) MCQs with Answers and Explanations (2025 Updated)

✔ Scroll down and test yourself — answers are hidden under the “View Answer” button.


1.
In a Hidden Markov Model, which component determines how likely an observation is generated from a hidden state?

A. Transition probability
B. Initial state probability
C. Emission probability
D. Posterior probability

Answer: C
Explanation:

Emission probabilities define how observations are generated from hidden states, making them critical in mapping hidden behavior to visible outputs.

What is emission probability in HMM?

Emission probability (also called output probability) in a Hidden Markov Model represents the likelihood of observing a particular symbol or observation given that the model is in a specific hidden state at a particular time step.

In an HMM, you have two types of events happening simultaneously: hidden states that are not directly observable and observations (emissions) that are visible. The emission probability defines the relationship between these hidden states and what we actually observe.

Example: Please refer here
2. The Viterbi algorithm is used in HMMs primarily to compute:

A. The likelihood of the observation sequence
B. The most probable hidden state sequence
C. Transition matrix normalization
D. The number of emission symbols

Answer: B
Explanation:

The Viterbi algorithm finds the single most probable sequence of hidden states that could have produced the given observations.

Viterbi algorithm

The Viterbi algorithm is a dynamic programming algorithm that finds the most likely sequence of hidden states that would explain a sequence of observed events in a Hidden Markov Model. It solves the decoding problem in HMMs: given observations and the HMM model, what sequence of hidden states most likely produced those observations?

When would you need Viterbi algorithm?

You need the Viterbi algorithm whenever you have a decoding problem in a Hidden Markov Model—that is, when you need to infer the most likely sequence of hidden states from a sequence of observations. More specifically, the algorithm is essential when you face problems where hidden states influence observable data, but you only have access to the observations and need to determine what the hidden states were. Some example cases as follows;

  • When you need the single most likely state sequence (e.g., transcribing a spoken word), Viterbi gives the exact MAP (maximum a‑posteriori) path.
  • When the number of states is modest (tens to a few hundred). Runtime O(N²T) is usually fine.
Refer here for Why viterbi is efficient for NLP tasks?
3. Baum-Welch learning algorithm in HMMs is best described as:

A. A supervised algorithm for labeled sequences
B. A greedy optimization algorithm
C. An unsupervised EM-based algorithm for parameter estimation
D. A rule-based decoding algorithm

Answer: C
Explanation:

Baum-Welch is an Expectation–Maximization algorithm that updates transition and emission probabilities based on unlabeled data.

Baum-Welch algorithm (forward-backword algorithm)

The Baum-Welch algorithm is a machine learning algorithm used to solve the learning problem in Hidden Markov Models—estimating the unknown parameters of an HMM from observed data. It is also known as the forward-backward algorithm and is a special case of the Expectation-Maximization (EM) algorithm.

It is a method used to train a Hidden Markov Model (HMM) when you don’t know the correct state sequence in your data.

How does Baum-Welch algorith work?

It uses a two-step repeating process called EM (Expectation–Maximization):
  • Expectation Step (E-step): The algorithm guesses the hidden state sequence based on current model parameters. In this step, it uses both forward and backward algorithms.

  • Maximization Step (M-step): Based on that guess, the algorithm updates the model parameters to better fit the data.

Then it repeats these two steps over and over until things stop changing much (convergence).
4. If an HMM has 4 hidden states and 6 observation symbols, the size of the emission matrix is:

A. 6 × 6
B. 1 × 6
C. 4 × 6
D. 6 × 4

Answer: C
Explanation:

Each state must assign probabilities to all observation symbols, so the matrix is defined as: number of states × number of symbols.

Explanation: In a Hidden Markov Model (HMM), the emission matrix (also called the observation probability matrix) represents the probability of emitting each observation symbol from each hidden state.

So its size depends on: Number of hidden states (N) → here: 4 Number of observation symbols (M) → here: 6 Therefore: Emission Matrix Size = ๐‘ × ๐‘€ = 4 × 6
5. In a standard Hidden Markov Model (HMM), it is assumed that the next state depends only on the current state. If we remove this assumption and allow the next state to depend on multiple previous states, what would the model require?

A. Removing hidden states
B. Modeling higher-order dependencies between previous states
C. Using equal (uniform) probabilities for all transitions
D. Allowing continuous observations only

Answer: B
Explanation:

The Markov assumption states that a state depends only on the previous state. If violated, the model must incorporate higher-order context. That means, Higher-order HMMs (Second-order, Third-order, etc.), where transitions depend on multiple past states, not just one.

Mathematically:

P(qtqt1,qt2,...)=P(qtqt1)P(q_t | q_{t-1}, q_{t-2}, ... ) = P(q_t | q_{t-1})

If we violate this assumption, it means the model must consider more than one previous state — meaning:

P(qt) depends on qt1,qt2,P(q_t) \text{ depends on } q_{t-1}, q_{t-2}, \dots


6. The forward algorithm computes observation probability using:

A. Maximization over paths
B. Linear rule-based selection
C. Random sampling of hidden sequences
D. Summation over possible hidden paths

Answer: D
Explanation:

The forward algorithm does not find the best path — instead, it computes the total probability of observing the sequence by summing over all possible hidden state paths.

Forward algorithm in HMM

The Forward Algorithm in a Hidden Markov Model (HMM) is a dynamic programming method used to compute the probability of an observation sequence, given the model parameters.

In simple words: It tells us how likely a given sequence of observations is, according to the HMM.

We need it because if an observation sequence has length T and the HMM has N hidden states, then there are:

NTN^T

possible hidden-state paths that could produce the observations — too many to compute manually. The forward algorithm solves this efficiently by reusing intermediate results instead of recalculating everything.

7. A strong sign of overfitting in an HMM model is:

A. Uniform state transition probabilities
B. High accuracy on training data but poor performance on new data
C. Low number of hidden states
D. Use of discrete emission probabilities only

Answer: B
Explanation:

Overfitting occurs when an HMM learns noise and memorizes transitions instead of generalizing sequence structure.

HMM can overfit?

An HMM becomes overfitted when it learns the training sequences too specifically, rather than learning general patterns. This often happens when:

  • The model has too many hidden states

  • The emission/transition probabilities become too precise for the training data

  • The dataset is small, but the model is complex

  • The parameters are estimated without regularization

In such cases, the HMM starts modeling noise or rare patterns in the training data, instead of meaningful structure.

8. The key difference between Forward and Viterbi algorithm is:

A. Forward sums probabilities, Viterbi finds maximum sums path
B. Forward maximizes likelihood, Viterbi sums paths
C. Forward ignores emissions, Viterbi uses emissions
D. Forward is supervised, Viterbi is unsupervised

Answer: A
Explanation:

The forward algorithm computes total likelihood using summation, while Viterbi finds the best hidden sequence using maximization.

Difference between Forward algorithm and Viterbi algorithm in HMM

The Forward Algorithm and Viterbi Algorithm are two fundamental dynamic programming techniques used in Hidden Markov Models, but they solve different problems and employ different mathematical operations.

The Forward Algorithm 

  • computes the probability of observing a sequence, considering all possible hidden state paths that could have generated that sequence. It answers the question: "What is the likelihood of seeing this observation sequence?"
  • used for evaluation problem in HMM.
  • uses summation.
  • Analogy: Given all possible routes to reach a city B from city A, forward algorithm answers "What is the total chance of reaching a city using any route?"

The Viterbi Algorithm, by contrast, 

  • finds the single most probable hidden state sequence that could have generated the observations. It answers: "What is the best sequence of hidden states that explains these observations?" 
  • used for decoding problem in HMM.
  • uses maximization.
  • Analogy: Given all possible routes to reach a city B from city A, Viterbi algorithm answers "Which single route is the most likely/best?"

9. Continuous observation models like Gaussian Mixtures are preferred in speech HMMs because:

A. They eliminate decoding steps
B. Speech signals are continuous-valued
C. They simplify transition probability computation
D. They require no training data

Answer: B
Explanation:

Speech data consists of real-valued acoustic features, making continuous modeling more natural than discrete symbol assignments.

10. In HMM smoothing, the probability of being in state S at time t given observed data and model parameters is called:

A. Prior probability
B. Posterior state probability
C. Forward likelihood
D. Emission certainty factor

Answer: B
Explanation:

Posterior state probability represents confidence in each state at a specific time, calculated using the Forward-Backward algorithm.

Smoothing in HMMs means estimating the probability of hidden states using all observations — past, present, and future — to make the most accurate prediction.

Example:

Smoothing means deciding what part-of-speech a word most likely is, using the entire sentence — not just the words before it.

Visit here for more information about Hidden Markov Model (HMM)
Please visit, subscribe and share 10 Minutes Lectures in Computer Science

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents