mpeds icon indicating copy to clipboard operation
mpeds copied to clipboard

Mixed city, state and country data in location tagger

Open erleholgersen opened this issue 8 years ago • 0 comments

Our location tagger currently returns the "most specific" tags from the CLIFF results. For example, if the CLIFF results include data on cities, it will return all cities. If there are states without mention of specific cities, the tagger will return all states.

This causes problems with mixed city, state, and country data. For example:

from mpeds.open_ended_coders import *

coder = LocationCoder()
string = "Protesters gathered in New York City and across Connecticut"

print coder.getLocation(string) # returns New York City, no mention of Connecticut

# By contrast, Connecticut shows up in the CLIFF results
cliff_results = coder._getCLIFF(string)
print json.dumps(cliff_results, indent = 4, sort_keys = True)

erleholgersen avatar Jun 23 '17 16:06 erleholgersen