
Show HN: Flip gender in Python - Old_Thrashbarg
https://github.com/Garrett-R/gender_bender
======
Old_Thrashbarg
The biggest problem I have right now with this is "her". The 3rd person
possessive and objective cases are identical for female ("her"), but different
for male ("him" / "his").

So these 2 sentences flip "her" differently:

    
    
        It was created by her very quickly
        It was created by her very own child
    

I'm no NLP expert so if anyone has some ideas, please see this issue:
[https://github.com/Garrett-R/gender_bender/issues/2](https://github.com/Garrett-R/gender_bender/issues/2)

~~~
bdr
Have you tried nltk’s part of speech tagging?

~~~
Old_Thrashbarg
Experimented with SpaCy, didn't work too well, but will try nltk.

------
mattigames
This doesn't "examine gender norms" it just creates a lot of non-sense per
book like "She had to go to war like most women and like many ended up
amputated and homeless"

~~~
Old_Thrashbarg
Would love to hear more about why you call that nonsense.

I think that's a great example though. I'm male, and I think a common
misconception is that gender equality is only for the benefit of females. But
feminist issues effect everyone. Like women being allowed to join the
workforce increased productivity which also benefited men from having cheaper
products.

Or this example you point out, men are typically the ones being drafted into
war or at least the ones serving on the front lines. I think that raises a lot
of interesting questions too. Is that fair? Should women more often be
included in drafts or mandatory service? Should women be included in the
decisions to go to war? Would we have less wars if that were the case?

~~~
core-questions
> Like women being allowed to join the workforce increased productivity which
> also benefited men from having cheaper products

It also nearly doubled the labour force without actually doubling the number
of jobs available, which arguably resulted in the stagnation of wages to the
point where dual incomes became necessary for families to maintain the same
standard of living as they did decades ago.

There are advantages, but let's not pretend it has been some panacea. Dropping
birth rates in the first world may largely be to do with women deferring
pregnancy for career advancement.

> Should women more often be included in drafts or mandatory service?

War is war. The military needs to be distinct from other fields as it is not
an experimental playground for egalitarianism, it is the profession of
targeted death and destruction. Changes to the military have to be evaluated
in the context of "what makes the most efficient military unit", not "what
military unit represent everyone back home best". It's not a representational
game, it's a crudely real necessity for the security of a country.

On that front, real study can show what makes a more cohesive unit. If adding
women helps, do it. If it hurts, don't do it. Doing it to make a point may
endanger real lives.

> Should women be included in the decisions to go to war?

Aren't they already? Plenty of female politicians, advisors, representatives.
Of course they should be involved, but on their own merits and through their
own career advancement, please. Trudeau-style arbitrary enforcement of
representational quotas promises no guarantee of better decisionmaking.

> Would we have less wars if that were the case?

Do women have fewer interpersonal conflicts with their peers than men?

~~~
DanBC
> War is war. The military needs to be distinct from other fields as it is not
> an experimental playground for egalitarianism, it is the profession of
> targeted death and destruction. Changes to the military have to be evaluated
> in the context of "what makes the most efficient military unit", not "what
> military unit represent everyone back home best". It's not a
> representational game, it's a crudely real necessity for the security of a
> country.

NASA used to have a requirement that astronauts had to have experience as
military test pilots. The military said that test pilots could only be men.
This meant that women could never become test pilots nor astronauts.

Then someone put a few women through the NASA tests and found they performed
at the same level as men, and sometimes better than men.

Too often "let's be careful, we need to test this" is used as an excuse to
continue discrimination even though that's objectively worse.

[https://history.nasa.gov/printFriendly/flats.html](https://history.nasa.gov/printFriendly/flats.html)

~~~
core-questions
> Too often "let's be careful, we need to test this" is used as an excuse to
> continue discrimination even though that's objectively worse

You just said they tested it and they did fine. That's all I am asking for. I
don't think your quoted statement logically follows from that at all.

I think it's pretty fair to say that the battlefield is a different situation
even than being an astronaut and what works in one place may not work in all
places.

------
saghm
> Dawn Quixote

Not sure if this is intentional or not, but "Don" in this case isn't a name,
but a title. Does the library attempt to determine whether a name that can
also be a word is in fact used as a name in a given instance? (Not blaming it
for getting this one wrong if it does, since it's a Spanish rather than
English word)

~~~
Old_Thrashbarg
Actually, that was intentional just to be funny. There are indeed many words
which can sometimes be names (some months, some town names, I even know a
woman who's birth name was America).

I let the user control which names are translated (and they select a name for
each unique identified name) and allows the user to mark a suspected name as
not a name. This is the `--interactive-naming` flag.

I added that after the first iteration and reading through an ePub on my Kobo
and found tons of random proper nouns "flipped".

~~~
latexr
> I even know a woman who's birth name was America

I know an “Africa” and know of a “Madeinusa” (“made in U.S.A”, which she was
not).

~~~
jerkstate
Sounds like the Miranda musical where one of the main characters is named
"Usnavy" after the inscription on a ship..

------
apu8812
The whole gender issue has been very well covered and is now overrated.

Much more important is to get people (especially typical parochial Americans)
to realize that there exist other human beings in other countries. Even the
most sexist American male is aware of gender issues (even if he doesn't agree
with them). But even "liberal", "soft-hearted" Americans don't much care or
know about the life of someone in say Bangladesh or Indonesia.

So maybe you could also think of changing nationalities. E.g. change Anglo-
American names to Bangladeshi or Indonesian ones.

~~~
mr_bojangles
Perhaps on a macro level gender issues have been covered at a surface level.
However most people don't grasp how ingrained gender biases exist in everyday
situations or in this case, literature. This is an interesting project to
bring those more nuanced or subtle biases to light.

~~~
1000units
Everybody already knows about the missing tampons in the men's restroom. Tell
me about the little kid's life I could have saved with five dollars.

~~~
kwhitefoot
What does any of this mean?

~~~
beaconstudios
I read it as a disdainful version of "instead of focusing on small-scale
complaints about gender issues, why don't we focus on more important and
large-scale issues like saving children's lives?"

------
stared
It is interesting and close to some things I have been thinking about (vide
[http://p.migdal.pl/2017/09/30/dating-for-nerds-gender-
differ...](http://p.migdal.pl/2017/09/30/dating-for-nerds-gender-
differences.html)).

Did you try making some interactive version? I think this could be inspiring
for a large audience.

Did you try using things like word2vec, to find word “analogies”? (They are
often biased, like doctor - man + woman is nurse.) Comparing two
“translations” could be interesting.

~~~
Old_Thrashbarg
That would be interesting to try to add word2vec. I wonder if I was
successful, and the analogies are biased like you mention, then the book would
be flipped but still feel "normal".

So, "the nurse walked in and she said hi" would presumably get translated with
word2vec to "the doctor walked in and he said hi".

That's not the effect I was going for, but it would be really interesting to
compare the differences like you mention.

------
apu8812
Could you perhaps make a simple but user-friendly website that lets people
convert their epubs?

~~~
Old_Thrashbarg
I have thought about that. I will do if there's demand since I would really
love for people to be actually using this and right now only developers can
use it.

Will require a bit of simple front end work. For example, translating an epub
really needs to involve the user (which is currently available in the
terminal) since it's very difficult to automatically translate names.

For example, "April" can be a month, a town name or a person's name. It needs
flipping if it's a name, but not otherwise. Even context sometimes doesn't
help: "We were worried about April."

------
stfwn
Nice one! Original, sharp and funny.

~~~
Old_Thrashbarg
Thanks, you should try reading one of the epub's, it's quite entertaining, and
you some interesting assumptions that you may otherwise would have overlooked.

------
sadamznintern
“If Ivan weren’t my son perhaps I’d be dating him”

Loved the examples, can’t wait to try it!

~~~
Old_Thrashbarg
Great, and feel free to leave a comment if you do use it in some interesting
way!

------
1000units
Excuse me, but this "flipping" business only further reinforces the idea of
gender as a binary construct, which is problematic.

~~~
backpropaganda
Not sure if you're trolling but a tool which flips between two popular genders
doesn't deny existence of other genders. Not everything related to gender has
to be about the gender spectrum.

~~~
rectangletangle
A k2+ gender version would be an interesting expansion on the idea though.
Since the notion of a complementary or inverse gender isn't universal to all
genders, maybe cases where there's no clear inverse the gender could be
swapped with a randomly chosen gender. Or just swap any explicit gender
reference with a different randomly chosen gender. This becomes a bit more
challenging if you want to keep the output cohesive though, since you'd
probably have to introduce some sort of entity linking scheme.

Another issue is finding an appropriate k for genders, assuming this package
is implemented with some sort of hard coded gender mapping. This becomes more
complex when accounting for different cultures, which probably just ends up
multiplying k by m cultures.

