Noun phrases with spacy
问题 How can I extract noun phrases from text using spacy? I am not referring to part of speech tags. In the documentation I cannot find anything about noun phrases or regular parse trees. 回答1: If you want base NPs, i.e. NPs without coordination, prepositional phrases or relative clauses, you can use the noun_chunks iterator on the Doc and Span objects: >>> from spacy.en import English >>> nlp = English() >>> doc = nlp(u'The cat and the dog sleep in the basket near the door.') >>> for np in doc