Natural Language Processing · TEE · papers

Q7c · Co-occurrence with inconsistent requested comparisons

2025-02-21 · re-exam · recovered AI paper

Previous examination · complete worked answers

Question. Construct a whole-sentence co-occurrence matrix for: The bird flew across the sky. The cat watched the bird. The flowers grew in the garden. The bird rested on the tree. The cat slept near the tree. Targets={bird,cat,garden,flowers}; contexts={sky,tree,garden,slept}. The printed follow-up asks dot products boy–dog and boy–sun and a plot on kicked/field dimensions. [10 marks]

Answer

Given

Use the exact target/context lists above.

To find

Construct the supported matrix and identify which later requests are undefined.

Formula: which one and why

Count ordered target-token/context-token pairs in the same sentence, excluding the target token itself. A single garden occurrence cannot co-occur with itself. If a classroom convention uses sentence-level presence including diagonal, only garden→garden changes from0to1; state that choice.

Step 1. Enumerate contributions and sum

SentenceTarget occurrencesContext occurrences
1birdsky
2cat, bird
3flowers, gardengarden
4birdtree
5catslept, tree
Target / contextskytreegardenslept
bird1100
cat0101
garden0000
flowers0010

Step 2. Check requested names before multiplying

boy,dog,sun are not target rows; kicked,field are not context columns. Therefore the requested dot products and plot cannot be calculated from the supplied matrix. Zero vectors for invented words would not repair the missing givens.

Step 3. Clearly labelled corrected illustration

If the follow-up were changed to bird–cat and bird–flowers, using the displayed rows: bird·cat=1×0+1×1+0×0+0×1=1; bird·flowers=1×0+1×0+0×1+0×0=0. A sky/tree plot would use bird(1,1),cat(0,1),garden(0,0),flowers(0,0). These substitutions are teaching examples, not printed instructions.

Final answer

The original matrix is solved; its requested boy/dog/sun comparisons and kicked/field plot are not well-defined. Ask for corrected target/context names rather than inventing a numerical answer.

Source / convention note. Source defect: follow-up names belong to another corpus. Exact supported matrix is complete; unsupported parts are explicitly unresolved from the original data.