title: How to get all noun phrases in Spacy
body: <p>I am new to <code>Spacy</code> and I would like to extract "all" the noun phrases from a sentence. I'm wondering how I can do it. I have the following code:</p>
  
  <pre><code>import spacy
  
  nlp = spacy.load("en")
  
  file = open("E:/test.txt", "r")
  doc = nlp(file.read())
  for np in doc.noun_chunks:
      print(np.text)
  </code></pre>
  
  <p>But it returns only the base noun phrases, that is, phrases which don't have any other <code>NP</code> in them. That is, for the following phrase, I get the result below:</p>
  
  <p>Phrase: <code>We try to explicitly describe the geometry of the edges of the images.</code></p>
  
  <p>Result: <code>We, the geometry, the edges, the images</code>.</p>
  
  <p>Expected result: <code>We, the geometry, the edges, the images, the geometry of the edges of the images, the edges of the images.</code></p>
  
  <p>How can I get all the noun phrases, including nested phrases?</p>