gender identification in natural language processing

后端 未结 4 1621
暖寄归人
暖寄归人 2021-02-11 03:04

I have written below code using stanford nlp packages.

GenderAnnotator myGenderAnnotation = new GenderAnnotator();
myGenderAnnotation.annotate(annotation);
         


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-11 03:36

    If your named entity recognizer outputs PERSON for a token, you might use (or build if you don't have one) a gender classifier based on first names. As an example, see the Gender Identification section from the NLTK library tutorial pages. They use the following features:

    • Last letter of name.
    • First letter of name.
    • Length of name (number of characters).
    • Character unigram presence (boolean whether a character is in the name).

    Though, I have a hunch that using character n-gram frequency---possibly up to character trigrams---will give you pretty good results.

提交回复
热议问题