«
class documentation

class VaderConstants: (source)

View In Hierarchy

A class to keep the Vader lists and constants.

Method __init__ Undocumented
Method negated Determine if input contains negation words
Method normalize Normalize the score to be between -1 and 1 using an alpha that approximates the max expected value
Method scalar_inc_dec Check if the preceding words increase, decrease, or negate/nullify the valence
Constant B_DECR Undocumented
Constant B_INCR Undocumented
Constant BOOSTER_DICT Undocumented
Constant C_INCR Undocumented
Constant N_SCALAR Undocumented
Constant NEGATE Undocumented
Constant PUNC_LIST Undocumented
Constant REGEX_REMOVE_PUNCTUATION Undocumented
Constant SPECIAL_CASE_IDIOMS Undocumented
def __init__(self): (source)

Undocumented

def negated(self, input_words, include_nt=True): (source)

Determine if input contains negation words

def normalize(self, score, alpha=15): (source)

Normalize the score to be between -1 and 1 using an alpha that approximates the max expected value

def scalar_inc_dec(self, word, valence, is_cap_diff): (source)

Check if the preceding words increase, decrease, or negate/nullify the valence

B_DECR: float = (source)

Undocumented

Value
-0.293
B_INCR: float = (source)

Undocumented

Value
0.293
BOOSTER_DICT = (source)

Undocumented

Value
{'absolutely': B_INCR,
 'amazingly': B_INCR,
 'awfully': B_INCR,
 'completely': B_INCR,
 'considerably': B_INCR,
 'decidedly': B_INCR,
 'deeply': B_INCR,
...
C_INCR: float = (source)

Undocumented

Value
0.733
N_SCALAR: float = (source)

Undocumented

Value
-0.74
NEGATE: set[str] = (source)

Undocumented

Value
set(['aint',
     'arent',
     'cannot',
     'cant',
     'couldnt',
     'darent',
     'didnt',
...
PUNC_LIST: list[str] = (source)

Undocumented

Value
['.',
 '!',
 '?',
 ',',
 ';',
 ':',
 '-',
...
REGEX_REMOVE_PUNCTUATION = (source)

Undocumented

Value
re.compile("""[{0}]""".format(re.escape(string.punctuation)))
SPECIAL_CASE_IDIOMS: dict = (source)

Undocumented

Value
{'the shit': 3,
 'the bomb': 3,
 'bad ass': 1.5,
 'yeah right': -2,
 'cut the mustard': 2,
 'kiss of death': -1.5,
 'hand to mouth': -2}