Live data from Hacker News

JavaScript library that converts a string to gender-neutral language?

news.ycombinator.com

1–10 of 13 posts

JavaScript library that converts a string to gender-neutral language?

#1
I'm working on a project that anonymises resumes to reduce bias and discrimination of things like location, gender and age.

One of the options I'd like to provide is the ability to ensure that the content is gender-neutral to avoid bias.

For example, a summary that includes the text: "She is an esteemed archaeologist and writer based in Greece. Her primary residence is in Athens, but she spends much of her time in Marrakech."

Should be converted to: "They are an esteemed archaeologist and writer based in Greece. Their primary residence is in Athens, but they spend much of their time in Marrakech."

I started by just creating a function with a bunch of .replaceAll() statements, but quickly realised that changing from "he"/"she" to "they" changes pretty much every verb that follows the word (e.g. he runs > they run, she does > they do, etc...).

Just wandering if anyone has heard of a library to tackle this or has any other ideas on how to tackle the task.

Thanks!

Re: JavaScript library that converts a string to gender-neutral language?

#6
Would it work if you replaced “he” or “she” with “candidate” and “his” or “her” with “candidate’s” or with “their”?

That will prevent errors of concord (everything remains singular so you don’t have to change the verbs) and the sentences will mostly flow fine.

Your example would become: “Candidate is an esteemed archaeologist and writer based in Greece. Candidates’s (or “their”) primary residence is Athens, but they spend much of their time in Marrakech.

Re: JavaScript library that converts a string to gender-neutral language?

#7

Why don't you just change it all to she?

I mean, yeah, could do. Kinda defeats the gender-neutral part though?

If everyone is presented as the same gender, it stops becoming a variable, no? I get that it's probably not applicable for whatever you're doing, but it would be the easiest solution. Or equivalently just put s/he?

Re: JavaScript library that converts a string to gender-neutral language?

#8

Earlier quoted context omitted.

I mean, yeah, could do. Kinda defeats the gender-neutral part though?

If everyone is presented as the same gender, it stops becoming a variable, no? I get that it's probably not applicable for whatever you're doing, but it would be the easiest solution. Or equivalently just put s/he?

In an ideal world it would be okay to name everyone "she", but in our world that candidate would still carry any biases associated with "she".

Replacing with "s/he" could be a viable option, however. It doesn't read particularly well but it does seem to do the job—I will definitely consider this option!

Re: JavaScript library that converts a string to gender-neutral language?

#9

Would it work if you replaced “he” or “she” with “candidate” and “his” or “her” with “candidate’s” or with “their”? That will prevent errors of concord (everything remains singular so you don’t have to change the verbs) and the sentences will mostly flow fine. Your example would become: “Candidate is an esteemed archaeologist and writer based in Greece. Candidates’s (or “their”) primary residence is Athens, but they…

Hmm this could work. I would prefer "they"/"their", but I quite like the "the candidate"/"their" option!

That seems to work. I will have a play around with this to see if it reads well with a few more examples.

Post reply on HN