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

author last name "de Lhoneux" incorrectly uppercased to "De Lhoneux"? #171

Open
nschneid opened this issue Apr 19, 2024 · 4 comments
Open

Comments

@nschneid
Copy link

As reported by @mdelhoneux in acl-org/acl-anthology#3208

I wonder if

if len(last_name)>2:
last_name = " ".join([n[0].upper() + n[1:].lower() if (n==n.upper() or n==n.lower()) else n for n in last_name.split(" ")])

might be the culprit.

@nschneid
Copy link
Author

nschneid commented Apr 19, 2024

It looks like the heuristic implemented there is that each word of the name that is all-lowercase or all-uppercase is converted to initial capitalization.

It might be better to tweak the capitalization of the words of the name only if none of the words of the name distinguish uppercase and lowercase, i.e.:

if len(last_name)>2:
    if all(n.isupper() or n.islower() for n in last_name.split(" ")):   # name does not contain any words with both uppercase and lowercase characters; impose initial-only capitalization for each word
        last_name = " ".join([n[0].upper() + n[1:].lower() if (n==n.upper() or n==n.lower()) else n for n in last_name.split(" ")]) 

UPDATE: realized the inline if condition is redundant

if len(last_name)>2:
    if all(n.isupper() or n.islower() for n in last_name.split(" ")):   # name does not contain any words with both uppercase and lowercase characters; impose initial-only capitalization for each word
        last_name = " ".join([n[0].upper() + n[1:].lower() for n in last_name.split(" ")]) 

@mjpost
Copy link
Collaborator

mjpost commented Jun 11, 2024

I would love to see a list of names as exported from Open Review alongside the output of this function. We should really have a unit or regression test for this function since it is very important and getting it wrong causes a lot of corrections and headaches downstream.

@crux82
Copy link
Collaborator

crux82 commented Jun 11, 2024

Hi @mjpost

I will do so when I download the list of authors from the next EMNLP. I will apply the update suggested by @nschneid so we can see the difference and maybe "fine-tune" it.

@zeeraktalat
Copy link

There was a similar issue for hyphenated names, which was addressed in #159 maybe we can take a similar approach here? Basically, it uses what people provide as ground truth and always capitalizes the first and last. Middle is only capitalized if the person capitalized it in their softconf profile (so would need to be addressed for open review.

Potentially worth having shared functionality in a file of its own, so that we avoid duplicates :)

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

4 participants