Natural Language Processing

Recover the boundaries behind the characters

BOTIE

Convert the B/E/S path into after-character boundary indicators.
Ready to test
0 passed · 0 failed · 1 not run

An empty floor. Start with the information your machine needs.

Received result

Your answer will arrive here.

Examples, experiments and workspace controls
Live values

Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.

Try your own inputs

Use a copy of the example to try your own data. Keep the problem's assumptions in mind, and predict the effect of a change before checking the output. You can also add another branch to compare two ways of doing the calculation.

Start at an output arrow, then click or drag to an input. Drag empty space to pan. Delete removes a selection. Ctrl/Cmd+Z undoes a change.
Context for this challenge

Convert the B/E/S path into after-character boundary indicators.

We want to recover word boundaries from a character sequence. A hidden model has already chosen a state for each character, describing its place in a word. Let's turn that state path into actual text pieces so we can see what those states mean.

Inspect the component calculation
Read word-end states(
  State sequence: Decoded state path
)
Examples and results
Decoded state path
  1. 0B
  2. 1E
  3. 2S
Required result
  1. 00
  2. 11
  3. 21
Try a fresh construction

This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.

Stuck? Inspect a worked construction

The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.

Assumptions and test precision

The state path is supplied here. The lesson explains how transition and emission scores let Viterbi choose that path; this challenge builds the conversion from states to words. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.

Your last tested pieces can start the full construction. An existing draft there keeps its own pieces.

Single-character words before a two-character word

This check uses the pieces from “Turn word-ending states into cuts”.

BOTIE

The decoded path uses S for a one-character word, B for a beginning, and E for an ending. Recover the words from this supplied path without changing their order.
Characters
我爱机器
Decoded state path
  1. 0S
  2. 1S
  3. 2B
  4. 3E

Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.

Build a construction in the workspace above first. This case will test those pieces.

Which transition and emission calculations would be needed before this workshop could receive its state path?

State interpretation is downstream of inference; do not mistake an interpreted path for a learned model.

The state path is supplied here. The lesson explains how transition and emission scores let Viterbi choose that path; this challenge builds the conversion from states to words.

Work through the Python challenges →
Continue the courseLearning Boundaries From Examples →
← The Word Lattice