I try to get the head word of some sentences. But I face No head rule defined
exception for different phrase types. As some phrase types are not that important to me, I can ignore tham by an if clause. But, for example, AP
(Adjective Phrase) is important to me and I would like to have the head word of such phrases. Any help or idea about that?
I'm using the following code:
HeadFinder hf = new UniversalSemanticHeadFinder();
hf.determineHead(oneTree, mainTree);
I'm using the latest version of Stanford CoreNLP
(3.8) from my java
code and the code works perfectly with English sentences.
Best,
It looks like you are using a different set of constituent labels. The head finder was developed for trees in the Penn Treebank (PTB) format, which, for example, use the label
ADJP
for adjective phrases. You can find the set of PTB labels and their descriptions on this page.