Browse the docs

sentiment

How positive or negative text sounds, from -1 to 1.

Details #

sentiment(text) gives the Mac's sentiment score, from -1 (very negative) through 0 (neutral) to 1 (very positive). It scores each paragraph and averages them, offline and free.

It is reliable for English and a rough guide for other languages.

Parameters #

Takes 1 argument. {{ sentiment(text) }}

Examples #

sentiment("I love this, it is wonderful!")
→ 1
sentiment(clipboard()) < -0.3
→ false

Gotchas #

  • It judges tone, not facts: sarcasm and very short text give weak scores. Look at the sign and size, not the exact number.