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. Unlikeget_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()withchartr()for stripping accents in name cleaning. The previous approach relied oniconv(name, to = "ASCII//TRANSLIT"), which is platform-dependent and returnsNAon macOS for accented names (e.g., "joão"). Theencodingargument inget_gender,get_gender_nn, andmap_genderis now deprecated and will be removed in a future version. - Improved test coverage for the new function and edge cases.
- Added
torchtoImports;luzandhttr2toSuggests.