mpeds icon indicating copy to clipboard operation
mpeds copied to clipboard

LocationCoder returning wrong Montreal

Open erleholgersen opened this issue 8 years ago • 0 comments

Our location coder returns Montreal, Wisconsin (population 807 at 2010 census) when given texts about Montreal. Even adding Quebec as context doesn't help, as the coder then returns Montreal, Wisconsin and Quebec, North Carolina (a mountain).

from mpeds.open_ended_coders import *

coder = LocationCoder()

print coder.getLocation('Montreal', as_str = True) 
# Montreal, Wisconsin, United States, 46.428, -90.24601

coder.getLocation('Montreal, Quebec', as_str = True) 
# Quebec, North Carolina, United States, 35.14011, -82.87569; Montreal, Wisconsin, United States, 46.428, -90.24601

coder.getLocation('Montreal, Canada', as_str = True).decode('utf-8')
# Montréal, Québec, Canada, 45.50884, -73.58781

This goes back to the underlying CLIFF location coder, so I'm not sure what we can do to fix it. But it might be worth looking into, especially if we want MPEDS to be useful for non-American news sources. Presumably Canadian news articles won't refer to Montreal as Montreal, Canada.

erleholgersen avatar Jun 28 '17 15:06 erleholgersen