Chunk filtering NLP

High everybody :upside_down_face: I was completing an exercise in NLP on chunk filtering (exercise 8 of 9) and this was the first time I had to look for the solution. I found that even with the solution I probably would not have understood the logic.

My trouble with understanding the solution is that a noun phrase was consistently identified as a

chunk_grammar = 
"NB: {<DT>?<JJ>*<NN>}"

But when you use the chunk filtering method as per the solution it captures many other parts of speech labels including
<PRP> <VBD> etc

So, it suggests to me that it didn’t want to find noun-phrases specifically, it only filtered out verbs or prepositions using:

chunk_grammar = """NP: {<.*>+}
                       }<VB.?|IN>+{"""

Am I on anybody else’s page with this? What am I missing from the guidance provided at step 2:

Define a piece of chunk grammar named chunk_grammar that will chunk a noun phrase using chunk filtering. Name the chunk NP .

Thanks
Michael

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.