How do I find the gender of person from his/her occupation in python

Viewed 218

I am a pet project where i'm investigating that women in asia are mostly depicted as doing labor or house hold jobs while men are mostly doing more respectable jobs like doctor, surgeon, professor etc.

I am working on a python script which given a sentence would estimate the gender for the occupation found in the given piece of text.

E.g: The patient consulted the doctor for treatment, He knows his stuff very well and cured lots of patients in the past. We can see that the doctor is clearly a male here. That's what I wanna do. Find the gender of person doing the occupation from text.

What have i done: I thought of counting the male words/pronouns such as he / she / his / her and then counting their total to see who has got more frequency to estimate the gender.

What's the problem: The approach i'm using is not a good estimator of the problem.

E.g:

He asked the doctor to treat him as she has treated him the past. Here in this example, the male words are more in number (He, him, him) than the female words (she) while clearly the doctor is female.

What i'm looking for? I'm looking for more intelligent ideas from this kaggle community to help me progress on this problem. Any leads big or small would be really appreicated.

1 Answers

You can use Stanford OpenIE.

You can count number of subjects from output given by OpenIE and their relation to occupation(noun).

Output the gender of subject, the subject which is related to occupation.

Here is an example Sentence dependency:

enter image description here

Related