Package miopia :: Package classifier :: Module BinaryStrategy :: Class BinaryStrategy
[hide private]
[frames] | no frames]

Class BinaryStrategy

source code

                                   object --+    
                                            |    
ClassificationStrategy.ClassificationStrategy --+
                                                |
                                               BinaryStrategy

This strategy allows to classify texts such as Positive or Negative

Instance Methods [hide private]
 
__init__(self, threshold)
Constructor
source code
 
_type(self, sentiment_info)
Returns: A PolarityType value in {NEGATIVE, POSITIVE}
source code

Inherited from ClassificationStrategy.ClassificationStrategy: polarity, polarity_info

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, threshold)
(Constructor)

source code 

Constructor

Parameters:
  • threshold - A float. It establish a numerical threshold to distinguish between classes
Overrides: object.__init__

_type(self, sentiment_info)

source code 
Parameters:
Returns:
A PolarityType value in {NEGATIVE, POSITIVE}
Overrides: ClassificationStrategy.ClassificationStrategy._type