lingtools.anew module

class lingtools.anew.ANEWFeatures(tokenizer_obj=None, config_file=None)[source]

Bases: object

Extracts the average and standard deviation scores of the words in the document according to the Affective Norms for English Words (ANEW).

  • avg_valence (range: 1-9)
  • sd_valence
  • avg_arousal (range: 1-9)
  • sd_arousal
  • avg_dominance (range: 1-9)
  • sd_dominance

Reference: Bradley, M. M., & Lang, P. J. (1999). Affective norms for English words (ANEW): Instruction manual and affective ratings (pp. 1-45). Technical report C-1, the center for research in psychophysiology, University of Florida.

Parameters:
  • tokenizer_obj (LocalTokenizer) – initialized tokenizer object
  • config_file (string) – Configuration file to use (optional. See Configuration).
static get_feature_names()[source]

Returns a list of feature names in the same order as the features returned by get_features().

Returns:list of feature names
Return type:list
get_features(deepstruc_doc)[source]

Returns features for one document, in the same order as returned by get_feature_names().

Parameters:deepstruc_doc (list) – The incoming document, pre-processed as a Deep structure pos-tagged document.
Returns:list of features
Return type:list
static get_group_name()[source]

Get the human-readable name of the feature set.

Returns:unique identifier of the feature set
Return type:string