Natural Language Processing

Compress a table of word use

BOTIE

Return the first supplied singular direction as a one-row projection matrix.
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

Return the first supplied singular direction as a one-row projection matrix.

A document may concern a query's subject without using exactly the same words. We want to compare documents through broader patterns of term use. The singular directions are supplied here; we will retain the strongest one and project the document table into that smaller representation.

Inspect the component calculation
Take a range(
  List: Swap rows and columns(
    Matrix: Left singular vectors as columns
  )
  First index: 0
  Stop before: 1
)
Examples and results
Left singular vectors as columns
10
01
Required result
10
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 SVD is supplied. This challenge builds truncation and projection; it does not find singular directions or train a language model. 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.

The strongest term direction uses both coordinates

This check uses the pieces from “Project documents onto the strongest supplied direction”.

BOTIE

The ordered singular directions are supplied as columns. Keep the first direction and project every document onto it. Return a one-row matrix of document coordinates, including the zero document.
Left singular vectors as columns
0.6-0.8
0.80.6
Term-document matrix
360
480

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 stage would be needed before this construction if the singular directions were not supplied?

Projection uses a fitted representation; it does not calculate the SVD or guarantee that a direction names a human concept.

The SVD is supplied. This challenge builds truncation and projection; it does not find singular directions or train a language model.

Work through the Python challenges →
Continue the coursePointwise Mutual Information →
← Distance and Similarity