PacktPublishing / Python-Natural-Language-Processing-Cookbook

Python Natural Language Processing Cookbook, published by Packt
MIT License
167 stars 98 forks source link

Chapter02/entities_and_relations.py problem with function get_verb_phrases #2

Closed phbillet closed 2 years ago

phbillet commented 2 years ago

There is a problem in the function get_verb_phrases, the sentence verb_phrases = textacy.extract.matches(doc, verb_patterns) ends with the error "TypeError: 'module' object is not callable". I have tried to correct the problem with verb_phrases = textacy.extract.matches.token_matches(doc, verb_patterns), it works fine with the first example, but the second one ("Cells have organelles.") returns an empty list of verbs.

I use the version '0.11.0' of textacy.

zhenya-pl commented 2 years ago

The version that I was working on was 0.10.0. Textacy is not bug-free, so please use with caution.

iamdank commented 2 years ago

textacy v0.9.1 working for me.