Skip to content

CorporationNameOrganization not identified as 'Corporation' in tag function #98

@stevetracvc

Description

@stevetracvc

I've been chasing down a bug I'm encountering in Dedupe (which uses probablepeople) and I traced it to this line:

if 'CorporationName' in tagged or 'ShortForm' in tagged :

For some reason, the name "12society" is identified as "CorporationNameOrganization" by the parse function when using the "company" model/tagger. I don't know the details of the trained model, but it spits out things other than "CorporationName" which is a problem: the tagged OrderedDict doesn't contain a key "CorporationName" but it definitely is not a person!

I added this to the conditional to set the name_type to 'Corporation':

any(s.find("Corporation") >= 0 for s in tagged)

I'd generate a PR but it's ugly and I don't know what other outputs to expect from the parse function. Any help is appreciated!

import probablepeople

probablepeople.tag("12society")
Out[2]: (OrderedDict([('Surname', '12society')]), 'Person')

probablepeople.tag("12society", "company")
Out[3]: (OrderedDict([('CorporationNameOrganization', '12society')]), 'Person')

# I then add my 'any(...)' code from above:

probablepeople.tag("12society", "company")
Out[4]: (OrderedDict([('CorporationNameOrganization', '12society')]), 'Corporation')

"P2 Science" is another name that pops up as CorporationNameOrganization

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions