Because the tag method returns an OrderedDict with labels as keys, it will throw a RepeatedLabelError error when multiple areas of a name have the same label, and thus can’t be concatenated. When RepeatedLabelError is raised, it is likely that either (1) the input string is not a valid person/corporation name, or (2) some tokens were labeled incorrectly.

RepeatedLabelError has the attributes original_string (the input string) and parsed_string (the output of the parse method on the input string). You can use these attributes to write custom exception handling, for example:

If you already know that the string refers to a person or a company, you can indicate that to probable people by using the type argument of the parse and tag methods. Valid options are 'person' and 'company'.