datamade / usaddress

:us: a python library for parsing unstructured United States address strings into address components
https://parserator.datamade.us/usaddress
MIT License
1.5k stars 302 forks source link

ERROR: Unable to tag this string because more than one area of the string has the same label #340

Open baditaflorin opened 1 year ago

baditaflorin commented 1 year ago

Billings, Montana Billings is the largest city in the U.S. state of Montana, with a population of 117,116 as of the 2020 census.

  File "/Users/me/GITHUB_PROJECTS/test21.py", line 79, in <module>
    location_data = parse_location(location)
  File "/Users/me/GITHUB_PROJECTS/test21.py", line 24, in parse_location
    address_parts = usaddress.tag(address)
  File "/opt/homebrew/lib/python3.10/site-packages/usaddress/__init__.py", line 177, in tag
    raise RepeatedLabelError(address_string, parse(address_string),
usaddress.RepeatedLabelError:
ERROR: Unable to tag this string because more than one area of the string has the same label

ORIGINAL STRING:  1232 N 30th St Ste 200 Billings, MT 59101

PARSED TOKENS:    [('1232', 'AddressNumber'), ('N', 'StreetNamePreDirectional'), ('30th', 'StreetName'), ('St', 'StreetNamePostType'), ('Ste', 'OccupancyType'), ('200', 'OccupancyIdentifier'), ('Billings,', 'BuildingName'), ('MT', 'BuildingName'), ('59101', 'AddressNumber'), ('Get', 'StreetName'), ('Directions', 'StreetName')]
UNCERTAIN LABEL:  AddressNumber

When this error is raised, it's likely that either (1) the string is not a valid person/corporation name or (2) some tokens were labeled incorrectly

To report an error in labeling a valid name, open an issue at https://github.com/datamade/usaddress/issues/new - it'll help us continue to improve probablepeople!

For more information, see the documentation at https://usaddress.readthedocs.io/