MCPcopy Create free account
hub / github.com/clips/pattern / positive

Function positive

pattern/text/en/__init__.py:175–178  ·  view source on GitHub ↗

Returns True if the given sentence has a positive sentiment (polarity >= threshold).

(s, threshold=0.1, **kwargs)

Source from the content-addressed store, hash-verified

173 return sentiment(s, **kwargs)[1]
174
175def positive(s, threshold=0.1, **kwargs):
176 """ Returns True if the given sentence has a positive sentiment (polarity >= threshold).
177 """
178 return polarity(s, **kwargs) >= threshold
179
180#---------------------------------------------------------------------------------------------------
181# python -m pattern.en xml -s "The cat sat on the mat." -OTCL

Callers 1

07-sentiment.pyFile · 0.90

Calls 1

polarityFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…