Open saldutgr opened 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']}
places.country_cities
{'Italy': ['Rome', 'Naples', 'Codogno'], 'United States': ['Rome', 'Naples', 'Pierre', 'Brussels', 'Italy'], 'Belgium': ['Brussels'], 'France': ['Pierre']}
you might want to use the more recent https://github.com/somnathrakshit/geograpy3
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']}