All labs Animated labs The chapter Course home

Lab 03COALS, counting both sides

COALS uses a shorter window than HAL, four words wide, and it ramps in both directions: 4, 3, 2, 1 going out either way. One matrix, not two, and it comes out symmetric.

Target 0 of ·
Press play, or step through one target word at a time.

Weighted co-occurrence window 4 · weights 4, 3, 2, 1 on both sides

What just happened

Because the window is symmetric, whatever wood scores against chuck it also scores in the other direction. The matrix mirrors across its diagonal, so unlike HAL there is nothing extra to be gained by keeping the row and the column apart.

Every count here is added on screen, from the sentence above, with the window coals.py uses. Nothing is read from a stored table.

Counting is only the first of the three COALS steps. The counts then become correlations, which stops a common word like the from dominating every vector purely by showing up everywhere, and the correlations are finally truncated by SVD. This animation is step one, where the arithmetic is still something you can check by hand.

Reference: Rohde, Gonnerman and Plaut, An improved model of semantic similarity based on lexical co-occurrence, 2006.

Read the chapter · Run the code