ushahidi / geograpy

Extract countries, regions and cities from a URL or text
219 stars 133 forks source link

regions/countries returning all proper nouns #32

Open saldutgr opened 5 years ago

saldutgr commented 5 years ago

import geograpy as gp url = "https://www.politico.eu/article/italy-incurable-economy/" places = gp.get_place_context(url = url) places.regions

Returns a list of proper nouns from the article, the same goes for places.countries.

places.country_cities seems to do better but still gives a funky return. {'Italy': ['Rome', 'Naples', 'Codogno'], 'United States': ['Rome', 'Naples', 'Pierre', 'Brussels', 'Italy'], 'Belgium': ['Brussels'], 'France': ['Pierre']}

WolfgangFahl commented 4 years ago

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