finding the POS of the root of a noun_chunk with spacy
问题 When using spacy you can easily loop across the noun_phrases of a text as follows: S='This is an example sentence that should include several parts and also make clear that studying Natural language Processing is not difficult' nlp = spacy.load('en_core_web_sm') doc = nlp(S) [chunk.text for chunk in doc.noun_chunks] # = ['an example sentence', 'several parts', 'Natural language Processing'] You can also get the "root" of the noun chunk: [chunk.root.text for chunk in doc.noun_chunks] # = [