So I am using spaCy to help me with identifying the gender of the author of a subreddit text, for example:
"AITA for not watering the plants, I (24F)..."
It would look something like this and what I want to do is get the pronoun ("I", "My", "Me", etc) and confirm the gender of the author. (Over here it would need to identify "I (24F)").
But the issue is, when it finds the gender of another person lets say "my girlfriend (24F)", then it just gets stuck on "girlfriend" cuz it has 24F so it will infinitely look at this.
So here is my code:
for s in shape_list:
if s in ["ddX", "ddx", "dx", "dX"]:
#Female
loc = shape_list.index(s)
if text_list[loc-1].lower() in ["my", "me", "i"]:
print(text_list[loc-1])
print("> Author located! The author is female!")
continue
else:
print(text_list[loc-1])
print("Not the author")
continue
elif s in ["dd", "d"]:
#Male
loc = shape_list.index(s)
if text_list[loc-1].lower() in ["my", "me", "i"]:
print(text_list[loc-1])
print("> Author located! The author is male")
continue
else:
print("Not the author")
continue
else:
pass