Tokenization & Embeddings · Problem 3 of 4
Implement Viterbi segmentation for a unigram-LM tokenizer given token log-probs.
Implement the function/class skeleton in the editor. Any correct approach is accepted.
import math
def viterbi_segment(s, logp, max_len=None):
raise NotImplementedErrorReady when you are
Submit your solution and a structured review appears here — verdict, score, and concrete feedback. Any correct approach passes.
Implement Viterbi segmentation for a unigram-LM tokenizer given token log-probs.
Implement the function/class skeleton in the editor. Any correct approach is accepted.