JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q26154F
  • License CC-BY-NC-SA-3.0

Predict the gender of a string's author

Package Exports

  • predictgender

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (predictgender) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

predictgender - Node.js based Gender Prediction

Predict the gender of a string's author.

Usage

const pg = require('predictgender')
const opts = {
  'return': 'gender', // Valid options include: 'number', 'lex', or 'gender' (default)
  'ngrams': true      // include bigrams and trigrams in analysis, not recommended for long strings
}
let text = "A long string of text...."
let gender = pg(text, opts)

Options

"return"

Valid options include: 'number', 'lex', or 'gender' (default)

Number returns -1 for male, 0 for indeterminate or unknown, and 1 for female.

Lex returns the lexical value, positive values being female, negative being male.

Gender returns a string, "Male", "Female", or "Unknown"

'ngrams'

Boolean. Indicates whether or not to include bigrams and trigrams.

It is recommended you set this to false for very long strings.

Acknowledgements

References

Schwartz, H. A., Eichstaedt, J. C., Kern, M. L., Dziurzynski, L., Ramones, S. M., Agrawal, M., Shah, A., Kosinski, M., Stillwell, D., Seligman, M. E., & Ungar, L. H. (2013). Personality, gender, and age in the language of social media: The Open-Vocabulary Approach. PLOS ONE, 8(9), . . e73791.

Lexicon

Using the gender lexicon data from http://www.wwbp.org/lexica.html

Used under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported licence

Licence

(C) 2017 P. Hughes Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported