title: Removing noun phrases containing stop words using spaCy
body: <p>I have been using spaCy to look for most used nouns and noun_phrases</p>
  
  <p>I can successfully get rid of punctuation and stop words when looking for single nouns</p>
  
  <pre><code>docx = nlp('The bird is flying high in the sky blue of color')
  
  # Just looking at nouns
  nouns = []
  for token in docx:
      if token.is_stop != True and token.is_punct != True and token.pos_ == 'NOUN':
          nouns.append(token)
  
  # Count and look at the most frequent nouns #
  word_freq = Counter(nouns)
  common_nouns = word_freq.most_common(10)
  </code></pre>
  
  <p>Using noun_chunks in order to determine phrases however results in Attribute error</p>
  
  <pre><code>noun_phrases = []
  for noun in docx.noun_chunks: 
      if len(noun) &gt; 1 and '-PRON-' not in noun.lemma_ and noun.is_stop:
          noun_phrases.append(noun)
  </code></pre>
  
  <blockquote>
    <p>AttributeError: 'spacy.tokens.span.Span' object has no attribute> 'is_stop'</p>
  </blockquote>
  
  <p>I understand the nature of message, but I can't for the life of me get the syntax correctly where the presence of a stop word in a lemmatized string would excluded from being appended to the noun_phrases list</p>
  
  <p><strong>Output without removing stopwords</strong></p>
  
  <p>[{'word': 'The bird', 'lemma': 'the bird', 'len': 2},
   {'word': 'the sky blue', 'lemma': 'the sky blue', 'len': 3}]</p>
  
  <p><strong>Intended Output (removing lemma containing stopwords, which include "the"</strong></p>
  
  <p>[{}]</p>