dhmit / gender_analysis

A toolkit for analyzing gendered language across sets of documents
BSD 3-Clause "New" or "Revised" License
11 stars 5 forks source link

Created Gender and Pronoun Structures #123

Closed samimak37 closed 4 years ago

samimak37 commented 4 years ago

This PR creates a Gender and PronounSeries class that allows for a much wider spectrum of gender and pronoun analyses. This lays the groundwork for #102, but does not change any of the actual analyses functions mentioned in that issue.

The only user-facing change for this PR is that MASC_WORDS and FEM_WORDS in common.py use the new ProunounSeries structure, with the intention that these will be replaced with male and female Gender objects once the analysis functions support them.

codecov-io commented 4 years ago

Codecov Report

Merging #123 into master will increase coverage by 1.58%. The diff coverage is 97.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #123      +/-   ##
==========================================
+ Coverage   42.59%   44.18%   +1.58%     
==========================================
  Files          10       12       +2     
  Lines        1594     1634      +40     
  Branches      353      359       +6     
==========================================
+ Hits          679      722      +43     
+ Misses        861      858       -3     
  Partials       54       54              
Impacted Files Coverage Δ
gender_analysis/gender.py 96.15% <96.15%> (ø)
gender_analysis/pronouns.py 100.00% <100.00%> (ø)
gender_analysis/corpus.py 62.18% <0.00%> (ø)
gender_analysis/analysis/instance_distance.py 34.58% <0.00%> (+0.25%) :arrow_up:
gender_analysis/analysis/gender_adjective.py 40.00% <0.00%> (+0.62%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ee1d41f...3bcd2b4. Read the comment docs.

ryaanahmed commented 4 years ago

This looks really good to me. My one concern was also @kenalba's -- how we extend this to incorporate names -- but it seems to me that we can add a prop to the Gender class that points at names that we associate with a given gender.

Great doctests, btw!

merging