Closed wusj18 closed 5 years ago
That line is saying "if the word's salience is bigger than the threshold (r) from the perspective of EITHER style then include it in the attribute vocab". The max does the "either style" bit.
If you just wanted words that are associated with one style (e.g. humor or romantic) then you would delete the max and do something like
for tok in vocab:
sc.salience(tok, attribute='<pre or post depending on what style you want>') > r:
print(tok)
I get it, thank you very much!
In tools/make_attribute_vocab.py have code like this:
for tok in vocab: if max(sc.salience(tok, attribute='pre'), sc.salience(tok, attribute='post')) > r: print(tok)
I wonder what's the meaning of "max" operation? cuz I thought if I want to get the attribute markers that associate with "humor" attribute, I should find words that appear in the humor corpus but do not appear in the romantic corpus.