Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stevetracvc opened this issue Mar 20, 2021 · 0 comments

Comments

@stevetracvc
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant