For some reason MATCHING cant find the third {NP} ?
As you can see there is 3 NP chunks, so it should work !! Any idea ?
In [120]: s1 = Sentence(parse('The students consider the course a challenge'))
In [121]: s1.string
Out[121]: u'The students consider the course a challenge'
In [122]: m = match('{NP} {VB*} {NP} {NP}', s1)
In [123]: m.constituents()
Out[123]: [Chunk('The students/NP'), Chunk('consider/VP'), Chunk('the course/NP')]
In [125]: s1.chunks
Out[125]:
[Chunk('The students/NP'),
Chunk('consider/VP'),
Chunk('the course/NP'),
Chunk('a challenge/NP')]
In [126]: pprint(s1)
WORD TAG CHUNK ROLE ID PNP LEMMA
The DT NP - - - -
students NNS NP ^ - - - -
consider VB VP - - - -
the DT NP - - - -
course NN NP ^ - - - -
a DT NP - - - -
challenge NN NP ^ - - - -
For some reason MATCHING cant find the third {NP} ? As you can see there is 3 NP chunks, so it should work !! Any idea ?