Complex Chunking with NLTK I am trying to figure out how to use NLTK's cascading chunker as per Chapter 7 of the NLTK book. Unfortunately, I'm running into a few issues when performing non-trivial chunking measures.

Let's start with this phrase:

"adventure movies between 2000 and 2015 featuring performances by daniel craig"

I am able to find all the relevant NPs when I use the following grammar:

grammar = "NP: {&lt;DT&gt;?&lt;JJ&gt;*&lt;NN.*&gt;+}"

However, I am not sure how to build nested structures with NLTK. The book gives the following format, but there are clearly a few things missing (e.g. How does one actually specify multiple rules?):

grammar = r"""
  NP: {&lt;DT|JJ|NN.*&gt;+}          # Chunk sequences of DT, JJ, NN
  PP: {&lt;IN&gt;&lt;NP&gt;}               # Chunk prepositions followed by NP
  VP: {&lt;VB.*&gt;&lt;NP|PP|CLAUSE&gt;+$} # Chunk verbs and their arguments
  CLAUSE: {&lt;NP&gt;&lt;VP&gt;}           # Chunk NP, VP
  """


In my case, I'd like to do something like the following:

grammar = "MEDIA: {&lt;DT&gt;?&lt;JJ&gt;*&lt;NN.*&gt;+}
           RELATION: {&lt;V.*&gt;}{&lt;DT&gt;?&lt;JJ&gt;*&lt;NN.*&gt;+}
           ENTITY: {&lt;NN.*&gt;}"


It occurs to me that a CFG might be a better fit for this, but I only became aware of NLTK's support for this function about 5 minutes ago (from this question), and it does not appear that much documentation for the feature exists.

So, assuming that I'd like to use a cascaded chunker for my task, what syntax would I need to use? Additionally, is it possible for me to specify specific words (e.g. "directed" or "acted") when using a chunker?
your grammar is correct!

grammar = """MEDIA: {&lt;DT&gt;?&lt;JJ&gt;*&lt;NN.*&gt;+}
           RELATION: {&lt;V.*&gt;}
                     {&lt;DT&gt;?&lt;JJ&gt;*&lt;NN.*&gt;+}
           ENTITY: {&lt;NN.*&gt;}"""


by specifying 

RELATION: {&lt;V.*&gt;}
          {&lt;DT&gt;?&lt;JJ&gt;*&lt;NN.*&gt;+}


you are indicating that there are two ways to generate the RELATION chunk i.e. {&lt;V.*&gt;} or {&lt;DT&gt;?&lt;JJ&gt;*&lt;NN.*&gt;+}

so 

grammar = """MEDIA: {&lt;DT&gt;?&lt;JJ&gt;*&lt;NN.*&gt;+}
               RELATION: {&lt;V.*&gt;}
                         {&lt;DT&gt;?&lt;JJ&gt;*&lt;NN.*&gt;+}
               ENTITY: {&lt;NN.*&gt;}"""
    chunkParser = nltk.RegexpParser(grammar)
    tagged = nltk.pos_tag(nltk.word_tokenize("adventure movies between 2000 and 2015 featuring performances by daniel craig"))

    tree = chunkParser.parse(tagged)

    for subtree in tree.subtrees():
        if subtree.label() == "RELATION": 
            print("RELATION: "+str(subtree.leaves()))


gives

RELATION: [('featuring', 'VBG')]