<i>How does the NN encode the fact that when you eat &quot;with&quot; a fork, the word &quot;with&quot; isn&#x27;t the same sort of &quot;with&quot; as eating something &quot;with&quot; anchovies.</i><p>By looking at the noun in the NP embedded in the PP rather than the preposition. Whether this actually happens depends on various factors:<p>- In some dependency annotation schemes it&#x27;s actually the head of the NP that attaches to the head with the prepositional phrase relation. Though this is uncommon, since typically the preposition is the direct dependent of the head.<p>- In some transition systems, attachment of a dependent is done when all its dependents are attached. So, at the moment the preposition is attached to a head, you already know what the preposition governs.<p>- In some transition systems, previously-made attachments can be changed (e.g. when you encounter a noun in a PP which suggests a different attachment).<p>- You might already look ahead in the buffer, either by having a small number of buffer positions as the input of the NN or by forming a representation of the current buffer using an RNN.<p>tl;dr NN can definitely learn such things, but you may have to help a bit by picking the right transition system or classifier inputs.