ushahidi / geograpy

Extract countries, regions and cities from a URL or text
220 stars 132 forks source link

Unable to run it due to label() exception on extraction.py #34

Open AlejandroFernandesAntunes opened 4 years ago

AlejandroFernandesAntunes commented 4 years ago
Traceback (most recent call last):
  File "ale.py", line 7, in <module>
    places = geograpy.get_place_context(url="https://www.cntraveler.com/hotels/hong-kong-s-a-r-/jordan/mandarin-oriental-hong-kong")
  File "/usr/local/lib/python2.7/site-packages/geograpy/__init__.py", line 6, in get_place_context
    e.find_entities()
  File "/usr/local/lib/python2.7/site-packages/geograpy/extraction.py", line 31, in find_entities
    if (ne.node == 'GPE' or ne.node == 'PERSON') and ne[0][1] == 'NNP':
  File "/usr/local/lib/python2.7/site-packages/nltk/tree.py", line 217, in _get_node
    raise NotImplementedError("Use label() to access a node label.")
WolfgangFahl commented 4 years ago

you might want to use the more recent https://github.com/somnathrakshit/geograpy3