vendredi 16 août 2019

Pattern-lib : Which word is the ROOT(dependency parsing) of the sentence?

In spacy the start of the dependency begins at ROOT.

In pattern the same verb is just tagged as VP. If there are multiple VP's how do you know which one is the ROOT ? Is it always the one marked with "-1" ?

 : pattern.en.parse('John hit the ball', relations=True)
 : u'John/NNP/B-NP/O/NP-SBJ-1 hit/VBD/B-VP/O/VP-1 the/DT/B-NP/O/NP-OBJ-1 ball/NN/I-NP/O/NP-OBJ-1'


 : doc = nlp(u'John hit the ball')
 : [ (t.text, t.dep_) for t in doc ]
 : [(u'John', u'nsubj'), (u'hit', u'ROOT'), (u'the', u'det'), (u'ball', u'dobj')]

What about multiple OBJ and SUBJ ?

Aucun commentaire:

Enregistrer un commentaire