Skip to content

Releases: meirelesff/genderBR

genderBR v1.3.0

Choose a tag to compare

@meirelesff meirelesff released this 10 Apr 17:49

This is a new version of the genderBR package that includes a new function: get_gender_nn(), which uses a character-level neural network to predict gender from Brazilian first names. This model can generalise to names not present in the IBGE census dataset, so it can be used as a complement to the existing functionality in the package. The release also includes some improvements, tests, and documentation updates.

  • get_gender_nn() is a new exported function that uses a character-level neural network to predict gender from Brazilian first names. Unlike get_gender(), this function can generalise to names not present in the IBGE census dataset.
  • Added clear_nn_cache() to manage the in-memory model cache.
  • Added download_gender_model(), an internal function that handles downloading and caching the neural network model weights and vocabulary from Hugging Face.
  • Replaced iconv() with chartr() for stripping accents in name cleaning. The previous approach relied on iconv(name, to = "ASCII//TRANSLIT"), which is platform-dependent and returns NA on macOS for accented names (e.g., "joão"). The encoding argument in get_gender, get_gender_nn, and map_gender is now deprecated and will be removed in a future version.
  • Improved test coverage for the new function and edge cases.
  • Added torch to Imports; luz and httr2 to Suggests.

genderBR v1.2.0

Choose a tag to compare

@meirelesff meirelesff released this 15 Jan 19:34

This is a minor update of the genderBR package that includes several improvements and, more importantly, support for Brazilian 2022 Census data. Changes in this version include:

  • Added support for the 2022 IBGE names API through a new year argument in get_gender, which allows users to access the most recent data for gender prediction in Brazil for both the national and state levels. Code changes do not break backward compatibility.
  • Updated the default year in get_gender to 2022.
  • Internal dataset nomes now provides probabilities for both 2010 and 2022, enabling offline predictions and threshold tuning for either year when internal = TRUE.
  • Removed the magrittr dependency by switching to R's native pipe (requiring R 4.1.0 or higher).
  • Replaced dplyr/tibble joins with a data.table backend to speed up internal merges and reduce dependencies.
  • Updated and added new tests to ensure no errors when using 2022 data.
  • Improved documentation and examples to reflect the new functionality and changes.
  • Added a new section in the README discussing ethical considerations.

genderBR v1.1.2

Choose a tag to compare

@meirelesff meirelesff released this 03 May 01:36

Minor fixes and improvements

This patch version essentially makes the package more robust by:

  • Introducing a few minor bug fixes
  • Creating new internal input tests
  • Creating unit tests