liveBook · Manning

Sex

As explained in Natural Language Processing in Action, Second Edition

Sex assigned at birth is the classification recorded for a person at birth based primarily on observed physical and anatomical traits.

Sex assigned at birth is the classification recorded for a newborn, usually as male or female, using observed anatomy and sometimes chromosomes or hormones. The classification involves interpretation and judgment, and biology does not always fit a simple binary. section 5.2.2

Sex is distinct from gender. Gender includes socially constructed roles, behaviors, expressions, and identities; gender identity can differ from assigned sex, extend beyond the binary, and change over time. Pronouns can express and affirm that identity. section 5.2.3

Treat sex labels carefully when using them in data and language systems:

  • Recognize that medical data may include categories beyond female and male, such as unknown or something not listed (specify). section 5.2.2
  • Avoid treating a name as a definitive sex marker: names can correlate with recorded labels, but a particular name may have multiple labels. section 5.2.2 section 5.2.4
  • Separate assigned-sex prediction from gender inference, because systems that connect names, pronouns, and identity can reproduce gender bias and transphobia. section 5.2.3

A probabilistic name signal

A birth-certificate dataset can train a character-based perceptron to predict the recorded label associated with a first name. The result is a probability or confidence signal, not a definitive classification of a person. For example, the sampled records include both female and male entries for Timothy. section 5.2.2 section 5.2.4

>>> np.random.seed(451)
>>> URL = 'https://gitlab.com/tangibleai/nlpia2/'\
... '-/raw/main/src/nlpia2/data/baby-names-us-10k.csv.gz'
>>> df = pd.read_csv(URL)      #1
>>> df = df.sample(10_000)     #2
>>> df.shape
(10000, 6)

Inspect a sampled US birth-certificate dataset containing names, recorded sex labels, years, regions, counts, and frequencies before modeling. section 5.2.4

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains classification sources, binary limitations, data categories, and probabilistic prediction while stopping short of treating labels as definitive identity claims.
Examples
Uses US birth certificates, mixed-label names such as Timothy, and character n-grams for name-based prediction.
What you can do after
Evaluate/understand recorded-sex predictions as probabilistic dataset signals rather than conclusions about gender identity.
How it connects
Connects sex with gender, gender identity, pronouns, coreference resolution, NLP, perceptrons, and algorithmic bias.

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.